Quickstart Board Clockmodes- Ground Issues??
waymond91
Posts: 15
Hey All!
So I have been working on an autopilot for an RC airplane. I first tested my control model on an arduino board, once that was more or less working, I decided to scale up to a beaglebone. I did not make much progress with the beaglebone because I cannot get it working in real time. So I have arrived at the propeller!!
I am very happy with how this is works, and I have gotten over the anxiety of not using interrupts. There are still a lot of systems I need to bring up using this chip, but I am starting with reading the rc receiver. This basically sends pulses between 1-2 millis in order to write the servo position.
I spent the better part of the day pouring over the manual, and the counters release: http://www.parallaxsemiconductor.com/an001
After going over the counter modes, and comparing my code with some other peoples objects, I wrote something that works!:
However, I am having very strange issues. I am using the propeller quickstart board. If I hold the board in the air, it will not communicate back to my computer over the serial port (i have tried different cables).
If I leave it on the table, it will report values, and they will jump around, or sometimes stop. If I put my hand on the table, leave my seat, hover my hand over the board, etc this also seems to trigger serial communication (red LED onboard flashes).
In addition, even though I using any of the LED I/Os, if I run my finger along where the IOs solder in, or touch it in other places, the LEDs will light up.
I really cannot imagine what the issue is on this, any ideas? I am getting close to asking for a replacement...
Any help would be great!!!
So I have been working on an autopilot for an RC airplane. I first tested my control model on an arduino board, once that was more or less working, I decided to scale up to a beaglebone. I did not make much progress with the beaglebone because I cannot get it working in real time. So I have arrived at the propeller!!
I am very happy with how this is works, and I have gotten over the anxiety of not using interrupts. There are still a lot of systems I need to bring up using this chip, but I am starting with reading the rc receiver. This basically sends pulses between 1-2 millis in order to write the servo position.
I spent the better part of the day pouring over the manual, and the counters release: http://www.parallaxsemiconductor.com/an001
After going over the counter modes, and comparing my code with some other peoples objects, I wrote something that works!:
CON _clkmode = xtal1 + pll16x 'Run at the full 80MHz _xinfreq = 5_000_000 elevator_in = 0 OBJ pst : "Parallax Serial Terminal" VAR LONG stack[20] LONG cycles PUB main pst.start (115_200) CTRA [30..26] := %11010 'Counter only adds FRQA to PHSA iff APIN is also HIGH CTRA [5..0] := |<long [elevator_in] 'Attach elevator_in to APIN FRQA := 1 'PHSA increments by values of 1 repeat WAITPEQ ( |<long[elevator_in], |<long[elevator_in], 0) 'wait for elevator_in to go high, could be waitpeq(%1,%1,0) WAITPNE ( |<long[elevator_in], |<long[elevator_in], 0) 'wait for elevator_in to go low cycles:= PHSA/(clkfreq/FRQA) 'now cycles should hold the number of clock cycles that past while elevator_in was HIGH pst.dec(duration) pst.newline PHSA := 0
However, I am having very strange issues. I am using the propeller quickstart board. If I hold the board in the air, it will not communicate back to my computer over the serial port (i have tried different cables).
If I leave it on the table, it will report values, and they will jump around, or sometimes stop. If I put my hand on the table, leave my seat, hover my hand over the board, etc this also seems to trigger serial communication (red LED onboard flashes).
In addition, even though I using any of the LED I/Os, if I run my finger along where the IOs solder in, or touch it in other places, the LEDs will light up.
I really cannot imagine what the issue is on this, any ideas? I am getting close to asking for a replacement...
Any help would be great!!!
Comments
Reading your post and your code makes me believe that you are not very experienced in programming so far, but that you are very keen on implementing your autopilot. This is a very dangerous mixture! Dangerous because this mixture makes you want everything and now! But due to the lack of knowledge it often ends up in frustration and failure. You should really take the time to start from the beginning! Read the Propeller Education Kit Lab and do the exercises to really understand the propeller!
Otherwise please let us know where and when you will do your test-flights, so that we can avoid this area at that time ;o)
About the LEDs:
If you have a look at the schematics of the quickstart, you can see that the LED's are driven by an extra driver IC. Leaving the pins of the propeller that control the LEDs as an input means that there is no defined logic level on the drivers input either. So, it could be enough to move your hand to charge/discharge these lines which will show up as blinking LEDs.
On the other hand if your code does not read those input-pins there is no harm.
That took care of it. As I said, I am new to propeller, but even after just a couple days working with it, I have learned a little why the projects I have done in the past had to work the way they did. Thank you for the help!
If anyone is interested, this seemed to read on receiver channel just fine:
CTRA[5..0] := %00001
Is this a 5 bit or 32 bit register???
For example you could assign everything in one go: ctra := %0_11010_000 << 23 | elevator_pin.