Hello,
Since I am a beginner I am looking for options to do the timing easily.
I also have a requirement of linking the relay to ON/ OFF button
1. time delay function in while loop,
But I dont know what other variables and module would I have to initialize? Would it calculate internally and just put the trigger after every assigned delay time?
while (1) {
_io_ioctl(file1, GPIO_IOCTL_WRITE_LOG1, NULL);
_time_delay(9000);
_io_ioctl(file1, GPIO_IOCTL_WRITE_LOG0 NULL);
_time_delay(1000);
}
2. Use PWM to control the transistor.
I will have to learn how to set TPM for PWM.
https://community.freescale.com/message/319470#319470
https://community.freescale.com/message/63827#63827
Looks like I will also have to learn how to divide clocks, so use EXTAL (which is 8MHz) then learn how to code/ set TPM overflow
and then learn how to link it to GPIO output.
3.
Designer can use a PIT timer to generate a periodic 9 seconds interrupt.
And in the PIT interrupt service routine, customer can set relay control pin output status.
Do you have any examples that I could read that will help me understand how GPIO timings can be adjusted
Thanks