32
CY8CKIT-017 CAN/LIN Expansion Board Kit Guide, Doc. # 001-57814 Rev. *D
Code Examples
Figure 5-1. Firmware Flowchart
10 ms Elapsed?
No
Yes
10
th
Loop?
Copy ADC output to
CAN TX register
Transmit Message
Update transmitted
value on LCD
TxError == 0 &&
RxError == 0
Turn Off Amber
and Red
TxError > 127 or
RxError > 127
Turn On Red,
Turn Off Amber
Turn On Amber, Turn
Off Red
RxFlag == 1?
Copy Received Data to
Variable
Update received value
on LCD
No
Yes
Yes
No
Delay (~5 seconds)
Display “Communciation
Starting…” on LCD
Enable global interrupts and
Start LOOPCLK, LOOPISR
Delay (~1 second)
Display Introduction
message on LCD
Start
Start CAN, LCD, ADC
Turn On Green LED
No
Yes
Turn Off Green LED
No
Yes
Display “Communciation
Starting Now” on LCD
Delay (~0.5 second)