Shop OBEX P1 Docs P2 Docs Learn Events
SX52 Proto Board problems — Parallax Forums

SX52 Proto Board problems

Stuart WhiteStuart White Posts: 6
edited 2005-09-08 16:21 in General Discussion
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

Comments

  • BeanBean Posts: 8,129
    edited 2005-08-23 00:30
    Stuart,
    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"
    ·
  • Stuart WhiteStuart White Posts: 6
    edited 2005-08-23 06:02
    Hi Bean

    Here's the source. It's a program to recieve DMX started by the kind Jon Williams.

    ( Thanks Jon smile.gif I tried to email you and thank you before, but all of my emails bounced back at me from your server )


    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
  • BeanBean Posts: 8,129
    edited 2005-08-23 11:23
    Stuart,
    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"
    ·
  • Stuart WhiteStuart White Posts: 6
    edited 2005-08-23 19:10
    Yeah, I'm running SX/B 1.41.

    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.
  • BeanBean Posts: 8,129
    edited 2005-08-24 01:00
    Stuart,
    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
  • Stuart WhiteStuart White Posts: 6
    edited 2005-08-25 09:27
    Hey Bean


    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
  • BeanBean Posts: 8,129
    edited 2005-08-25 11:15
    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"
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-08-26 16:04
    I just logged on because I am getting started with my SX-52 Proto board and want to do a test run.· I running into related issues.

    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
  • Ken GraceyKen Gracey Posts: 7,407
    edited 2005-08-26 19:37
    Hi George,

    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.
  • Stuart WhiteStuart White Posts: 6
    edited 2005-08-27 10:52
    Hi Bean


    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
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-08-27 13:11
    Excellent, I have just finished soldering my Sx-52 protoboard and I need to give it a test run to confirm I didn't burn up anything.

    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 roll.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan

    Post Edited (Kramer) : 8/27/2005 1:13:36 PM GMT
  • BeanBean Posts: 8,129
    edited 2005-08-30 13:35
    Stuart,
    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"
    ·
  • southernbobsouthernbob Posts: 34
    edited 2005-09-06 22:12
    Has the test program for the SX52 Proto board mentioned earlier in this

    thread by Ken Gracey been completed yet? If so, where might it be located?

    Bob
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-06 22:30
    What would you consider a valid and useful test? You'll have to add some sort of hardware -- what do you want to add in order to be assured that everything is working properly. Knowing that, a test program could very easly be generated with SX/B, and I'd be happy to do that for you.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Benedikt RochowBenedikt Rochow Posts: 11
    edited 2005-09-07 12:00
    A 52 version of led28.src (and an SX/B version of that for those that are using SX/B before assembly) would be nice.
    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.
  • BeanBean Posts: 8,129
    edited 2005-09-07 13:15
    I think the problem most of you are having is that the SX48/52 uses different MODE values than the SX28 family. You shouldn't have a problem with SX/B as it handles those details for you. All you should have to change is the DEVICE line for SX/B programs.
    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
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-09-07 17:04
    I had in mind a 52 version of led28.src too, but I was too embarassed to ask.

    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
  • Benedikt RochowBenedikt Rochow Posts: 11
    edited 2005-09-07 21:19
    Here's my version of led52, which doesn't work. The device is changed to SX52, and all the obsolete DEVICE directives are removed. I've changed the whole port C to be outputs so I can use any of its bits. I've tried two proto boards, several variations on clocking source, and I usually get nothing, and in rare cases the random flickering that eventually dies down, as though I'm destroying the port bit.
    Ken Gracey (Parallax) said...
    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.

    I would hope that trying to get a single LED to blink isn't fraught with that kind of peril...


    ;-------------------------- DEVICE DIRECTIVES --------------------------
    
            DEVICE        SX52,OSC1MHZ
    
    IFDEF    __SASM  ;SASM Directive
            IRC_CAL        IRC_SLOW
            
    ELSE        ;Parallax Assember Directives
            
    ENDIF
    
            RESET        Initialize
    
    ;------------------------------ VARIABLES ------------------------------
                
            Count1    EQU    $08
            Count2    EQU    $09
    
    ;---------------------------- DEBUG SETTINGS ---------------------------
    
            FREQ     1_000_000
        
            WATCH    Count1,16,UDEC
    
    ;------------------------ INITIALIZATION ROUTINE -----------------------
    
    Initialize
            ;Configure port settings
            mov    rc, #%00000000        ;Port C output zero
            mov    !rc,#%00000000        ;Port C output dir.
    
    ;---------------------------- MAIN PROGRAM -----------------------------
    
    Main
    ;Toggle RC with a delay of 64k counts in-between.
    
            call    delay            ;delay    
            mov    W,/RC            ;toggle all of RC port
            mov    RC,W                
            jmp    Main            ;goto main                
    
    
    Delay        clr    Count1          ;Initialize Count1, Count2    
            clr    Count2                                
    
    Loop        djnz    Count1,loop        ;Decrement until all are zero        
            djnz    Count2,loop                            
            ret                ;then return                
    
    



    What else is needed?
  • Ken GraceyKen Gracey Posts: 7,407
    edited 2005-09-07 21:30
    Bob, Benedikt and George:

    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
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-07 21:32
    I'm still learning assembly myself (even more slowly now the SX/B exists...) so I did a quick demo in SX/B.· Give this a try, then look "under the hood" (use Ctrl-L to see the assembly output) to see what you can gleen from it.

    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
  • Benedikt RochowBenedikt Rochow Posts: 11
    edited 2005-09-07 22:38
    Thank you very much. I don't know yet if it's all the boilerplate initialization SX/B does, or the different port direction references, but it certainly works.
  • David BDavid B Posts: 592
    edited 2005-09-07 22:41
    I'm also new to the SX48/52 and am still moving along the learning curve, so somebody correct me if I'm wrong, but don't SX48/52 variables start at $A, not $8?

    $8 and $9 manage the higher ports D and E, right?

    David
  • Benedikt RochowBenedikt Rochow Posts: 11
    edited 2005-09-07 23:03
    David B said...
    I'm also new to the SX48/52 and am still moving along the learning curve, so somebody correct me if I'm wrong, but don't SX48/52 variables start at $A, not $8?

    $8 and $9 manage the higher ports D and E, right?

    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 WilliamsJon Williams Posts: 6,491
    edited 2005-09-08 16:08
    SX/B has a NOSTARTUP option that eliminates nearly all of that start-up code.· The reason the start-up code is there is to clear RAM and set everything to a known state before running the program.
    Benedikt Rochow said...
    Thank you very much. I don't know yet if it's all the boilerplate initialization SX/B does, or the different port direction references, but it certainly works.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Benedikt RochowBenedikt Rochow Posts: 11
    edited 2005-09-08 16:21
    Kramer said...
    A$

    Such a little thing to overlook, but I have been having the same problem too... Heh. Heh.....

    I guess there go our chances of ever being hired by Parallax.
Sign In or Register to comment.