Shop OBEX P1 Docs P2 Docs Learn Events
RESET Problem — Parallax Forums

RESET Problem

CalebjoCalebjo Posts: 15
edited 2008-11-26 01:18 in General Discussion
For some reason this has happened for the first time. The programs in one of my program folders just had issues with the RESET···· Main command. it says "Redefinition of symbol 'RESET'" and "The symbol <Main> is not defined."shocked.gif Does anyone have an idea why it is doing this??? this just happened to half of my programs in one of my folders but every where else it works fine.shakehead.gif

Post Edited By Moderator (Bean (Hitt Consulting)) : 11/20/2008 1:37:34 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2008-11-20 13:35
    If you could post the entire program, we might be able to help.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
    www.iElectronicDesigns.com

    ·
  • CalebjoCalebjo Posts: 15
    edited 2008-11-21 06:33
    Nevermind I retyped all of the programs and for some reason they all work fine now.shocked.gifMust be a·noob mistake or something.·I am now trying to figure out how to turn pins into input; basically just connect them the ground. My programs aren't turning the appropriate pins to gnd so i am all confused. Attached is one of my first programs where I am trying to·find out how to connect the pins to ground. My assembly language "vocabulary" isn't quite expanded so any help is appreciated.wink.gif

    Calebjo
  • PJMontyPJMonty Posts: 983
    edited 2008-11-21 17:04
    Calebjo,

    Making a pin an input and connecting a pin to ground are not the same thing. When a pin is an output, you can set it high or low. When high, it sources the power supply voltage, when low it is connected to ground. If you turn a pin into an input, it goes into Hi-Z mode which means it is floating and not connected to anything.

    Thanks,
    PeterM
  • CalebjoCalebjo Posts: 15
    edited 2008-11-21 17:40
    PeterM,

    Thank you for clarifying that for me. How would you instruct the SX to set that output pin to high or low? What would the progam code be for that?
    Thanks for your consideration,
    Calebjo
  • PJMontyPJMonty Posts: 983
    edited 2008-11-24 20:07
    Calebjo,

    Here is a sample program that sets various pins of Port A as outputs and lets you set them high or low.

    Thanks,
    PeterM


    ifdef __SASM
            DEVICE SX28, turbo, stackx, optionx, OSCHS3 ; Un-comment for SX28 chip
            ;DEVICE SX48, OSCHS3 ; Un-comment for SX48 chip
    else
            DEVICE SX28L,turbo,stackx_optionx
    endif
            FREQ    50_000_000
            RESET   InitSx            ;Set reset/boot address
    
    ifdef __SASM
            LIST Q=37;, Q=64 ; This quiets specfic SASM warnings
            irc_cal IRC_FAST
    endif
    
    ; Control register equates
    DIR        equ    $0f
    
    InitSx
    
    org $0
    
    ; Get SX ready for setting port pin direction
    mode    DIR            ; set input/output states
    
    ; These are samples of setting different pin(s) as outputs
    mov    !ra, #%11111110        ;Set PortA pin 0 as output
    mov    !ra, #%11111101        ;Set PortA pin 1 as output
    mov    !ra, #%11110110        ;Set PortA pins 3 and 0 as output
    jmp @Main
    
    ; Everything above this line only needs to be done once in program
    
    ; Now you can set port pins high or low
    
    org $200
    Main
    
    mov ra, #%11111111        ; Port A, all pins high
    mov ra, #%11111110        ; Port A, pin 0 low
    mov ra, #%11110110        ; Port A, pins 0 and 3 low
    
    jmp Main
    
    
    
  • CalebjoCalebjo Posts: 15
    edited 2008-11-26 01:18
    PeterM,

    Thanks for the sample program and clearing the high and low up for me! Now i can actually connect things to ground instead of turning them to Hi-z state. Thanks again!
    Calebjo
Sign In or Register to comment.