BeauNET with PropBASIC - I'm stuck!
simonl
Posts: 866
I've probably bitten-off more than I can chew here (wouldn't be the first time), but I thought I'd try to get Beau Schwabe's high-speed comm's (8.42M Baud) to work with PropBASIC. Unfortunately, whilst I've got it to compile and download to the Prop (RX portion only at the mo'), after the initial texts all I see is garbage.
I hope it's something simple (and I'll continue to look at this myself), but wondered if anyone else might be able to spot what I've done wrong (see attached)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
I hope it's something simple (and I'll continue to look at this myself), but wondered if anyone else might be able to spot what I've done wrong (see attached)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Comments
Change the beginning of the routine to this(below) and see if that works.
· What is happening is that the "DataSamples VAR LONG = PacketSize" is setting DataSamples to the address of "PacketSize" not the value contained in "PacketSize". This is a bug in PropBASIC that I'll have to fix. Any constant > 511 will have this problem (because they are declared as a VAR LONG instead of in the CON section. Adding the line "mov DataSamples, PackSize" should fix it.
· In PropBASIC "par" holds the address of the start of the HUB variables. You need to add the offset to "par" to point to a particular hub variable. It just so happens that "DataIn_ofs" is zero, so your old code would have worked but just by luck.
· Let me know if it works.
·
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
SendChar and SendStr are from some example code, and the STR statement is part of PropBASIC.
I'm still stuck!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
To use SENDSTR only works with HUB variables. So make ASCII a HUB BYTE(8) variable. And you also need to set the last character to zero so the SENDSTR routine will terminate.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
I'm trying to break the problem down, so I've created this test prog' to see if I can get numbers output to the terminal:
With this; the screen clears (after I've hit ENTER) but then I just see the dots - one per line.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
I implemented this and your suggestions into the original code (BeauNET_Demo_RX.pbas), but I still get garbage. I've even tried changing the "DataSamples VAR LONG = PacketSize" to "DataSamples CON PacketSize" (as it's a constant anyway, I think); whilst the garbage hasn't gone, it does at least change! I wonder if the garbage is an indication of my code still pointing to the wrong part of memory?
I've attached my code and Beau's original codes so anyone can see how far I've got - I'm really struggling with this now.
BTW: I have two Prop's connected; one has the original TX code (TX_Propeller_COM_PST.spin) and the second has my PropBASIC RX code (BeauNET_Demo_RX.pbas). The latter is supposed to be a PropBASIC version of RX_Propeller_COM_PST.spin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Post Edited (simonl) : 4/6/2010 7:31:21 PM GMT
This has resulted in constantly repeating garbage (hey, that must be progress, right? LOL)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Sorry I haven't replied sooner, I have been tied up with PropII layout ... your latest code you posted works fine. The only problem is that you are not waiting long enough between transmissions. Please read the note I placed at the waitcnt(800_000+cnt)
The Attached code is basically the code that you posted.
1) I modified it for 5MHz operation and moved the TX and RX pins to Pin 7 for both RX and TX
2) I reduced the Debug baud to 19200
3) On the waitcnt note above I placed it in a repeat loop of 3, so effectively it 'could' read...
waitcnt(2_400_000+cnt)
Note: Steps 1&2 above were just to make your code friendly to what I had setup, #3 is what the real culprit was.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Ah - crossed wires I think; I attached those two files so that others could see the original codes ( which work just fine ). I'm actually trying to get them working in PropBASIC, but without much luck yet.
My set-up has two Prop's; the first is running your TX code, but the second is running "BeauNET_Demo_RX.pbas" (which is my attempt to get your RX code to work in PropBASIC). The two are on the same breadboard with a 10K pull-down resistor on the comm's line. This set-up works fine with your code.
I think the problem is related to pointing at the wrong place in memory, but I don't understand PASM nor PropBASIC enough to figure it out yet.
Thanks for your post though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Hmmm, Sorry I don't know, PropBASIC is unfamiliar water for me.
First thing I would do it to try to look at the 'garbage' at a bit level and check if maybe there isn't something weird like a data inversion or something. Set your data so that it would make a 'specific' pattern instead of the pseudo random seed... make sure that works first, and then expand your parameters.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.