Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
hi. i'm newbie.
i'm using tms570ls1227PGE
AD1EVT/MII_RX_ER/RMII_RX_ER (pin86) is test LED circuit.
I want to toggle the ad1evt pin to turn on the LED.
how to setting halCoGen and main.c?
i already done like this
driver enable -> all
and my main.c code is
#include "sys_common.h"
#include "gio.h"
#include "adc.h"
#include "het.h"
/* USER CODE END */
/* USER CODE BEGIN (2) */
adcData_t adc_data;
/* USER CODE END */
/* USER CODE BEGIN (3) */
/* USER CODE BEGIN (1) */
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
/* USER CODE END */
gioInit();
adcInit();
gioSetBit(gioPORTA, 0, 1);
gioSetBit(gioPORTB, 0, 1);
adcStartConversion(adcREG1, adcGROUP1);
while(1)
{
while(adcIsConversionComplete(adcREG1, adcGROUP0)==0);
adcGetData(adcREG1, adcGROUP0, &adc_data);
gioSetDirection(hetPORT1, 0xFFFFFFFF);
gioSetBit(hetPORT1, 0, 1); //Check with het led to see if it works well
gioSetBit(hetPORT1, 1, 1);
gioSetBit(hetPORT1, 2, 1);
gioSetBit(hetPORT1, 3, 1);
gioSetBit(hetPORT1, 4, 1);
gioSetBit(hetPORT1, 5, 1);
gioSetBit(hetPORT1, 6, 1);
gioSetBit(hetPORT1, 7, 1);
gioSetBit(hetPORT1, 8, 1);
gioSetBit(hetPORT1, 9, 1);
gioSetBit(hetPORT1, 10, 1);
gioSetBit(hetPORT1, 11, 1);
gioSetBit(hetPORT1, 12, 1);
gioSetBit(hetPORT1, 13, 1);
gioSetBit(hetPORT1, 14, 1);
gioSetBit(hetPORT1, 15, 1);
gioSetBit(hetPORT1, 16, 1);
gioSetBit(hetPORT1, 17, 1);
gioSetBit(hetPORT1, 18, 1);
gioSetBit(hetPORT1, 19, 1);
gioSetBit(hetPORT1, 20, 1);
gioSetBit(hetPORT1, 21, 1);
gioSetBit(hetPORT1, 22, 1);
gioSetBit(hetPORT1, 23, 1);
gioSetBit(hetPORT1, 24, 1);
gioSetBit(gioPORTA, 1, adc_data.value<<1);
gioSetBit(gioPORTA, 2, adc_data.value<<2);
gioSetBit(gioPORTA, 1, adc_data.value<<3);
gioSetBit(gioPORTA, 2, adc_data.value<<4);
gioSetBit(gioPORTA, 5, adc_data.value<<5);
gioSetBit(gioPORTA, 6, adc_data.value<<6);
gioSetBit(gioPORTA, 7, adc_data.value<<7);
}
}
I coded it with the gpio setting, but I know I had to change the code to do the LED TOGGLE on the ad1evt pin. Let me know how to change it.