Welcome, Guest

TOPIC: INTERRUPTIONS CLASS 5

INTERRUPTIONS CLASS 5 5 years 11 months ago #771

  • argelia
  • argelia's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 1
Is there any flag that turn on when the motor get an ascii character by rs232 in data mode?
i'd like to make an interruption everytime i send a ascii character, I wouldn't like to be asking for "Len" all the time
The administrator has disabled public write access.

Re: INTERRUPTIONS CLASS 5 5 years 11 months ago #772

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Moderator
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
There aren't any status bits to indicate LEN has changed... meaning something is in the buffer.
The best work around I can suggest is to use one of the Class5 Timers(these are countdown timers). The Timer can be set in millisecond increments. Set up an interrupt based on the timer's status bit timing out ... which can cause a subroutine to be called... which checks LEN to see if characters have come in. If LEN shows nothing in the buffer... reset the Timer preset.. and RETURNI. If there is something in the buffer... do what you need to do... then reset the Timer preset.. and RETURNI.

Note: You can use Timers to do other tasks... such as updating I/O... on the same interrupt.
Last Edit: 5 years 11 months ago by csearcy.
The administrator has disabled public write access.
Time to create page: 0.253 seconds
Powered by Kunena Forum