I'm working on a little project, and am looking for someone to recommend a microcontroller to fit my needs. Without getting into unnecessary details, the goal is basically a counter displayed across a few LEDs. So I'm looking for a microcontroller that can run a few lines of code (nothing too complex ... 2-3kb of C code [before compiling] dealing with integers and if statements) once per clock cycle (a bit over a second in between cycles). I figure that the fewer pins a microcontroller has, the cheaper it'll be, so my current plan is to keep the software simple and then do a lot of conversions (like BCD to 7-segment) with other ICs.

With this design, I need
- A digital pin to read the ~1Hz clock (maybe trigger an interrupt?)
- 4 digital pins to feed a demultiplexer chip
- An internal clock for some rough timing (I have to pause long enough for the demultiplexer to set up before I switch the outputs).
- Something fairly cheap. There's a chance this might enter production eventually, in which case I certainly don't want a $30 BASIC stamp in there.
- I prefer a DIP Package if possible

Alternatively, I'd need 35 (maybe a few more) pins out and a pin for the clock to do everything on the microcontroller.

I found some chips from the Atmel Corporation (ex: http://www.atmel.com/dyn/products/pr...p?part_id=3012 ) but I'm not exactly sure if those chips do what I'm describing, or if it's something completely different.