Showing posts with label 8051. Show all posts
Showing posts with label 8051. Show all posts

Thursday, November 20, 2008

Serial One Pin LCD Module by 89C2051

There years ago, I am working on several design related to a tiny but powerful MCU 89C2051.

Interface a 16x2 character LCD module by 89C2051 and programed by BASCOM 8051.

89C2051 as the LCD Module interface controller so that I can use only one pin to put ALL LCD module command to the LCD Module. I think this idea is great and start to make:
  • Serial One Pin LCD Module with several options
  • Serial One Pin keyboard matrix reading
  • Serial One Pin I/O expander
  • Serial One Pin 4-digit LED display (7-segement Read LED unit)
Even I build them as Kit and sell in eBay until I have no time to manage them!

Wednesday, November 12, 2008

BASCOM 8051 Basic Compiler

This is the first Basic compiler on MCU project at few years ago and till now it is still my favourite. Simple, Easy to use and FREE (demo version can run 4K code).

It work fit with ATMEL 89C51 and 89c4051.



Key Benefits

Structured BASIC with labels.
Structured programming with IF-THEN-ELSE-END IF, DO-LOOP, WHILE-WEND, SELECT- CASE.
Fast machine code instead of interpreted code.
Variables and labels can be as long as 32 characters.
Bit, Byte, Integer, Word, Long, Single and String variables.
Compiled programs work with any 8051 uP such as AT89C1051, AT89C2051, 8031, 8032, 8051, 8052, 80552, 80535 and 80537 m Processors.
Statements are highly compatible with Microsoft’s VB/QB.
Special commands for LCD-displays , I2C chips and 1WIRE chips.
Integrated terminal emulator with download option..
Integrated simulator for testing.
Integrated flash programmer and support for SPI, PG2051, PG302, SE512, SE514, TAFE. (hardware can be purchased separately)
Editor with statement highlighting.
Context sensitive help.
For compatibility with BASCOM LT, there is also a 32-bit version of the BASCOM LT compiler.

The following statements are supported :

Decision and structuresIF, THEN, ELSE, ELSEIF, END IF, DO, LOOP, WHILE, WEND, UNTIL, EXIT DO, EXIT WHILE, FOR, NEXT, TO, DOWNTO, STEP, EXIT FOR, ON .. GOTO/GOSUB, SELECT, CASE.
Input and outputPRINT, INPUT, INKEY, PRINTHEX, INPUTHEX, LCD, UPPERLINE, LOWERLINE,DISPLAY ON/OFF, CURSOR ON/OFF/BLINK/NOBLINK, HOME, LOCATE, SHIFTLCD LEFT/RIGHT, SHIFTCURSOR LEFT/RIGHT, CLS, DEFLCDCHAR, WAITKEY, INPUTBIN, PRINTBIN, LCDHEX, OPEN, CLOSE, DEBOUNCE, SHIFTIN, SHIFTOUT.
Numeric functionsAND, OR, XOR, INC, DEC, MOD, NOT, ABS, BCD.
I2CI2CSTART, I2CSTOP, I2CWBYTE, I2CRBYTE, I2CSEND and I2CRECEIVE.
1WIRE1WWRITE, 1WREAD, 1WRESET.
SPISPIINIT, SPIIN, SPIOUT.
Interrupt programmingON INT0/INT1/TIMER0/TIMER1/SERIAL, RETURN, ENABLE, DISABLE, PRIORITY SET/RESET, COUNTERx, CAPTUREx, INTERRUPTS, CONFIG, START, LOAD.
Bit manipulationSET, RESET, ROTATE, BITWAIT.
VariablesDIM, BIT , BYTE , INTEGER , WORD, LONG, SINGLE, STRING , DEFBIT, DEFBYTE, DEFINT, DEFWORD.
MiscellaneousREM, ' , SWAP, END, STOP, CONST, DELAY, WAIT, WAITMS, GOTO, GOSUB, POWERDOWN, IDLE, DECLARE, CALL, SUB, END SUB, MAKEDEC, MAKEBCD, INP,OUT, ALIAS, DIM , ERASE, DATA, READ, RESTORE, INCR, DECR, PEEK, POKE, CPEEK, GETRC5.
Compiler directives$INCLUDE, $NOINIT, $BAUD and $CRYSTAL, $OBJ, $SERIALINPUT, $SERIALOUTPUT, $ROMSTART, $RAMSIZE, $RAMSTART, $MONSTART, $IRAMSTART, $DEFAULT XRAM, $ASM-$END ASM, $LCD.
Conditional compilation#IF, #ELSE, #ENDIF
String manipulationSTRING, SPACE, LEFT, RIGHT, MID, VAL, HEXVAL, LEN, STR, HEX, LCASE, UCASE
To make a program takes just a few steps :
Write the program in BASIC
Compile it to fast machine binary code
Test the result with the integrated simulator(with additional hardware you can simulate the hardware too)
Program the chip with one of the integrated programmers.(hardware must be purchased separately)