Shop OBEX P1 Docs P2 Docs Learn Events
SX48 proto board and Pull ups — Parallax Forums

SX48 proto board and Pull ups

RS_JimRS_Jim Posts: 1,771
edited 2008-07-22 13:38 in General Discussion
Good Morning,
I am just a little frustrated with my SX-48 Proto board and or my software not sure which.· I am trying to read an 8position dip switch in port e.· The switch is connected to VSS on one side and thru 270 ohm resistors to RE.· Using the following commands to load port and read:
port e latch $00
Port e DDIR· $FF
Port e PLP·· $00

The commands to load are:
_mode· ST
mov w#RE_ST
Mov !RE,W
_mode LVL
mov W,#RE_LVL
mov !RE,W
_mode PLP
mov w,#PLP
mov !RE,w
_mode DDIR
mov w,#DDIR_E
mov !RE,w
_mode latch
mov w,#RE_latch
mov !RE,w

mov __WPARAM12_LSB,DIP_1

I see nothing in W during the transfer when I breakpoint in DEBUG
where am I going wrong?

I also am having a problem with SXSIM in that I cannot keep the Commands desplaying after I load the lst file.
Thanks for the help

Comments

  • BeanBean Posts: 8,129
    edited 2008-07-17 14:07
    Jim,
    In theory you have everything correct. The code snipet you have posted doesn't help at all.

    Try to reduce the program to the least amount of code that still exhibits the problem.
    Then post the entire code so we can try it and see if we can reproduce the issue.

    I have found when doing this, many times I find the problem myself in the process.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com

    ·
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2008-07-19 03:18
    As you step through your program in DEBUG do you see the correct state of PORT E being reflected in the debugger? If not, it may be an indication of a hardware problem rather than software.

    - Sparks
  • RS_JimRS_Jim Posts: 1,771
    edited 2008-07-19 13:09
    Ok, I am beginning to think that the problem is hardware.· I have moved just the port set up code and the input instructions to a test file and compiled it.· Results are the same. Question, on the SX-48 proto board, the lable on the build side of the board that says VSS, is that really VSS? Or do I need to jumper that to ground?
    The test file is attached.
    Thanks
    Jim
  • CapdiamontCapdiamont Posts: 218
    edited 2008-07-19 15:27
    It is ground. No worries there.
  • RS_JimRS_Jim Posts: 1,771
    edited 2008-07-20 14:19
    Good Sunday Morning,
    Using the snipit of code I posted the other day, I run the program fine under SX-Sim. It does as I expect. However, when I run it on a protoboard, I get all 0 all the time on RE. I grabbed a brand new proto board, after implementing strict ESD measures and installed a single 270 ohm resistor from RE 5 to VSS. I would expect to see all 1 except a 0 in RE.5. Where do I go from here?
    Jim
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-20 15:02
    Could you set up a switch this way (see pic) and tell me the results?

    [noparse][[/noparse]Disregard the LED ckt on the side.· And "P1" would be your SX input pin.]

    blackbird.jpg
  • RS_JimRS_Jim Posts: 1,771
    edited 2008-07-20 15:08
    PJ

    I just connected a resister to VDD and I get a 1.· It appears that the PLP is not working on my 2 proto boards.· I have a third that I will try it on and then contact Parallax regarding the problem.

    Thanks everyone for all the help.· I will revisit my design and see if I can use VDD instead of VSS and use the external pullup

    JIM
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-20 16:31
    You should be able to verify the presence/absence of the "weak pull-up" with a voltmeter.

    wk_plp.jpg
  • RS_JimRS_Jim Posts: 1,771
    edited 2008-07-21 13:24
    PJ

    I have done a couple of things this morning with interesting results.· I commeneted out the RD and RE parts of the code and tried running same code on my SX-28.· No Pullup present. Yet when I run the same code on sx-sim I see all 1's on all inputs with nothing connected.· I also used the same code on all ports to set them all to inputs with pullup. No port is responding.· Is the problem the order in which the code is being fed to the mode register?· I would not think so but....

    As far as using external pullup, that increases my parts count far more than I would like!

    I am scratching my head and with little hair that is hazerdous to my scalp!

    Jim
  • RS_JimRS_Jim Posts: 1,771
    edited 2008-07-22 13:38
    jumpin.gif·jumpin.gif
    I found the problem!· The macro that sets the mode failed to have the constant value as part of the macro!
    it read:
    \_mode· Macro·1
    \mov w,\1

    It should have read mov· w,#\1
    Gunther warned about the sleepless nights that failing to declare a value a constant·would cause, well it did!

    Thanks for all the inputs and suggestions, maybe now I can get on with my project.
    Jim
Sign In or Register to comment.