outputs pins

lake

New Member
hi iw as wondering what other pin could i use as an output i am all ready using all the 16 on the 40x1 and the serout or is that all i can use thanks
 

hippy

Technical Support
Staff member
That's your lot. You'll need to start adding I/O expanders, either with dedicated hardware or other PICAXE's programmed up to do the job.
 

lake

New Member
yh ok well im going to expand the outputs by using transistors i can get i think it about 26 from 8 ouputs as i am going to make the lenth of my dot matrix to 8x16 but im only going to get what i need which is another 8 thanks for your help
 

inglewoodpete

Senior Member
Since you are using a dot matrix display, consider using a couple of 74LS138 chips (or equiv) to drive the columns. You only need to activate 1 column at a time if multiplexing a dot matrix display. You can use 5 pins to drive the 2 x 138 chips, leaving 3 spare!
 

lake

New Member
yh im just seeing what i can do im quite new to electronics and im just playing around with thing ive got some maxim 6953 epl+ ic to play with i they have 24 outputs so im going to start to learn the i2c comands thanks for help
 

Dippy

Moderator
Well, not from USA covers quite a large area.

UK:
Farnell: 1106080 61p

Rapid: 83-0772 31p

Where are you? Perhaps that may contributors to narrow it down a bit.
 

lake

New Member
hmm yh i never knew rapid did them i have an accout ill just order some from there thanks alot everyone
 

lake

New Member
or could i just use a picaxe18 by using the table for the decoder use the same outputs a0 a1 a2 combinations to power the 8 outputs the picaxe has to offer because i have a few picaxe 18 around some where thanks

 

Dippy

Moderator
I didn't quite understand your sentence, but probably.
Just note that the 74LS138 will only output one of the 8 depending on your A,B,C input. So you can't have (e.g) output 2 and 5 on simultaneously if you see what I mean. Remember, its a binary 3-8 decoder.

PS. "..i never knew rapid did them.." - you should try what I did.

Edited by - dippy on 22/07/2007 12:41:06
 

lake

New Member
sorry i should have said it better you have three inputs to control the 8 instead of having the 3 to 8 decoder couldnt i just have a picaxe by using the same input combinations and outputs like the table shown on here
http://ece.colorado.edu/~mcclurel/sn74ls138rev5.pdf
so use the inputs on the picaxe to see if the main picaxe 40x1 has outputed like this



symbol a0=input0
symbol a1=input1
symbol a2=input2
main:
do
let pins=%11111111
if a0=0 and a1=0 and a2=0 then low0
if a0=1 and a1=0 and a2=0 then low1
if a0=0 and a1=1 and a2=0 then low2
if a0=1 and a1=1 and a2=0 then low3
if a0=0 and a1=0 and a2=1 then low4
if a0=1 and a1=0 and a2=1 then low5
if a0=0 and a1=1 and a2=1 then low6
if a0=1 and a1=1 and a2=1 then low7
loop
low0:
let pins=%01111111
pause 1
goto main
low1:
let pins=%10111111
pause 1
goto main
low2:
let pins=%11011111
pause 1
goto main
low3:
let pins=%11101111
pause 1
goto main
low4:
let pins=%11110111
pause 1
goto main
low5:
let pins=%11111011
pause 1
goto main
low6:
let pins=%11111101
pause 1
goto main
low7:
let pins=%11111110
pause 1
goto main

Edited by - lakey009 on 22/07/2007 13:05:59
 

hippy

Technical Support
Staff member
It only works fine though while the A0, A1 and A2 address lines change slowly. If they change too quickly the PICAXE will not be able to keep up. You can improve performance by using &quot;SETFREQ M8&quot; and you can also optimise your code so it runs as fast as possible -<code><pre><font size=2 face='Courier'>SETFREQ M8
DO
b0 = pins &amp; 7
READ b0,pins
LOOP
EEPROM ( %11111110 ) ' 0
EEPROM ( %11111101 ) ' 1
EEPROM ( %11111011 ) ' 2
EEPROM ( %11110111 ) ' 3
EEPROM ( %11101111 ) ' 4
EEPROM ( %11011111 ) ' 5
EEPROM ( %10111111 ) ' 6
EEPROM ( %01111111 ) ' 7 </font></pre></code> For a PICAXE which has separate Code Flash and Data Eeprom ( 18A, 18X, 28X1, 40X1 ) You can repeat the pattern throughout Eeprom and then use thsi code which should be the fastest you can get with a PICAXE -<code><pre><font size=2 face='Courier'>SETFREQ M8
DO
READ pins,pins
READ pins,pins
: ; Repaet until memory full
READ pins,pins
LOOP </font></pre></code> There is an issue with both these solutions. If the decoder PICAXE reads the A0, A1 and A2 just as they are changed by the master, the wrong values may be read, because two lines may have changed before any other does.

The usual solution is to have an enable so the A lines can be changed, then the chip told they are stable, but another solution when cycling through a fixed sequence is to use a 'grey decoder' pattern so only one bit changes at any time.

Another alternative is to just supply an increment signal to the PICAXE and have it step through the required pattern. That also minimises the number of interfacing lines.


Edited by - hippy on 22/07/2007 17:20:34
 

lake

New Member
yh im like new to picaxe so still earning just benn looking at the datasheets for eeprom and i seem to get most of it still learning but you said

&quot;There is an issue with both these solutions. If the decoder PICAXE reads the A0, A1 and A2 just as they are changed by the master, the wrong values may be read, because two lines may have changed before any other does&quot;

when it reads the inputs pins if any = a 1 we could have the picaxe jump to another sub menu where then it raeds all the pins then return soon to output them i think this could work as the master the 40x1 would be outputting the signal for at least pause 2 just bit longer than the led needs to light and then it will turn off so when the slave pic sees an input then it checks all the pins again then outputs the second lot of pins would that help a miss read of the input values at all thanks
 
Top