SERIN2, SEROUT2,& HSEROUT works great, HSERIN not working


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: SERIN2, SEROUT2,& HSEROUT works great, HSERIN not working

    When using HSERIN/HSEROUT, you MUST use DEFINE. Then later, If you want to alter the baudrate of whatever else feature of the USART on the fly, then you use SPBRG, TXSTA, RCSTA.

    If I remember correctly, If you don't specify any DEFINE, PBP assume 2400 bauds.

    Another thing, always begin without timeout label for testing purpose, then add it. However, an ISR is more efficient.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: SERIN2, SEROUT2,& HSEROUT works great, HSERIN not working

    Quote Originally Posted by mister_e View Post
    When using HSERIN/HSEROUT, you MUST use DEFINE.
    Then why does this work?
    Code:
    '******************************************
    '18F6680   02/14/09  INFEED PARSE TEST BAUD 9600
        DEFINE OSC 20
        @ __CONFIG    _CONFIG1H, _OSC_HS_1H
        @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
        @ __CONFIG    _CONFIG4L, _LVP_OFF_4L
        DEFINE LCD_DREG     PORTG 
        DEFINE LCD_DBIT     0
        DEFINE LCD_RSREG    PORTE 
        DEFINE LCD_RSBIT    0
        DEFINE LCD_EREG     PORTE 
        DEFINE LCD_EBIT     1
        DEFINE LCD_BITS     4 
        DEFINE LCD_LINES    4
        DEFINE LCD_COMMANDUS    3000 
        DEFINE LCD_DATAUS   150
        DEFINE HSER_EVEN
      '###############################################
        PAUSE 100 : LCDOUT $FE,1,"TEST"
        N1 VAR LONG:N2 VAR LONG
        START: N1 = 0 : N2 = 0
        HIGH PORTG.4 :PAUSE 250:LOW PORTG.4
        RCSTA.4 = 0 : RCSTA.4 = 1
        'CHANGE LINE FEED AND CARRIAGE RETURN AS REQUIRED 
        RCSTA=$90:TXSTA=$24:SPBRG=129:HSERIN[WAIT($a),WAIT($d),DEC N1,WAIT(","),DEC N2] 
        LCDOUT $FE,1,DEC N1 : lcdout $FE,$C0,DEC N2 : GOTO START
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: SERIN2, SEROUT2,& HSEROUT works great, HSERIN not working



    Oh humanity, I'm outdated now... Things changed then . At least you've cleared the CREN bit... but you want to monitor it later, unless it may stuck somewhere.

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: SERIN2, SEROUT2,& HSEROUT works great, HSERIN not working

    I am printing that picture and putting it on the wall... in a frame even
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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