Problems starting off with SX

CampeckCampeck Posts: 111
edited 2010-10-27 - 08:27:21 in Microcontrollers
I am going through the very first program in the Gunther Programming the SX microcontroller and am already hitting problems.

First. I can program with the crystal in place on the board. But If I want to debug I take it out correct?

Secondly. The program that he has you write has the OSCHS2 directive and then all of a sudden later when it shows pictures of the debug terminal its changed to OPTIONX
Well which one do I use?
He also puts the device as SX28L...whats the L for?

And then to top it off the program that I wrote all ways that he shows won't debug.

LIST Q = 37
DEVICE SX28, TURBO, STACKX, OPTIONX
IRC_CAL IRC_4MHZ
FREQ 50_000_000
RESET 0

mov !rb, #%11111110
Loop
clrb rb.0
setb rb.0
jmp Loop

When I click "Step" It goes IDLE and stops working...

And half the time when I press program it says the SX isn't there...

Comments

  • CampeckCampeck Posts: 111
    edited 2010-10-26 - 17:21:28
    Ok so I got this one to work...

    LIST Q = 37
    DEVICE SX28L, TURBO, STACKX, OPTIONX, OSC1MHZ
    IRC_CAL IRC_FAST
    FREQ 50_000_000
    RESET 0

    mov !rb, #%11111110
    Loop
    clrb rb.0
    setb rb.0
    jmp Loop


    Only problem is sometimes While letting the DEBUG "walk" it jumps out of the program loop and starts jumping around addresses and doing all sorts of crazy stuff.
  • CampeckCampeck Posts: 111
    edited 2010-10-27 - 06:50:08
    Ok well I have already found some answers through the FAQ. I guess I will figure everything out. This forum sure is empty though. lol
  • RobotWorkshopRobotWorkshop Posts: 2,300
    edited 2010-10-27 - 08:27:21
    The forum isn't as active as it once was but there people that use it and as willing to help out.....

    In order for us to help you're going to need to provide a few more details on what you are doing and how everything is connected. Some of the information that is useful:

    - Are you using one of the SX protoboard, regular SX Tech board, or is this wired up on a breadboard?

    - What are you using as a clock source? (Internal RC, external resonator, or crystal OSC)

    - What are you using to program the SX? (Serial SX Key, USB SX Key, or SX Blitz)

    The SX Blitz can only be used for programming while the SX Key's can be used for programming AND debugging.

    For programming you can leave a resonator in place but if you are using a crystal OSC then it MUST be removed.

    When debugging with the SX Key you should have any external clock sources removed since the SX Key will provide the clocking.

    A full copy of your program code and a description of how everything is wired will help.

    Another way to start is use SX/B and some of the complete example programs in the SX/B help file. They have full schematics and code that you can use as an example and then you can build from there.

    Robert
Sign In or Register to comment.