Need starting point to get chips talking

Jarubell

Senior Member
I was told that getting two chips talking to each other is fun, so, here I go but I need direction, where do I start. I have a 08M and 20X2.
 

manuka

Senior Member
This is a tad hazy my good man! As it's almost April 1st I'm tempted to offer you teasing approaches. In fact the request reminds of tentative youthful queries about the other gender/pubs/buying houses etc!

Inbuilt serial commands ( SERIN/SEROUT - check the manual!) are usually suitable, but best you inform us in more detail about your needs, skills & resources etc.
 
Last edited:

MPep

Senior Member
I was told that getting two chips talking to each other is fun, so, here I go but I need direction, where do I start. I have a 08M and 20X2.
Depends on your idea of FUN! But read the commands Manuka recommends. From there you may find other approaches. There are plenty of examples on the forum. Do a search.
 

westaust55

Moderator
Also, what form of connection are you contemplating between the two PICAXE chips:
(a) hard wired (copper)
(b) radio link eg 433MHZ
(c) infrared
(d) damp string - April 1 coming right up! :D

As Manuka says, please give us more information about you goals.

You say: "I was told"
Can the person who told you, also give you more information. :confused:
 

BeanieBots

Moderator
The method will also depend on what you want them to 'say' to each other and what else they need to do while they 'chat' with each other.

serin/serout for most chats.
pulsin/pulsout for basic 'grunts'
I2C to have philosophical debates.

Hardware versions of the above if talking while running.
 

lbenson

Senior Member
Hardware-wise, one-way, for serin/serout, a simple connection between an output pin and an input pin with a series resistor for current-limiting protection (330 ohm to 1K) will suffice. For more sophistication, see kranenborg's '"SerialPower" true two-wire data+power network' thread: http://www.picaxeforum.co.uk/showthread.php?t=7694

The complication is "serin hang", where a picaxe sits waiting for input which never comes. The X1/X2 parts can avoid this with timeout or hardware background i/o. hippy's widely used trick on the 08M is for the sender to first pull the 08M input line high. The 08M interrupts on this and goes into serin to get the character which is next sent.
 

hippy

Ex-Staff (retired)
I would start by programming the 08M to send a character out every second ...

#Picaxe 08M
#Terminal 2400
Do
SerOut 0, N2400, ( "U" )
Pause 1000
Loop

Run that and you should see "U" being printed ion the Terminal display.

Put that to one side and write a program for the 20X2 which reads serial and puts it to the Terminal display ...

#Picaxe 20X2
#Terminal 9600
Do
SerIn C.0, N2400, b0
SerTxd( b0 )
Loop

Leave the Programming Editor connected to the 20X2, Terminal open and power everything off. Connect your 08M leg 7 to leg 10 of the 20X2, connect the +V lines and 0V lines of both 08M and 20X2 circuits together, power up the 08M and 20X2 and you should should see the "U" displayed by the 20X2 program.
 

Jarubell

Senior Member
Perfect! Serin/out! I have been looking around but I've been bouncing all over and just needed a starting point, thanks.

Fun? well maybe that's not exactly what Hippy replied to one of my first questions but it did sound fun.

I'm just going to start small, this is a part time hobby so it may take longer than it should. For now I just thinking about just turning on LEDs or the buzzer I have then I move onto the temperature sensor. So, my goals are small but they will grow after I figure out the basics. (I am thinking about wireless and displays)

Thanks guys
 

fernando_g

Senior Member
The method will also depend on what you want them to 'say' to each other and what else they need to do while they 'chat' with each other.

serin/serout for most chats.
pulsin/pulsout for basic 'grunts'
I2C to have philosophical debates.

Hardware versions of the above if talking while running.
You forgot to mention the sweet analog communication (via filtered PWMOUT and READADC) used by infatuated PICAXEs
 
Top