Better way to measure pulse? | Cypress Semiconductor
Better way to measure pulse?
I am working on a project that needs to decode 4 pulse width inputs and modify them to output a different pulse if a high temperature situation occurs (to fade down the output of the original device). My project is attached below. It is based on a project that Dana Knight proposed for a PSOC 5.
I am using the Edge detectors because I cannot have multiple pins in the same bank that have an ISR output, only one per bank.
I am a bit frustrated, as it seems that a few other microcontroller platforms that I have used have had a simple pulse measurement function and pulse output function built in, and all that was required was a pulsein() and pulseout() command. Trying to modify the software to measure one pulse has already resulted in something very bloated, and that is not working correctly. I end up with duty cycles of well over 100%.
One other frustration that I have had is that when I change a system variable, like the frequency of the edge detector clock in this case, my custom code in all of the ISRs is completely deleted, and they are rebuilt as they were originally. Does anyone know why this happens, and what I can do about it?
Thank you all so much, I am obviously not a programming guru, but this forum is helping me to learn a lot.