This application is a 5 digit up/down counter with a programmable pre-set.
Based on the C790/C7224 specification from Lascar Electronics.  The counter
uses RS232 to set the pre-set, decimal points and count direction.
Alternatively it can use defaults which are start at 00000, no decimal points
and counting up.  The maximum count is 99999.  When counting down an output
is provided at RE0 when the counter equals zero, the display also stops.

The input is on RB6.  the input should be pulled down, and triggers a count
on the rising edge.  A software debounce delay can be selected via RD1, a
High = On & Low = Off.

RD2 controls entry to the calibration mode settings are via RS232 (9600,8,N,1)
which allows the following to be entered from the keyboard pre-set counter
register, Decimal Points & count direction.  A High enters this mode at power
up, data is stored in internal EEPROM, a Low will jump over this mode so that
the stored data can be used without the need to re-program.


RD3 determines which data to use, a High = uses the programmed data from EEPROM
while a Low = uses the defaults which are a 00000 count, No decimal points & Up
direction counting.  If using the programmed data and counting down when the count
reaches 00000 it stops and RE0 goes high.

RD4 is a Reset.  A High will reset the register if the counter has reached 00000,
as mentioned above, once reset the counter will count down again.  Low = no action

The checksum of the code is 4ABE.

Jal is provided free of charge and is regularly updated.  If you wish to
support the continued development of the code a donation, in dollars, can
be made to Wouter via http://www.piclist.com/support.

