Pulsin command PICAXE18M which imput?

ashleylad

Member
Hi all, been making lots of servo r/c circuits lately with good sucess. I have used the pulsin command to detect when a particular channel is selected from an r/c reciever a bit like this rough example:-


start
pulsin 3,1,b2
if b2 < 170 then start
if b2 > 170 then run

This waits for a pulse over half way about 1.7ms to activate.

I have managed to use a relevant input pin on 08M,14M, and 20M with perfect results but have come unstuck using an 18M device

For wiring sake I would like to use pin 16 Input 7 or pin 15 Input 6

I have tried pulsin 6,1,b2 and also pulsin 7,1,b2 but no joy. Still getting up to speed with the 18M is there something I need to do to assign inputs or can I not use pulsin on these pins?

Thanks in advance

Ash
 

hippy

Ex-Staff (retired)
This could be a pin naming / numbering issue; the 18M2 uses the port.pin convention, so try ...

PulsIn C.6, 1, b2
PulsIn C.7, 1, b2
 

ashleylad

Member
Thanks hippy. I am using an 18M part as opposed to the newer 18M2. Does the port.pin convention/instructions still apply? The 18 series seem quite different to the other devices.

Cheers

Ash
 

inglewoodpete

Senior Member
Thanks hippy. I am using an 18M part as opposed to the newer 18M2. Does the port.pin convention/instructions still apply? The 18 series seem quite different to the other devices.
Sorry Ash, I must learn to read posts more carefully. I don't have an 18M to test the command on. I presume it compiles and loads OK.

As an aside, check the syntax. The command description specifies a WORD variable. If it compiles, I don't think it would affect the running program. Worth a check, though.

Peter
 

Technical

Technical Support
Staff member
6 and 7 are 'ST' style inputs on the 18M, which need a higher voltage to trigger (0.8 x supply voltage). Try inputs 0,1 (TTL style inputs) on your 18M - if they work it proves your trigger voltage from the servo is simply not high enough.

A simple work around is to reduce your PICAXE power supply voltage, e.g. from 5V down to 4V.

The newer parts such as the 18M2 have all TTL style inputs, so this is not an issue on these parts.
 

hippy

Ex-Staff (retired)
@ ashleylad : I also wasn't paying attention so sorry; the 18M uses the standard pin number so your code is correct and it may be as Technical suggests, a matter of ST and TTL inputs.
 

ashleylad

Member
Thanks for the quick responses all. I will try later on. Would I be correct in saying that all the inputs on the 08M 14M and 20M are TTL as they detect the pulsin no problem?

Cheers

Ash
 

ashleylad

Member
Tried input 1 instead and it worked perfectly, thanks hippy and thanks for the specification link very useful.

Cheers

Ash
 

hippy

Ex-Staff (retired)
Thanks really go to Technical but you're welcome. We're glad you've got the issue resolved.
 
Top