Can anyone help me with this - I think I'm going mad ...
I have a PicAxe 28X project board and I'm trying to use it to read a high/low signal from another board. A high should be about 4.9v and the low about 0.1v.
I believe this is effectively identical to the SFR05 sonar. So I've taken Vcc (+5v) and Gnd from the PicAxe to my second board, and brought the signal from the second board back to the digital input pins of the PicAxe. My code loops using Pulsin trying to detect a rising edge. However, it never finds one. Here's the code:
main: pulsin 6,1,w1 ‘ wait for the signal debug w1 ‘ display signal via debug command pause 500 goto main ‘ and around forever
Using my trusty multimeter, I can measure voltage going to the second board - 5v = OK, and the voltage of the signal it produces. Now here's the funny thing. If I measure the voltage with the signal output wire connected to the PicAxe board, it is a steady 5v - which explains the lack of a rising edge, or indeed any edge. If I disconnect the signal wire from the PicAxe board and measure the voltage it fluctuates between a value between 0v and 3.4v - which is closer to what I expected.
So the question is, why does attaching the signal wire to the PicAxe board cause the signal to jump to 5v?
I should add that I've tried different pins with the same result, and that an SFR05 seems to work just fine.
Two board talking… Need a little more info… Is it just a simple handshake? Why is the 2nd board sending pulses? Seems a serial connection is more solid. Is this a pull-up/pull-down resistor issue?
Hard to say. Have you Hard to say. Have you measured the pin 6 input ( and other inputs) while the program is running? To make sure their 10k pulldowns are working as expected? What kinda circuit is generating the pulse?
The second board is an EM2 MSF from HKW Elektronik, which is a time signal receiver; the pulses being the time signal. I got my original info from the PicAxe forum, where someone had this board running with an 08M using pulsin.
I’m now wondering if the resistors on the project board are pulling the pin in the wrong direction - up v. down or vice versa. Does this matter? Or is it a case that the pull-ups/downs are too strong or weak?
I had an issue once with inverted serial commands… Before I knew a picaxe would send/read both versions, I was able to simply reverse it with just a transistor and a pull-up or down resistor. --Worked great
I think you may have hit the solution Chris. All the circuits that I’ve seen elsewhere use a 10k pull-up resistor, the resistor on the 28X project board is a 10k pull-down resistor.
No transistors in my bit-box yet, so a visit to Maplin in the next few days before I can progress.
This one has gotten me too! It is easy to forget that on many of the Picaxe boards, inputs have pull-downs "stock"… --Makes it easier for classrooms to add pushbuttons, I guess.
Looks like Chris had the answer. I’ve built a bare-bones circuit round an 08M instead of the 28X project board; and put a pull-up resistor on the signal line. I’m now seeing the appearance of a signal in the Debug window.
I’m happy as the 08M is my target of choice for this project.
Yeah, I thought about it. But I don’t have any software to analyse the signal and draw the traces. I Googled it a bit and wasn’t encouraged by what I found. I even looked at eBay for pre-owned scopes.
I then realsied that the signal is only modulating at 1 or 2 Hz and I could see this with any voltmeter.