Menu

need to make serial interupt

Help
2009-08-25
2013-05-30
  • Nobody/Anonymous

    using the folo\lowing chip etc:
    #chip 16F916, 4 'mhz
    #config OSC=INTOSC, MCLRE=off, WDT=off
    #mem 256 'Chip has 256 bytes
    dir portc.0 in 'serial
    #define RecAHigh portc.0 off
    #define RecAlow portc.0 on
    Initser 1,r2400, 1+waitforstart, 8, 1, none, invert

    i need to have my program running including wait times, but have the serReceive set so that if i send it a command from the pc that it gets it right away and then goes back to where it was when it got interrupted, is this possible? and how do I set that up

     
    • Nobody/Anonymous

      i think you should use harware usart and enable receive interrupt this way:

      On Interrupt UsartRX1Ready call your_sub

      Sub your_sub
      do_somewthing
      End Sub

       
    • Nobody/Anonymous

      So i just add this to where in my program?
      and is that wording right?

      On Interrupt UsartRX1Ready call serial-in

      Sub serial-in
      SerReceive 1, temp
      SerReceive 1, temp2
      EPWrite temp, temp2
      End Sub

      do i need to defiene rx1? or anything else?

       

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.