Menu

Need help on Serial recieve and store

Help
2011-02-25
2013-05-30
  • Nobody/Anonymous

    I have:
    #chip 16F688, 12 'mhz
    #config MCLRE=off, WDT=off
    #define USART_BAUD_RATE 9600  
    '#define USART_BLOCKING
    CREN = 1
    SYNC = 0
    SPEN = 1
    RCIE = 1
    InitUsart
    On Interrupt RCIF call serial_in
    lcdcon = 0 
    dim loc as byte
    loc= 1
    'Set the pin directions
    'dir porta.0 in  '
    'dir porta.1 out '
    'dir porta.2 out '
    'dir porta.3 in '
    'dir porta.5 out '
    'dir porta.4 out '
    dir portc.5 in ' serial 5
    'dir portc.4 in '
    'dir portc.3 out '
    'dir portc.2 in  '
    'dir portc.0 out '
    dir portc.1 out 'up led

    'Main routine

    Start:
    wait 50 ms
    set portc.1 off

    goto start

    sub serial_in
    INDATA = rcreg
    epwrite loc, indata
    loc= loc + 1
    if loc = 8 then loc = 1
    set portc.1 on
    End sub

    but when i read the rom there is no data there, i want to store 8 bits for later reading

     
  • Nobody/Anonymous

    i think if you take "´" synblol on #define USART_BLOCKING, the RCIF start working

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.