Description
This software functions as a long period astable mutivibrator. The mark and space period can be set from 1 second up to a maximum 65535 seconds (18h12m15s). Using the internal 4Mhz RC oscillator delays with an accuracy of 99% or better can be achievedThe code also implements an edge triggered reset and an active low hold function. The reset edge can be configured for rising or falling edge. The hold function is active low and stretches the timed period for as long as the hold input is held low.In addition to this up to 450 mark/space time pairs can be used which are executed sequentially allowing complex pulse trains to be generated.By connecting the hold input to the Q output, the code can also be made to function as an edge-triggered monostable timer, using the reset input as the trigger.The code will run on a PIC 12F629 or 12F675.
Pin functions
At power on and after an edge triggered reset the outputs enter a mark state with the Q output going high and the notQ output going low. The first time entry is then read and the code waits for the number of seconds specified. When this period has elapsed a Space state is entered with the Q output going low, notQ output high and the next time entry is read.When the Hold input is taken low the output remains unchanged and the timer is stopped, effectively stretching the current time period. When the Hold input returns high, the timer continues.If the Reset input is triggered while Hold is low, the outputs are reset to Q == high, notQ == low and the timer is loaded with the first entry from the LongDelayTimes.inc file. It them remains in the Hold state until the Hold input returns high.
Circuit diagram
Download circuit diagram in pdf
Download source files
Download hex file