Initial tests utilize halcogen’s NHET1 PWM signal generation code, which should generate a PWM signal with duty cycle of 75% and a period of 1000us.
Not sure why the signal is weird and not a square wave, but the duty cycle generated matches the expected generated PWM signal which is 750us of the wave being high and 250us of being low.
Some issues that I’m running into are actually changing the speed at run time, I expect that for future use, the duty cycle will be constantly be changing depending on the calculations from the algorithm.
There are also some setbacks on how to send a PWM signal only for a certain amount of time, currently that is a difficulty. I’ve tried using the <time.h> standard library with time_t struct to compare the initial start time and current runtime of the program to act as a timer, but to little success. I think a more elegant and suitable solution would be to utilize the RTI (Real time interrupt) module with events as a way to indicate how long we would like to send a PWM signal down to the NHET[0] pin for during runtime.