AGCB
Member
I've been fighting for several days with this. The intension is to use a F1220 to display messages and decimal vaues on an LCD. The information comes from a second PIC which is actually doing the experimenting and is sent via USART.
I started w/ Nigel's tutorial 3.3 modified for the 18F. That worked fine except for the 'convert' subroutine but thats OK since I only have 1 byte numbers to display and my 'digbyte' macro works great.
Upon adding subroutines and interrupts to the program, it stoped working, displaying either blank on the LCD or splitting up the Hello message into parts and in different places on the LCD.
Last night I took the program all apart by commenting out all but the PIC header and initialization, then started part by part putting things back in until it failed again. The code snippet below (just the main loop) works fine untill you put any single one of the commented out lines in. Then it goes back to either a blank display or a split up Hello message and no more.
I thought the problem could be a read/write/modify problem because even if you put the 'bcf
portb,1 instruction in it makes it fail. But other delays or even the same delay twice in a row makes it fail too.
Whatever is causing this is probably the same that caused the larger program to fail also.
The calls and delays all work on there own. Only the tone sub has not been tested.
Provided none of the semicolons are removed, the LCD displays 'Hello' then after a second displays 'AD Result' on the top line then the 'rcv_temp' decimal on the bottom line.
Your good advice will be appreciated!
I started w/ Nigel's tutorial 3.3 modified for the 18F. That worked fine except for the 'convert' subroutine but thats OK since I only have 1 byte numbers to display and my 'digbyte' macro works great.
Upon adding subroutines and interrupts to the program, it stoped working, displaying either blank on the LCD or splitting up the Hello message into parts and in different places on the LCD.
Last night I took the program all apart by commenting out all but the PIC header and initialization, then started part by part putting things back in until it failed again. The code snippet below (just the main loop) works fine untill you put any single one of the commented out lines in. Then it goes back to either a blank display or a split up Hello message and no more.
I thought the problem could be a read/write/modify problem because even if you put the 'bcf
portb,1 instruction in it makes it fail. But other delays or even the same delay twice in a row makes it fail too.
Whatever is causing this is probably the same that caused the larger program to fail also.
The calls and delays all work on there own. Only the tone sub has not been tested.
Code:
;================ Main loop=============================
movlw .200
movwf rcv_temp
rcall Hel_dis ;display Hello
rcall del_2S
bsf portb,5
movlw .40
movwf beepcount
bsf portb,1
; bcf latb,1
; call del_2s
; call ms5
bcf portb,1
call ms5
; decfsz beepcount
; bra snd
; call tone
call ad_dis
; call tone
call del_2s
call dspl_dec
; call tone
cir bra cir
Provided none of the semicolons are removed, the LCD displays 'Hello' then after a second displays 'AD Result' on the top line then the 'rcv_temp' decimal on the bottom line.
Your good advice will be appreciated!