Help debugging!

Andrew Cowan

Senior Member
Hi!

I am trying to debug signals coming in from an rc reciever. The reciever is on pin 2. I am currently using the code:

Pulsin 2,1,w1
debug w1


but it doesn't work.

What is the correct code?

Andrew
 

hippy

Ex-Staff (retired)
How exactly doesn't it work ?

Is that code in a loop
Are you reading the correct pin
Have you connected to the correct pin
Is the signal voltage correct
Is the voltage even getting to the pin
Is the polarity for the signal right
Which PICAXE
etc
 

Andrew Cowan

Senior Member
Sorry - I'll try and be more helpful. The code is:

main: pulsin 2,1,w1
debug w1
pause 500
goto main

When I connect my multimeter between 0V and the input pin (18X), it gets )V when the transmitter is off, 0.22v when it if fully one way, 0.29v in neutral and 0.36v the other way. Throughout the debug process, w1 remains at 0.

Any ideas?
 

Andrew Cowan

Senior Member
It was in a loop. I am using an 18X. There is continuity between the servo input and the input.

With a multimeter between 0V and the input, when the transmitter stick is at one limit, the voltage is 0.22v, netural: 0.29v and the other limit 0.36v.

Using the code:
Main: Pulsin 2,1,w1
if w1=0 then fail
goto main

, it always goes to the 'fail' subroutine. Was it correct to connect the input directly to the reciever?

What could be wrong?

Andrew
 

moxhamj

New Member
The voltage on a multimeter won't mean much - these are narrow pulses that are low for most of the time and the multimeter is averaging the value. W1=0 then fail means it is timing out. I suspect it is not reading a valid high signal ie maybe not >3.5V at least. Simple test on the output of the RC unit is to see if a led flashes (1k=> led) - that will test if it is going over 2V. RC pulses are difficult to debug with just a multimeter - a CRO makes things a lot easier. Without a CRO you could try the led test, then try two red leds in series and a 1k resistor and that will test if a valid high signal is there.
 

Andrew Cowan

Senior Member
Sorry - what is a CRO?

I am using bog standard red LEDs:

LED across 0V and signal = on
1K and LED across 0V and signal = on, bit dimmer
1K and 2 LEDs (series) across 0V and signal = very faint - you can only tell they are on in a darkish room.

I tried (briefly) using an 8.4V battery on the reciever - no luck - it is still timing out. The reason I used a multimeter was to show that the signal was getting to the pin. I will have access to an osciloscope at school on tuesday.

If the signal isn't high enogh, what should I do?

Transistor it?

Thanks,

Andrew
 

elf1564

New Member
Is that code in a loop
Are you reading the correct pin
Have you connected to the correct pin
Is the signal voltage correct
Is the voltage even getting to the pin
Is the polarity for the signal right
Which PICAXE
etc
Nice check list. Another 3 points should added.

Does the receiver and PICAXE share the same ground wire?

Is the serial in and serial out port for the download cable wired correctly to the chip?

Are you using the correct pin address or counting the pins?


The last one typically gets me if I'm not paying attention. For instance, Pin 2 on the 18x isn't output 2 or input 2, but rather serial out. I find it handy to keep a paper copy of the pin out assignments in front of me when making connections as the pin assignments are different in many cases from one chip to another.
 

Andrew Cowan

Senior Member
Is that code in a loop - yes
Are you reading the correct pin - yes
Have you connected to the correct pin - yes
Is the signal voltage correct - not sure
Is the voltage even getting to the pin - a voltage is, but it may not be enough
Is the polarity for the signal right - positive voltage
Which PICAXE - 18X
Does the receiver and PICAXE share the same ground wire? - yes
Is the serial in and serial out port for the download cable wired correctly to the chip? - I can download programs
Are you using the correct pin address or counting the pins? - I think so

Thanks for all of your help guys - I'm sure we'll solve this eventually.

Andrew
 

Michael 2727

Senior Member
CRO = Oscilloscope or SillyScope or Heap of crap
when it performs like mine. It is 25 yrs old, the old
treasure, I should bury it :)
 
Top