I am having trouble with a Counter, my program has an EEPROM memory from which it reads the values and updates the counter,
I cant get the values to update.
the counter triggers an interrupt with a compare value
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Are you aware that revcount and period are 16 bit ints while your counter is only 8 bits wide.
in function update() is no reasonable code, commented due to despair ? 😉
I cannot find a place where you read data from eepromArray
You are still writing the number 300 +50 into an 8-bit wide component. Max is 255.
Do not wait with CyDelay() within an interrupt handler, the system might stall.
I cannot see what is not running, all values are as I expect them.
please change the udb to 16bit, I am trying to update the counter period and compare values through firmware, when i run it the values are the ones set up in the hardware block
At least put into your Init() function a Counter_Init(), so that the first Counter_Start() does not overwrite your settings.
I do not make changes in your program, there will be differences between our code too quickly.