Shop OBEX P1 Docs P2 Docs Learn Events
Beginners Question...Major Beginner — Parallax Forums

Beginners Question...Major Beginner

SailerManSailerMan Posts: 337
edited 2006-10-03 21:57 in General Discussion
DEVICE          SX28, OSCHS3, TURBO, STACKX, OPTIONX  
 
FREQ            50_000_000
 
PROGRAM Start  
 
Start:
   \Mov !RB,#0
   \Mov RB,#1
 
Main:
 ASM
   Mov W,#$FF
   XOR RB,W
 EndASM
 
 Pause 25
 
 Goto Main


·As you can see I am a major beginner.. I want to know why this program runs when I'm in Debug and does not in normal mode.

What simple thing am I missing.

·

Comments

  • BeanBean Posts: 8,129
    edited 2006-10-03 00:35
    I see no reason why it shouldn't work.

    What is "normal" mode ?

    Is that with the SX-Key connected ? Or trying to run from a resonator ?

    If from a resonator, try OSCHS2, and/or add BOR42 to the device line.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 01:26
    If I run the Above code with the Key installed on the SX Tech Board the program seems to not run. When I compile in Debug mode and Click the run button, the LED's I have connected to RB.0 and RB.1 Alternate like they should. Do I need different clock settings or something?
  • BeanBean Posts: 8,129
    edited 2006-10-03 01:30
    Try putting a "PAUSE 1" just after "\MOV RB,#1" and before the "Main:" label.
    See if that works. If it does, the problem is the age-old "Read-Modify-Write" issue.
    Or better yet, put the "PAUSE 25" at the front of the loop, just after the "Main:" label.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 01:46
    No it didn't work... This is really odd... This is such a simple program, even I understand it... Ugh!

    If I change to This....

    DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX,BOR42

    FREQ 4_000_000


    It seems to work
  • BeanBean Posts: 8,129
    edited 2006-10-03 01:57
    What is happening when you "it doesn't work" ?
    Do the LEDs say dark ? Are both lit ? What happens ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 02:04
    It is fairly random from what I can tell... If I push the reset button on the SX Tech board they change randomly.
  • BeanBean Posts: 8,129
    edited 2006-10-03 02:25
    Hmm, Somthing's wierd if it does that.
    Have you tried a different SX28 chip ?
    What value resistor do you have on your LEDs ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 02:47
    I tried another Chip and the same result...then it hit me... The Device Screen.. could this cause my problem? What should the setting be? I'm using 220 ohm Resistor BTW.


    I played around with the Device Screen and it didn't change a thing for me.
  • PJMontyPJMonty Posts: 983
    edited 2006-10-03 06:02
    Sailorman,

    You still never mentioned what you are using to run the SX chip when the SX-Key is not attached. You say the program works when you have the OSC4MHZ directive, and not when you have the OSCHS3 directive. This implies that you don't have a clock source running when the key is not attached. The OSC4MHZ directive uses the internal oscillator built into the chip itself.

    Also, are you clear about the difference between programming a chip using "program" (Ctrl-P) versus "debug" (Ctrl-D) ? This is something that trips up a lot of people when they first use the SX chip and the SX-Key.
      Thanks, PeterM
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 11:32
    I have the SX Tech board and I am always keeping the Key attached.
    PJMonty said...
    Also, are you clear about the difference between programming a chip using "program" (Ctrl-P) versus "debug" (Ctrl-D) ? This is something that trips up a lot of people when they first use the SX chip and the SX-Key.
    What should I know... I'm just trying to get this small program to run in any instance.
    WIth or without the Key.
    Anyhelp would be greatly appreciated.
    Eric
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2006-10-03 12:48
    Eric,

    You shouldn't be having such a painful start with the SX. Call us at Parallax and we'll walk you through the setup and programming of an SX. Ask for myself or Chris Savage 916 624 8333. We'll both be there in about an hour.

    Ken Gracey
    Parallax, Inc.
  • BeanBean Posts: 8,129
    edited 2006-10-03 13:41
    Eric,
    I just tried your original program on my SX-Tech board and it seems to work fine.
    I have two LEDs connected to ground, then through 220 ohm resistors to pin RB.0 and RB.1
    When I run the program, they alternate back and forth.

    I just left the SX-Key attached, and did Ctrl-R (RUN).

    Then I increased the pause to 100, just to be sure. It works fine.

    There must be something odd with your setup or something. Hopefully Ken or Chris can get you going.

    Would it be possible to take a picture of your setup ?

    Your not using an SX-Blitz are you ?

    Also I only have the older SX-Key, I don't know if the new design SX-Key would work differently ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.


    Post Edited (Bean (Hitt Consulting)) : 10/3/2006 1:46:59 PM GMT
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2006-10-03 14:35
    Eric,

    Regarding Peter's question - is there a clock source in the project? Did you plug a 4 MHz resonator into the 3-pin socket near the SX chip? If it works with DEBUG, then the SX-Key is generating the clock source. I think the issue lies with the clock.

    Ken Gracey
    Parallax, Inc.
  • SailerManSailerMan Posts: 337
    edited 2006-10-03 21:34
    OMG.... I can't believe I just wasted everyones time... I was looking at the contents of the SX Tech kit... Needless to say I was not aware of a 4MHZ and 50 MHZ Resonator.

    I really appoligize for wasting everyones time.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-10-03 21:35
    SailerMan,

    you might also download the SX FAQ document, and refer to the "The SX-Key "Run" Menu Option" section in this document. You can find the FAQ document for download in the "sticky" post at the beginning of this forum section.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • BeanBean Posts: 8,129
    edited 2006-10-03 21:57
    SailerMan said...
    OMG.... I can't believe I just wasted everyones time... I was looking at the contents of the SX Tech kit... Needless to say I was not aware of a 4MHZ and 50 MHZ Resonator.

    I really appoligize for wasting everyones time.
    Eric,
    · No problem. I guess Ken gets the credit for figuring out this one. Kudos Ken !
    · Don't let this "put you off" from using the SX.

    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
Sign In or Register to comment.