UART Interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART Interrupt

1,865 Views
Jacke
Contributor I
Hi, I have a MPC8360EA microcontroller board with CodeWarrior and I want to implement interrupt driven communication over UART. The board is supposed to do some work until a PC that it's connected to via UART says it wants some data, the board should then stop what it's doing immediately, send out the data to the PC, and then continue working where it left off. Anyone have a simple example how to do this with the functions already implemented by Freescale like InitializeIntDrivenUART, WriteUARTN and so on? Thanks in advance.
Labels (1)
0 Kudos
Reply
3 Replies

886 Views
Jacke
Contributor I
Anyone have any example on how to implement interrupt driven UART input at all?
0 Kudos
Reply

886 Views
admin
Specialist II

Why Freescale doesn't have an implementation of an interrupt driven UART?

0 Kudos
Reply

886 Views
Schwac
Contributor II

I would use the Async UART bean of Processor Expert. I highly reccomend processor expert as you can develop things orders of magnitude faster than looking through the chips header files for various flags and masks.

 

There are "on recieved" interrupts that you can enable that will direct execution to these interrupt routines when a char is accepted in the RX buffer. Then all you have to do is check until some signal is sent by the PC that you can use as an end of transmission character, or wait until you receieve a set quantity of bytes, or just wait a set amount of time. Then send the data needed back to the PC. If you need a relatively simple protocol to help organize your data take a look at Modbus RTU. It's very easy to implement, and will save you time if you have to reorganize data/send more data in the future.

 

Regards,

 

Cory

0 Kudos
Reply