Need one more Output

Hello,

I am tapping into group wisdom to solve a problem. I am using an old 18A chip to make a timer. The output pins are all being used to send two BCD digits to the display.
I need to somehow supply a signal when the count reaches zero to set off my MP3 player/speaker.

One non-elegent idea was to send a BCD number to the display that will present all one's to the display. The display is a HEX display so it will display FF, which is easy to see is nonsense. However I can use a quad input NAND gate to decode that unique input into a signal that will trigger the speaker. It's kind of brute force, adds another chip and I will also have that brief display of the hack (FF = Fail/Fail?).

Is there another idea I am missing? The only other output I can see is the serout but this is part of the programming circuit. I also see that the 18M2 has more output pins.
So one of those might be the best bet.

Cheers.
 

inglewoodpete

Senior Member
I am tapping into group wisdom to solve a problem. I am using an old 18A chip to make a timer. The output pins are all being used to send two BCD digits to the display.
I need to somehow supply a signal when the count reaches zero to set off my MP3 player/speaker.
Unless you are desperately short of cash, my suggestion is to invest in an 18M2 or two. They are a vastly superior chip with much more capability. Who knows what you might want to do with the new capability!

Getting back to the 18A, you have 9 outputs. The use of SerOut is obviously conditional but, instead of using pause statements in your code you could send $FF characters whenever possible with a SerTxd command, once the time has expired (or whatever event you want to flag). This pulsing would raise the average potential of that pin, allowing the use of an RC integrator and a transistor (ie 3 components totaling 7 legs) to provide a logical level change of 0 to 1 or vice versa. You may need to have a link to disconnect the additional circuitry for a download but most non-kinetic loads will survive a flickering download.
 

Buzby

Senior Member
Can the two digit display be multiplexed ?. This would give you a couple of spare pins.
 

westaust55

Moderator
I support IWP's proposal to move to a newer variant of PICAXE microcontroller.

Looking at a vintage copy of the PICAXE Manual 1 (V5.2 from April 2004) the 18A only has 8 outputs whereas the 18X has 9 outputs suggesting the SEROUT pin option is likely not possible.Early PICAXE Capabilities.jpg

Since you were proposing an AND (or similar) logic gate IC, if determined to stay with what you have, (the 18A) then a further alternative is to consider a 74HC595 shift register IC to drive your two BCD digits. That would use three outputs and leave you with 5 for your new tasks.
 

Flenser

Senior Member
There is a way to use an input pin on a PICAXE chip as an output described here: 08M2 and pin C.3 as output

This will not be an option for you as the 18A is so old that the PULLUP command is not documented in manual 2. When I try PULLUP ON for the 18A in PE6 it generates a syntax error so it appears that manual 2 might be describing _all_ the chips that support the PULLUP command.

My vote is +1 for buying a shiny new 18M2:
- You can use the 18M2 to complete your project quickly, depending upon how long it takes to get one delivered.
- You get the keep the 18A for a future project that needs less outputs
 
Thanks for all the replies. This forum has been very helpful.

This silly project has endured many false starts and roadblocks. Some are my fault. The bottom line is that it is such a stupid project in the first place. I just want to hear frogs croaking when my timer is done. Through no ones fault but my own I though it would be a snap to do. I have already thrown away about 50$ with various false starts.

But the world economy needs my help so some 18M2+ it is.

Cheers.
 

inglewoodpete

Senior Member
I have already thrown away about 50$ with various false starts.

But the world economy needs my help so some 18M2+ it is.
I'm glad you've kept your sense of humour through this saga. It has been an interesting exercise for many of us. I'm sure you've learnt a bit too.

Enjoy your 18M2s when your investment arrives.
 

premelec

Senior Member
personally I like the 08M2, 14M2, 20M2 as they all use same power and program pins so you can use a 20 pin board with all of them; also the 14 & 20 have 4 PWMOUTs...
 

AllyCat

Senior Member
Hi,
There is a way to use an input pin on a PICAXE chip as an output described here: 08M2 and pin C.3 as output
The OP appears to have (wisely) moved on to using a more modern PICaxe chip, but to tidy up this "loose end". The above method enables (i.e. switches on) an internal "Weak Pullup" resistor (which is implemented on some "input" pins of the "base PIC"), to switch on an external FET (or any logic input of an external CMOS chip). I wondered if the "base PIC" for the 18A (PIC16F818/819) even has Weak Pullups, it does, but only on "Port B", and all 8 are enabled by one single control bit. So it wouldn't be possible to enable (Pull Up) an individual pin output, but anyway "Port B" is already allocated as the PICaxe "Output" port. The remaining pins on the 18A are mainly allocated as "inputs" (or "Port C" I/O pins on the later PICaxe 18 chips) but are actually named as "Port A" on the base PIC.

In the base PIC, all the pins (except the "Master Reset", Leg 4) are configurable as Input or Output so it is possible that they could be used as outputs by using the "Special Function Register" instructions. With modern chips, this uses the POKESFR command, but again the 18A is different and uses a subset of its normal PEEK / POKE commands. In principle, that should use a "READ - MODIFY - WRITE" of the relevant bit(s) of Port A (e.g. PEEK{SFR} SFRADDR , b0 : b0 = b0 ANDNOT {pinweight} : b0 = b0 OR {bitweight} : POKE{SFR} SFRADDR , b0 ) for both the "Data Direction" (TRISA) and "Port" (PORTA) SFRs. However, direct POKE addr , const commands might be adequate, but I have no way to test this for the PICaxe 18A.

Cheers, Alan.
 
Top