**************************************************************************************************** ADSP-BF537 EZ-KIT Lite CAN Transmit Example Analog Devices, Inc. DSP Division Three Technology Way Norwood, MA 02062 Date Created: 12/10/04 ____________________________________________________________________________________________________ This directory contains an example ADSP-BF537 project that shows how Port Pins, Interrupts, and the CAN interface can be configured in C. It also demonstrates how to access the LEDs on the EZ-KIT Lite. This transmitter example can be used individually or in conjunction with the receiver example. If used stand-alone, another CAN node must be present on the CAN bus with the same timing and with the same messaging characteristics. This example is available for hardware testing of the CAN and is provided to be used as reference code for setting up the CAN to do simple transmit operations. More robust examples will be provided in a future tools update. Files contained in this directory: readme.txt This project description file CAN_TX.dpj VisualDSP++ project file main.c C file containing the main program Initialization.c C file containing all initialization routines Interrupts.c C file containing the interrupt service routines for CAN TX, CAN RX, and PORT F CAN_Functions.c C file containing CAN-specific Functions CAN_TX.h Header file containing prototypes, global data, and macros ____________________________________________________________________________________________________ CONTENTS I. FUNCTIONAL DESCRIPTION II. IMPLEMENTATION DESCRIPTION III.OPERATION DESCRIPTION I. FUNCTIONAL DESCRIPTION This example demonstrates the initialization of the Port pins, Interrupts, and the CAN interface. The TX program initializes the CAN to use Mailbox 24 for transmit and Mailbox 7 for receive. The push-buttons are configured to generate any of 4 commands (0x01, 0x02, 0x03, 0x04) to be sent to the receiving CAN node using a message ID of 0x411. These commands are intended to indicate to the receiver to perform a specific action. Upon receipt of a byte into Mailbox 7, the received byte's value is displayed on the LEDs. If used with the CAN RX example in VisualDSP++: PB1 on issues the blink (0x01) command. PB2 on issues the scroll right (0x02) command. PB3 on issues the scroll left (0x03) command. PB4 on issues the turn LEDs off (0x04) command. If used stand-alone: PB1 on sends 1 byte (0x01). PB2 on sends 1 byte (0x02). PB3 on sends 1 byte (0x03). PB4 on sends 1 byte (0x04). II. IMPLEMENTATION DESCRIPTION The main file calls the following sub-routines: 1. Init_PLL() 2. Init_Port() 3. Init_Interrupts() 4. Init_CAN_Timing() 5. Init_CAN_Mailboxes() 6. CAN_Setup_Interrupts() 7. CAN_Enable() It then executes an endless loop awaiting PORT and CAN Interrupts. III. OPERATION DESCRIPTION - Make sure that switch SW2.4 is turned on (Attaches PJ4 to CAN_RX Pin) - Make sure that switch SW5.1-4 are turned on (Attaches PFx pins to Push-Buttons) - Open project "CAN_TX.dpj" in VisualDSP++ Integrated Development Environment (IDDE). - Under the "Project" tab, select "Build Project" (program is then loaded automatically into DSP). - Select "Run" from the "Debug" tab on the menu bar of VisualDSP++. - Pressing PB1-4 on TX board will result in CAN messages being generated. - If two EZ-KITs are used, CAN TX will display the command sent via push-button interrupt on the LEDs when the response comes back from the CAN RX board.