Interfacing the Intersil 7217 4 digit counter

Hi everyone;

Because I have in my junkbox about 20 intersil 7217 chips; I am bent on using them up. Yes the 595 shift register and 7 segment displays are inexpensive and the code is written . . . . I know, I know.

The intersil 7217 is a 4 digit up down counter with loadable registers, compare, carry and borrow functions. In it's day it was useful for many stand alone counter display projects. They can be cascaded too.

They were designed to load 4 digits of bcd data using thumbwheel switches. By pulsing the "load register pin" the chip would load 4 binary inputs into the 1000's digit, then after one multiplex scan delay, it would load the 100's digit, then 400 ms later the 10's digit, and finally 400 ms later the 1's digit.

This was pretty slick, because using connections to the display driver output pins and diodes, you could load a 4 digit number bcd number into the controller using 4 pins and mechanical switches.

However, not so friendly to load with my pro-mini 5V 16 MHz controller.

I am trying to write code to take a integer value "rpm" between 0 and 9999 and load it into this register of the counter/display chip.

I found this code that works for numbers 0 through 9 for a single digit.

{ digitalWrite(9, HIGH && (rpm & B00000001)); digitalWrite(10, HIGH && (rpm & B00000010)); digitalWrite(11, HIGH && (rpm & B00000100)); digitalWrite(12, HIGH && (rpm & B00001000)); }

I think what I need to do is mask the "rpm" value to separate each digit out and do this four times.

I played with masking and had all sorts of issues stripping a BCD value for each decade. It liked to get hex values, and I was unsuccessful.

Can some helpful soul show me the way?

In English, here is what I need to do:

{ separate the 1000's value from "rpm" convert to 4 digit binary put on pins 9,10,11 and 12 pulse load register pin wait 20 ms

separate the 100's value from "rpm" convert to 4 digit binary put on pins 9,10,11,12 wait 400 ms

separate the 10's value from "rpm" convert to 4 digit binary put on pins 9 10 11 12 wait 400 ms

separate the 1's value from "rpm" convert to 4 digit binary put on pins 9 10 11 12 wait 400 ms

pulse store pin }

If anyone is interested, I am working to interface the pro-mini to a Ford EDIS electronic ignition module which picks up a crank triggered reluctance pulse train and directs it to coil packs. the EDIS 8 module puts out 4 pulses every crank revolution. Using an interrupt on the pro-mini, I will calculate the rpm based on interrupt timing, convert that to rpm and display that to the 4 digit counter, and then based on engine rpm and manifold vacuum, output a spark advance word to the ignition module.

When I get that working, a pushbutton will scroll the display between rpm, m.a.p., and ignition advance.

The net result should be a fully programmable crank triggered ignition system for about $20 and a trip to the auto wrecker. (not including the $25,000 development cost :o )

Oh, yeah, istead of using delay functions, as this project is timing critical for the EDIS timing interface, any additional help using the millis command for timing is also appreciated.

engineer_duane: any additional help using the millis command for timing is also appreciated.

Did you study the "Blink without Delay" sketch ? That's a good start to answer this question. Study means check the sketch, upload it and alter it to see it does what you expect it to do (and why or why not). You can do so while waiting for an answer to the 7217 question.