SX52 Proto Board problems
I'm currently trying to "port" some code I've been working on the SX28 to the SX52 via the wonderfully priced SX52 Proto Board. I'm working in the SX/B environment.
The problem I'm having is the code seems to be running really slow on the SX52 in comparison to the SX28. The program receives serial bytes at 250K and blinks LED's when the values change. With the SX52, it doesn't seem to read the bytes in correctly, almost as if the baud rate were wrong and thus having them read in slower.
I'm guessing my problem has something to do with the device settings, but I'm not sure.
my settings that work on the SX28
DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ 50_000_000
Upon compiling for the first time on the SX52, I had to remove the TURBO, STACKX, OPTIONX for it to complete. Also in order to get it to run off a 50MegHz resonator without the SXKey, I had to change the OSCXT2 to OSCHS3. Is this correct?
My problem seems to be focused around the SERIN command, whereas other commands seem to function correctly.
any help would be appreciated
The problem I'm having is the code seems to be running really slow on the SX52 in comparison to the SX28. The program receives serial bytes at 250K and blinks LED's when the values change. With the SX52, it doesn't seem to read the bytes in correctly, almost as if the baud rate were wrong and thus having them read in slower.
I'm guessing my problem has something to do with the device settings, but I'm not sure.
my settings that work on the SX28
DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ 50_000_000
Upon compiling for the first time on the SX52, I had to remove the TURBO, STACKX, OPTIONX for it to complete. Also in order to get it to run off a 50MegHz resonator without the SXKey, I had to change the OSCXT2 to OSCHS3. Is this correct?
My problem seems to be focused around the SERIN command, whereas other commands seem to function correctly.
any help would be appreciated
Comments
Please post the whole program. Without it we are just guessing...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
Here's the source. It's a program to recieve DMX started by the kind Jon Williams.
( Thanks Jon
I have a SX28 version (which is working great) and a SX52 version, which I removed some of the Device settings (TURBO, STACKX, OPTIONX) to get it to compile.
Tonight I setup some watchpoints to see if SERIN is recieving the correct serial byte and it appears to be getting it right every other byte or so when I tap on the Poll button in debug mode.
When I send a signal at it, from an external source, say at 500 ms. intervals, it pulses the LED's on the SX28 at the correct rate and value. With the SX52, it pulses much slower and irratic as well as has a lot of wrong values, like's it's not really syncing up correctly or electrically something is wrong.
thanks for the help and thanks to Jon for getting me started.
gotta love this community
S White
Are you using SX/B version 1.41 ? There were a couple SX52 bugs corrected.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
so back to an earlier question. what is the best or most correct device setting for a 50mghz resonator?
OSCXT2
OSCHS2
thanks for the help Bean
PS at least I have it working on the SX28 and can get what I need accomplished with it. I was hoping to use the extra I/O ports for more features and the protoboard for low cost, but for now 20 I/O is still pretty useful. Perhaps tonight I will try send it some lower baud rate messages. Maybe it's just having trouble dealing with 250K baud.
I use OSCHS2 for a 50MHz resonator.
I think I found the problem. The compiler is not setting the FSR register after the subroutine assignment to an array element.
The fix is to either put the return value into a normal byte variable, then assign the the byte variable to the array or
put a "BANK" instruction after each line that assigns the return value to an array element.
Such as:
'
·DMXdata_A(0) = RXBYTE_DMX···' get start byte
·BANK
'
This is·a known bug, and should be corrected in the next release of SX/B.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
Post Edited (Bean (Hitt Consulting)) : 8/24/2005 2:10:11 AM GMT
I tried both your sugguestions, but had the same results. I spent some time in the debugger with a simplified version of the code could see I'm recieving wrong bytes from the SERIN call. I pulled out the subroutines and arrays and still saw it giving mixed values
for instance, if I send a 3, I get a 3 or 96
0 always gives me 0
255 always give 255
16 gives me a 16 or 12
17, 17 and 44
20, 20 and 49
100, 100 and 54 and 35
200, 200 and 30
this makes me suspect it's not syncing up with the start bit right each time or running at the wrong rate and giving multiple values.
I'll give it another go tomorrow night and worst case I'll go back to the SX28 and use less I/O lines.
I was planning on eventually redoing it in with interrupts, once I get my chops up a bit.
thanks for all your help
Stuart
Could you post this "simplified" code that's giving you problems.
I would like to see what's causing it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
It would seem optimal if Parallax would provide a 'rock solid' test program that either did a 'Hello World' or blinks an LED at 50Mhz clock.
It would certainly eliminate a lot of redundant dialogue as many of us are probably struggling with the conversion of the Parallax Tutorial and Documentation that primarily supports the SX-28 which has some significant differences due to its smaller memory and differences in paging.· I seem to be jumping back and forth between Ubicom and Parallax information.
I am sure I can work through this on my own, but we all hit·a wall sometime and begin to wonder if we burnt up our board.· It would be nice to just have a 'quickie test' rather than spend a day or two on creating our own.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan
Post Edited (Kramer) : 8/26/2005 4:03:25 PM GMT
As for the best place for such a test program, could it be in the SX48/52 Proto Board documentation? Let me know where you'd like to see these examples to be created and we'll get it done. I'd need the same at this point - a simple program and step-wise procedure to write an SX/B or assembly language program to blink an LED with all the right directives, plus choosing the right file menus to download and debug the example.
We would also put this example in Guenther's SX-Key Manual revision, which wouldn't appear until later. But it's easy to put it in the SX48/52 Proto Board documentation in the next couple of days.
Let me know what you had in mind. If you're destroying boards, pull the next one out of that cool little plastic box on your workbench. This is why we made them $10, among other reasons. That's a couple of bowls of noodles in your case.
Yours,
Ken Gracey
Parallax, Inc.
Here's the "simple code" I spoke about. Basically I pulled out a bunch of stuff, subroutines, variables, and then I added some watchpoints to check out what's coming in. When you mentioned that arrays or passing the value from a subroutine might be causing my problems, I thought this would be a good test.
Stuart
I suppose you could do a fancy program that does a Checksum of the memory and will serially flash LEDs on all ports to confirm. But then I would have to figure out how to connect 40 LEDs at one time. [noparse][[/noparse]I know I could do it in 8 LED banks].
This just fine. Above all keep it simple. We have begineers amongst us. One or two resistors and one or two·LEDs·are enough.
For $10USD, I can eat noodles for a month
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan
Post Edited (Kramer) : 8/27/2005 1:13:36 PM GMT
I see that SX/B version 1.42 is now available for download. It fixes the problem I pointed out earlier about FSR not getting set correctly.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
thread by Ken Gracey been completed yet? If so, where might it be located?
Bob
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I spent half an hour yesterday evening trying to "port" led28 to my first SX52 proto board (a quick test before buying a stack of them today during the hurricane relief time slot), but the best result I got was some erratic flickering, which is beginnign to sound familiar.
In order to be able to play with the frequency better, perhaps it shoudl just count on the whole RC port, rather than toggle 1 bit.
thanks.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available soon!! Video overlay(OSD) module...
"I'm a man, but I can change, if I have to, I guess"
Red Green
·
At times I feel I ask too much and you guys are quite patient and generous.
It seems really silly, but most of use blame the hardware when we can't get started. The doubts creep in.
Since there are so many beginners. So just having a trusty diagnostic will eliminate a lot of dialogue.
By the way, I was going to just write one and post it right away [noparse][[/noparse]my post is dated 8/27] But, time slips by.
Procurement of parts diverts me. I have spent much of this time getting an 8mhz crytal functional for servo control in my prime project. That's just the way it is.
I certainly know that everyone at Parallax has a lot to juggle. Jon is really handy with code, but he also writes a very informative article once a month for Nuts and Volts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan
I would hope that trying to get a single LED to blink isn't fraught with that kind of peril...
What else is needed?
Our test program is not completed, but it will be done shortly. We're in the midst of a lot of projects related to the SX, among other things. Give us a few more days please.
- Ken
My program is a little different; it increments a 16-bit counter when a button on RA.0 is pressed (making RA.0 low).· The count is also placed on LEDs on RB and RC.· All unused pins are pulled-up.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
$8 and $9 manage the higher ports D and E, right?
David
Yes, that would be the problem, thanks, fixed. (Changing the variable register assignments in the code in my post above will make it work.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I guess there go our chances of ever being hired by Parallax.