waiting for serin data from 4 picaxes

Denzel

Senior Member
I have 4 picaxe 08s that are getting data from switches and need to tell an 18x what switches are pressed, these are pushbutton switches so only one out of all 12 will be pressed at once.

because the 18x cant simultaniously wait on for different serin commands on four different inputs at once is it possible to link all of the 08 outputs together and have them connect to just one serin input on the 18x? if this is possible do I need diodes (1n4004) on all the 08 outputs?

cheers
 

Attachments

inglewoodpete

Senior Member
Denz, You can use 1 diode for each 08M (cathode to the 08M output). Common all anodes together and connect a 4.7k (or 10k) between the junction of the anodes and +5v. This will pull the input to the 18X high until 1 of the 08Ms sends data. This will work for 'T' serial (idle high). Refer to SerOut command.

1N4148 or 1N914 diodes are adequate for this and less bulky then the EM400x series. However the EM400x's will do.

Peter
 
Last edited:

BeanieBots

Moderator
Not quite. Either swap the pull-up for a pull down or swap the diodes around and use N2400.

If you can't remember your anodes from your cathodes, look at the diode symbol and think Kathode.
 
Last edited:

Denzel

Senior Member
Ah

i see.
so putting the 4k7 to ground instead of 4.5v will work using T2400 leaving the diodes where they are?
 

BeanieBots

Moderator
Sorry, my mistake. Might have confused you further!

Either swap the pull-up for a pull down and use N2400 OR swap the diodes around and use T2400
 

Denzel

Senior Member
ha

I thought so, hence the re questioning.
I will use a pull down resistor and n2400 as this is what i usually do between just two picaxes.

Cheers
guys
 

inglewoodpete

Senior Member
As always, put a couple of 08Ms and an 18X on a breadboad and test it. The results will tell you when you've got it right.

BB was commenting on your diagramme: your diodes were the reverse of my description.
 

hippy

Technical Support
Staff member
Diodes with cathodes ( pointy end ) to the receiver with a pull-down and Nxxxx baud rates is always my recommendation. There are a few advantges over the alternative -

1) A high voltage means something is being sent, more logical all round and easier to understand and debug.

2) A LED+R between signal and 0V shows data being transmitted

3) PICAXE outputs initialise at 0V so there's no false receiving of data which wasn't actually sent. No need to set those lines high at turn-on so saves a little code and no problems when this is inevitably forgotten about, and no need to Pause after turn-on before sending data.

4) It matches the polarity of the cable into the PC so, with a 22K in series, a PC can slo put data into the system, and any signal can be tapped off to the PC for monitoring.

As with any multi-drop system; the biggest issue is when two or more transmitters send at the same time; the reciever will see an amalgamation of that which usually makes for corrupt data. As long as that can be detected and discarded and it's not essential to capture all data that should be okay. It does become problematical if this situation occurs regularly as the receiver may never get any non-corrupt data at all.
 
Top