??? 04/30/08 11:19 Read: times |
#154209 - try to initialise at startup Responding to: ???'s previous message |
on reading your assembely code one thing is clear that you are initialising LCD everytime. Also as Mr. Michael has said it seems that LCD is not initialised properly.
Try to follow the start up procedure. 1) disable all interrupts (EA = 0; ofcourse this is state at poweron). 2) initialise all SFR registers necessary. (Timer related & interrupt related in this case) 3) now initialise ports if necessary. 4) now initialise peripherals (LCD in this case) 5) initialise global variables if any (mcount, ledtick, lcdtick) 6) now initialise SFR bits other than interrupt (TR0 in this case) 7) now set necessary interrupts using reg / bit address (ET0 & EA in your case) 8) let your timer isr only write the data (i.e. call only write_lcd_text from isr) 9) in case of lcd considor maintaining the cursor position. 10) try to follow structure as follows 11) ANY constant strings, write them at bottom of file(testing data) REMEMBER THIS IS JUST A PATTERN NOT PROGRAM ALSO THIS IS NOT THE ONLY PATTERN ... /******hard ware definition here******/ here you have equ statements like RS EQU P2.5 LCDDATE EQU P0 THESE ARE ONLY EXAMPLES /*****MEMORY DEFINATIONS HERE*****/ here you have equ statements like MCOUNT EQU 45H /*****CONSTANT DEFINATIONS HERE****/ here you have equ statements like OFF EQU 0 ON EQU 1 (IN YOUR CASE THIS DOESNOT EXIST) /******NOW VECTOR ADDRESSES******/ ORG 0000H SJMP START ORG 000BH SJMP TIMER0 change these SJMPS to AJMP or LJMP if necessary /*****NOW ISR*****/ ORG 0030H (THIS NO IS JUST A EXAMPLE. CHOOSE ANY NO ABOVE VECTOR TABLE TIMER0: MOV THO,# MOV TLO,# (BODY OF TIMER ISR) RETI /****ALL ISR ARE OVER NOW START WITH BODY****/ START: initialise necessary sfr registers here initialise sfr bits, global variables initialise lcd to initialise LCD acall INIT_LCD acall CLEAR_LCD also get your cursor on row1,col1 position now give a infinite loop here: SJMP here /*****NOW WRITE FUNCTIONS****/ INIT_LCD: (BODY OF FUNCTION) RET similarly write other functions when all functions ends /****WRITE ARRAY OF CONSTANTS****/ MY_ARR DB 'A','B'..... OR ORG #### DB 'A','B'..... END ... |
Topic | Author | Date |
Damaged LCD? | 01/01/70 00:00 | |
Some code comments first. | 01/01/70 00:00 | |
Thanks... | 01/01/70 00:00 | |
Well if you need it later... | 01/01/70 00:00 | |
Hmmpf. | 01/01/70 00:00 | |
Multiple Problems | 01/01/70 00:00 | |
My Bad!!! | 01/01/70 00:00 | |
:) some improvement | 01/01/70 00:00 | |
try to initialise at startup | 01/01/70 00:00 | |
Wahey...... O not quite | 01/01/70 00:00 | |
Hex value | 01/01/70 00:00 | |
Check your soldering. | 01/01/70 00:00 | |
Oops | 01/01/70 00:00 | |
Wahey..... o not AGain | 01/01/70 00:00 | |
Leading 0 | 01/01/70 00:00 | |
Leading zero | 01/01/70 00:00 | |
Some help | 01/01/70 00:00 | |
Cheers guys, all working now | 01/01/70 00:00 | |
Why You Were Content Dependant![]() | 01/01/70 00:00 | |
The filled in blocks indicate.. | 01/01/70 00:00 | |
No hardware but software problem | 01/01/70 00:00 |