Menu

16F15345 not responding to serial input

2021-04-25
2021-04-25
  • Roger Jönsson

    Roger Jönsson - 2021-04-25

    Can't get 16F15345 to react to serial input.
    I modified a test program that earlier worked on 16F15376 (different pins and through RX1)
    Am I doing something wrong?

    #chip 16F15345,16
    #define USART2_BAUD_RATE 115200
    '#define USART2_BLOCKING
    Dir PORTA Out
    Dir PORTB.5 In
    comport = 2   'added this with no effect, is it needed?
    
    Do
    data = HSerReceive2 'only RX2 available on this chip. Data sheet says on RB5
    
    if data = 64 then
    PORTA.5 = OFF
    end if
    
    if data = 65 then
    PORTA.5 = ON
    end if
    
    Loop
    
     
  • Anobium

    Anobium - 2021-04-25

    Check out the demos,but, you are missing the PPS section. Use PPSTOOL.

     
  • Roger Jönsson

    Roger Jönsson - 2021-04-25

    Yes. I just discovered that and swiftly came back to save you time responding. It now works. I was fiddling for two hours, but then remembered that the manual of microchip has been misleading before. Sorry that I didn't think of that before making my post and thank you for the extremely fast response.

     

    Last edit: Roger Jönsson 2021-04-25

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.