UART Interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART Interrupt

1,861件の閲覧回数
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.
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

882件の閲覧回数
Jacke
Contributor I
Anyone have any example on how to implement interrupt driven UART input at all?
0 件の賞賛
返信

882件の閲覧回数
admin
Specialist II

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

0 件の賞賛
返信

882件の閲覧回数
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 件の賞賛
返信