Part Number: TMS320F28379D
Tool/software:
Hello everyone,
I have a f28379d control card, I'm compiling it with CCS, I started with an example from empty_driverlib_project, I put together a code basically to send CAN messages, but the board behaves abnormally, I've tried to configure it in other ways but without success, the code below is in my empty_driverlib_main:
#include "device.h"
#include "driverlib.h"
#include "board.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define TX_MSG_OBJ_ID 1
#define MSG_DATA_LENGTH 8
uint16_t txMsgData[8] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08};
uint16_t counter = 0;
void main(void) { Device_init();
Device_initGPIO();
Board_init();
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
// // Enable Global Interrupt (INTM) and real time interrupt (DBGM) // EINT;
//ERTM;
while(1) { counter++;
txMsgData[0] = counter;
CAN_sendMessage(myCAN0_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, txMsgData);
while(((HWREGH(myCAN0_BASE + CAN_O_ES) & CAN_ES_TXOK)) == CAN_ES_TXOK) { } GPIO_togglePin(DEVICE_GPIO_PIN_LED1);
GPIO_togglePin(DEVICE_GPIO_PIN_LED2);
DEVICE_DELAY_US(500000);
} } // // End of File //
I set the board's LEDs to change state, and they work, but the CAN data writing function sends data frantically.
Could someone help me?
