Framing error if I disable transmitter after shift register is empty?


Results 1 to 40 of 46

Threaded View

  1. #10

    Default Re: Framing error if I disable transmitter after shift register is empty?

    checking your stuff........ if you use interrupts (DT ints), for RX interrupts, you would not use PB hserin in the int routine. Rather get the characters in your routine and store them in the locations you designated and advance counter and check for some beginning or ending character....... with this I receive up to 1000 characters and store them in ram on 18f with 4k ram..... you would fix for your code. If successful receive, raised a flag telling basic to process the data for whatever your looking for

    Code:
    '''-------------RCV INT ROUTINE----------------''''
    RCint:
    RCX=RCREG
    '@ bcf RCSTA,4 
    '@ bsf RCSTA,4   
    '''@ CLRF CREN     ;RESET RCV overrun
    '''@ SETF CREN
    
      
    
    IF RCX=8 THEN     '''CHECK FOR BACK SPACE BS 8dec
    SELECT CASE RCVindx
        CASE 0
            GOTO LEAVEOK1
        CASE 1
           RCVindx=RCVindx-1 :RCVOK=0
            RCVdata[RCVindx]=0    
           GOTO LEAVEOK1
        CASE IS >1
           RCVindx=RCVindx-1
           RCVdata[RCVindx]=0
           GOTO LEAVEOK1
    END SELECT
    ENDIF
    
    if RCX = "[" then 
    RCVindx=0:RCVok=1:DATAready=0   
    goto leaveok 
    endif  
    if RCVok=0 then   LEAVEOK1    
    if RCX = "]" then
    rcvok=0:dataready=1 
    endif 
        
    leaveok:           'LEAVE AND STORE RCVD CHAR
    RCVdata[RCVindx]=RCX
    RCVindx=RCVindx+1
    RCVdata[RCVindx]=0  'TACK A 0 AT END OF ARRAY
    IF RCVindx > 999 THEN  
    RCVindx=999
    ENDIF
           
    LEAVEOK1:          'LEAVE WITHOUT STORING RCVD CHAR
    RCFLAG=1
    Last edited by amgen; - 23rd September 2024 at 21:48.

Similar Threads

  1. Trying to emulate shift register
    By RuudNL in forum General
    Replies: 0
    Last Post: - 17th March 2013, 19:57
  2. pic+shift register+lcd
    By eworld in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd October 2012, 05:11
  3. Long shift register
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th April 2009, 19:14
  4. Framing Error /w USART
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th February 2007, 01:34
  5. Replies: 15
    Last Post: - 30th January 2005, 03:58

Members who have read this thread : 10

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts