Shop OBEX P1 Docs P2 Docs Learn Events
Simple Assembly Question — Parallax Forums

Simple Assembly Question

ElectronegativityElectronegativity Posts: 311
edited 2006-04-24 17:51 in General Discussion
When I run this code in SXSIM it sets register A to output and moves #%01010101 to that port.

When I run the same code on the SX52 proto board it doesn't work and register A remains set to all zeros.

What am I missing?

Device SX52, OSC4MHZ
IRC_CAL IRC_FAST
FREQ 4_000_000
reset Start

org $100
Start
mode $F
mov !ra, #%00000000
mov ra, #%01010101

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I wonder if this wire is hot...

Comments

  • ElectronegativityElectronegativity Posts: 311
    edited 2006-04-23 18:28
    Never mind, I shut everything off, unplugged it, plugged it back in, and now it works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • BeanBean Posts: 8,129
    edited 2006-04-23 19:49
    To set the mode register on the SX48/52 you should use:

    MOV W,#$1F ' For the SX48/82 Write_TRIS is $1F NOT $0F
    MOV M,W
    MOV !ra,#%00000000
    MOV ra,#%01010101

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    "SX-Video OSD module"·available·for only·$49.95·www.sxvm.com
    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-04-24 17:51
    Thanks Bean, that helps a lot.

    It was doing all kinds of odd things.

    This is my first foray into SX48/52, and I guess I should read the datasheet instead of treating it like a bigger SX28.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
Sign In or Register to comment.