8 outputs and a PWM from an 18-M?

MartinM57

Moderator
I'm looking to get 8 digital outputs (7 seg LED and a decimal point) plus a PWM signal (high side pnp transistor for dimming) in the most economical (cost) way.

28-series satisfies the requirement too easily, but 18-M is lot, lot cheaper.

14-M also works, but 18-M is cheaper.

Can I use Serial Out as a digital output on an 18-M (like you can on a 14-M) - and if so how?

Any other ideas?

TIA
Martin
 

MartinM57

Moderator
Thanks E ;)

The proposed code in one of those posts is:

Code:
POKE $05, %00000000 'To set Sertxd low
POKE $05, %00001000 'To set Sertxd high
But that's a bit of a sledgehammer as it writes all over PORTA:
- PORTA0 - Input0/ADC0
- PORTA1 - Input1/ADC1
- PORTA2 - Input2/ADC2
- PORTA3 - Serial out
- PORTA4 - Serial in
- PORTA5 - Reset

And I want to also use Inputs 0-3 as well (I didn't say that originally!)

So can I SAFELY (i.e at ALL times) just PEEK $05 and POKE $05 what I read with bit 3 adjusted as required?
 

westaust55

Moderator
Another option is to use an 8-bit 74HC595 shift register with 3 outputs to operate the 7-Seg + dp display.

Cost aside, even the 14M would suffice with some spare Inputs and Outputs then
 

nbw

Senior Member
Possibly a 4511 or (even better) 4026 to drive the display and leave a few I/Os? These are pretty cheap ICs. I don't know what they go for over there but you can usually get 4026s here for around $1.50 (around 50p)
 

MartinM57

Moderator
Think I'm sorted now - 14M is the cost-effective solution now that I've found that the Rapid quantity volume price (250+) is more than the techsupplies one-off price - which is a bit weird :( Might have to have a word with the Rapid pricing man...

Only 2 inputs available with a PWM and 8 outputs but I can live with that.

Ta
Martin
 

Andrew Cowan

Senior Member
Alternativly, as westaust pointed out, shift registers can be used.

The 74HC595 has a latch, while the 74HC164 doesn't.

Programming editor can turn numbers into binary, and then output this straight to a shift register.

If 4511 BCD encoders are used, the BINtoBCD command can be used to encode this.

A
 

westaust55

Moderator
drive a 7 seg display with fewer IO

Possibly a 4511 or (even better) 4026 to drive the display and leave a few I/Os? These are pretty cheap ICs. I don't know what they go for over there but you can usually get 4026s here for around $1.50 (around 50p)
Yes, both are great as 7 seg display drivers
4511 uses 4 data lines in binary format + 1 control line
4026 uses 1 clock line to count and a reset line then most other lines can be hard wired.
Both also need an extra PICAXE output for the dp.
 
Top