Hi,
I am strugling with a problem on a PIC. I have an app written in ASM that is used as a timer module. It has a build in klok, and a user config. timer.
The problem I face is that I cannot get the ASM routine to check if the current time is between the on/off time of the timer (so it will turn on a output).
I made one solution with a litteral register (in which the values of the time and timer are stored) comparison, and that works fine, until you change the timer setting. In that case it will only get active the next time (so this could be a day) the litteral comparisson succeeds.
What acctually is going wrong is that fact that a timer setting can be set over midnight. Ie.
T-On = 17:00
T-Off = 23:00
this works without any problem..but this is what I stuck on:
T-On = 17:00
T-Off = 02:00
(remember when comparing the time, you are only using 00-23 ..)
I would prefer a hint in ASM, but a flowchart might work as well..
Thanks
I am strugling with a problem on a PIC. I have an app written in ASM that is used as a timer module. It has a build in klok, and a user config. timer.
The problem I face is that I cannot get the ASM routine to check if the current time is between the on/off time of the timer (so it will turn on a output).
I made one solution with a litteral register (in which the values of the time and timer are stored) comparison, and that works fine, until you change the timer setting. In that case it will only get active the next time (so this could be a day) the litteral comparisson succeeds.
What acctually is going wrong is that fact that a timer setting can be set over midnight. Ie.
T-On = 17:00
T-Off = 23:00
this works without any problem..but this is what I stuck on:
T-On = 17:00
T-Off = 02:00
(remember when comparing the time, you are only using 00-23 ..)
I would prefer a hint in ASM, but a flowchart might work as well..
Thanks