> Hello,
>
> I am once again in the experimenting stage and have run into a wall........
>
> I'm trying to communicate from one PIC16C63 to another PIC16C63 using the
> on-board USART with the rx used in interrupt mode.
> I'm running a loop where the contents of RAM is displayed on an LCD and the
> RX interrupt updates the ram. I am sending 12 characters every two seconds
> and from what I can see, it looks like only the 1st, 3rd, 5th, 7th, 9th,
> 11th, and 12th characters are received.
>
> I am using a 20MHz oscillator and running at 9600 baud (well actually 9469
> baud with BRGH=0).
>
> My ISR is something like:
>
>
> ;----------------------------------------
> ;RAM defines
>
> cblock
> rxbuffer:12 ;12 spaces reserved for rx buffer
> counter:1 ;counter for RX_ISR
> endc
>
>
> ;---------------------------------------
> org 0x0000
> goto start
>
> org 0x0004
> goto ISR
>
> ;--------------------------------------
> ;main program
>
> start
> ... ;initialization
> loop .... ;display contents of rxbuffer on LCD
> goto loop
>
> ;end of main program
>
>
> ;--------------------------------------
> ISR
> .... ;disable further interrupts and save
> registers (w, status, fsr, pclath)
> call RX_ISR
> ... ;restore registers (pclath, fsr, status, w)
> retfie ;enable interrupts
>
>
> ;-------------------------------------
> RX_ISR
> movlw rxbuffer ;set up pointer
> movf fsr
> movlw 0x0c ;12 characters
> subwf counter,w
> btfss status,z ;check for zero
> goto $+2 ;if not zero, skip next line
> clrf counter ;reset counter
> movf counter,w ;get count
> addwf fsr ;point to location
> movf rcreg,w ;get character from rx fifo
> movwf indf ;store in rx buffer
> incf counter ;advance to next RAM location
> return
>
> Any comments are welcome. Am I missing something? Should I be handling the
> interrupt different.
> Oh, I did by the way do the initialization for interrupts on receive (async)
> and clear ram contents in the beginning.
>
> Thanks in advance!
>
> Randie
>
@spam@randie.ohtsjiKILLspam
glenayre.com
>
>