EasyManua.ls Logo

Freescale Semiconductor MPC5604B - Flexcan Usage Explained with an Example

Default Icon
150 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Overflow, BUF6I is FIFO Warning (FIFO almost full with 5 over 6 buffers being occupied). BUF5I:
Frames available in FIFO (frames ready to be read).
8.
FlexCAN usage explained with an example
In this section, through an example program, we will explain how to initialise and configure
FlexCAN correctly. This program will be used to test basic functionalities of this module by
communicating with a CAN Analyser; it starts with configuring the transceiver (see section 4)
and configuring the module and its buffers. It also configures a timer to raise an interrupt every
200ms. Then the main loop implements a state machine with two states:
State 0: Timer interrupt enabled, if Button 1 is pressed disable timer interrupt and go to
the state 1.
State 1: If the receive buffer flag is raised, receive message and print 4 LSB to the LEDs. If
butter 0 is pressed, enable timer interrupts, reset the counter and go to the state 0.
The timer interrupt, transmits the value of the counter and increments the counter.
Here’s the global variables and the main code:

Table of Contents

Other manuals for Freescale Semiconductor MPC5604B

Related product manuals