Announcement
Collapse
No announcement yet.
Announcement
Collapse
No announcement yet.
Modified sketch for improved timing precision.
Collapse
X
-
Why is mainsample and efeSample inverted? They should be the same polarity as Tx Pulse.
Leave a comment:
-
Actually I meant the code from Gounghouk.Originally posted by SaltyDog View Post
The code I was using is attached.
These are the signals I get on my setup, including sound. They match the original sketch exactly. Audio 490 Hz, period 1000ms, delay 10us, etc.
Using this sketch Arduino_PI2.0.1.zip
Tx pulse and mainSample:
Tx pulse and efeSample
Sound on pin 11.
I'm mystified about the whistle cause I haven't touched the sound.
Leave a comment:
-
The code I was using is attached.Originally posted by Teleno View Post
My code is based on the original by George. I might have missed improvements by others, including delays and pulse widths. Would really like to see your code.
Enjoy the wedding, and congrats I suppose.Attached Files
Leave a comment:
-
My code is based on the original by George. I might have missed improvements by others, including delays and pulse widths. Would really like to see your code.Originally posted by SaltyDog View Post
I don't have time at the moment, have my Daughters wedding ... will try after that with your latest code. I presume you have a full working unit that performs in the field, not just on the bench? Correct timing is one thing, but actual use is the best ..
Enjoy the wedding, and congrats I suppose.
Leave a comment:
-
I don't have time at the moment, have my Daughters wedding ... will try after that with your latest code. I presume you have a full working unit that performs in the field, not just on the bench? Correct timing is one thing, but actual use is the best ..Originally posted by Teleno View Post
If yiu post the sketch you're using I can look at the differences and maybe figure out the problem.
I focused on the timing and I might inadvertently have broken other parts of the code.
Is the timing of the pulses right? The delays and pulse widths? I mean on the scope.
Leave a comment:
-
If yiu post the sketch you're using I can look at the differences and maybe figure out the problem.Originally posted by SaltyDog View PostTeleno I had high hopes that your mods would improve the sensitivity, but in actual operation, was worse than the code I am using from Gunghouk
Also, there is an annoying background whistle. My test gold ring was only found at 25cm, where as with the fast-write code from Gunghouk was 40cm.
No idea why. I will investigate further when I have some time. I was using your version 2.0
I focused on the timing and I might inadvertently have broken other parts of the code.
Is the timing of the pulses right? The delays and pulse widths? I mean on the scope.
Leave a comment:
-
Teleno I had high hopes that your mods would improve the sensitivity, but in actual operation, was worse than the code I am using from Gunghouk
Also, there is an annoying background whistle. My test gold ring was only found at 25cm, where as with the fast-write code from Gunghouk was 40cm.
No idea why. I will investigate further when I have some time. I was using your version 2.0
Leave a comment:
-
In this version,
- floating arithmetic replaced by integers.
- timing parameters defined in microseconds
- interrupt code minimized, parts moved to loop
- mainSample delay can be as low as 1us
Aduino_PI2.0.1.zip
Attached Files
Leave a comment:
-
Here's how to do the mod on the PCB with minimum impact.
Cut the "south' pins of R5 an R11 as close to their pads as possible (so that you can solder them back to undo the mod) and pull their free ends slightly up (~30 degrees) .
With a soldering iron and a length of insulated mod wire, connect the free end of R5 to the old pad of R11. Another length of wire and connect the free end of R11 to the old pad of R5. Done!
To avoid accidental shorts place some foam/tape between the cut pins and their old pads.
The red lines in the figure mark the pins to cut.
Test point TP2 is no longer the TX signal but the EFE signal. To see the TX probe the "north" end of R11 instead (the one soldered to its pad).
Leave a comment:
-
And what is the point of posting that here? This is an Arduino PI forum, unless I am mistaken.
Leave a comment:
-
and here is simple code for stm32f103,
pic, 200 ns and 20 usHTML Code:HardwareTimer pwmtimer2(2); void setup() { pinMode(PA3, PWM);// CH4 // pinMode(PA3, OUTPUT);// CH4 pinMode(PB11, INPUT_PULLDOWN); //Timer 2 pwmtimer2.pause(); //pwmtimer2.setPrescaleFactor(180);// 180 = 4kHz // pwmtimer2.setPrescaleFactor(1800);// 1800 = 400Hz // pwmtimer2.setPrescaleFactor(3600);// 3600 = 200 Hz //pwmtimer2.setPrescaleFactor(5000); // 140 Hz pwmtimer2.setPrescaleFactor(3000); //pwmtimer2.setOverflow(100 - 1);// pwmtimer2.setOverflow(90); // = // pwmtimer2.setOverflow(50); // pwmtimer2.setCompare(TIMER_CH4, 1); pwmtimer2.refresh(); pwmtimer2.resume(); } void loop() { /* if (digitalRead(PB11) == HIGH) { } else { pwmtimer2.refresh(); } */ }
Leave a comment:
-
Good Info, will try it out .... needed to see this to decide to make the step to modify the board (pin swap)
Leave a comment:

Leave a comment: