08m serial connection

petepool

New Member
Hi there.
i am trying to make a RGB light using LED's. i have two main 08m chips that have the programs that controls three other 'slave' 08m's. the main chips have a serial out commands and the three 'slaves' have the serial in command, which takes the data in and does a pwm out. however, to make it work i need to put a LED between the input signal pin of the slave and ground. no other component will work. here is the code i am using:

fade: let b1=85
let b2=170
let b3=255
loop1:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b1=0 then goto loop2
goto loop1
loop2:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b2=0 then goto loop3
goto loop2
loop3:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b3=0 then goto loop4
goto loop3
loop4:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b1=255 then goto loop5
goto loop4
loop5:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b2=255 then goto loop6
goto loop5
loop6:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b3=255 then goto fade
goto fade

this is the program that i have in my main chip and it is supposed to fade the three led's that are connected to my slave chips.

this is the program for my slave:

main:
input 4
serin 4,N2400,b1
pwmout pin2,b1,100
goto main

pin 2 is connected to an led.
my main problem is that the two chips are not talking to eachother properly. is there something wrong with my programme or the hardware?
cheers
pete
 

inglewoodpete

Senior Member
Firstly, welcome to the forum.

pin 2 is connected to an led.
Can you clarify if you are using a current limiting resistor in series with the LED? Without it, the slave PICAXE will be stressed and this may reset it or at least affect the reception of serial data.

When posting code, please use the "code" tags. This will preserve the structure of your code. (I hope your using tabs etc to make it more readable than what we can see posted). Also some comments will help others (and yourself when you revisit your code at a later date) to understand the functionality.

It will help you to start with smaller 'chunks' of code. Get each part working (Eg Serial to 1 slave) before moving to the next step.
 

petepool

New Member
yeah, sorry, new to using forums :)

yes i am using a current limiting resistor, 220Ohm.
and yes, the code is more spaced out in the program, just compacted it to fit in here.

does anyone know what the normal peak-peak output voltage from a serial output is??

i am getting around 2.6V, might this not be enough to input into another chip?

thanks.
 

hippy

Technical Support
Staff member
does anyone know what the normal peak-peak output voltage from a serial output is??
Somewhere around +12V/-12V with the cable disconnected from the PICAXE circuit for a desktop system, often +5V/0V for a laptop, could be either for USB-to-serial. A desktop PC should deliver around +5.5V/-0.5V when connected to the PICAXE circuit measured on the serial input pin.

i am getting around 2.6V, might this not be enough to input into another chip?
That sounds too low. Check you don't have any shorts on the board and that you've got the serial interface right. It's not a voltage divider, the 10K pull-down is closest to the PC then 22K into the PICAXE, not the 10K after the 22K from the PICAXE pin.

If it's the voltage on a DMM while something is being sent it could be correct; an average of the +5V pulses and the 0V idles. Use the Test Serial Port ( or whatever ) somewhere under View->Options of the Programming Editor.
 
Top