Other Parts Discussed in Thread: HALCOGEN
Hello,
I am trying to figure out how to assign the pwm output a specific port. From the code I currently have, it will only output to a single default port J8-3 (N2HET1_8/MIBSPI1SMO_1/MII_TXD_3/4.2C). For clarity, I've trimmed the code down to the few lines of code that are currently working.
Thanks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% CODE BELOW %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/* USER CODE BEGIN (0) */
#include "HL_het.h"
#include "HL_gio.h"
/* USER CODE END */
/* Include Files */
#include "HL_sys_common.h"
/* USER CODE BEGIN (1) */
uint16_t pwmDUTY; // Create a 16 bit integer variables to modify the Duty cycle
hetSIGNAL_t pwmSignal; // hetSIGNAL_t is a struct which defined in het.h
/* 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) */
gioSetDirection(hetPORT1, 0xFFFFFFFF);
hetInit(); // Initialize HET driver
pwmSignal.duty = 50;
pwmSignal.period = 2; // us period
while(1){ // Start an infinite loop
pwmSetSignal(hetRAM1,pwm0,pwmSignal);
}
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
/* USER CODE END */