Shop OBEX P1 Docs P2 Docs Learn Events
Confused? Program doesn't work!! — Parallax Forums

Confused? Program doesn't work!!

SpragmaticSpragmatic Posts: 59
edited 2010-03-18 21:45 in General Discussion
I've built a test circuit and program on the Professional·Development Board that works perfect.· I then built the circuit on protoboard while using a SX28 protoboard in conjunction.· When I program the SX28 with the SX-KEY USB it goes crazy.· I/O pins going on and off like a X-Mas tree.· The (2) pushbuttons in the circuit do not respond.· When programed in debug it does same thing and it 's to much for me to troubleshoot.· I'm using the same code and layout as the development board, so I'm confused why it doesn't work on the SX28.· Is there a problem with the new SX-Key editor and the SX28 board?· I've tried it on (2) brand new SX28 boards I've had sitting here waiting for a project.· HELP!!·· Thanks!!

······························· Greg


······· Here's the code--

Comments

  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-03-18 16:01
    Hello Greg,

    Can you tell us a bit more about your circuit? What are you using as the clock source? Are you using a resonator, crystal, or 4-pin oscillator? When using the USB key do you have the external clock sources removed? If not that will cause problems.

    To troubleshoot why not load a simple program in the chip that just toggles an I/O line every couple seconds that you can watch. Use that the make sure the hardware is working then move on to your program.

    Robert
  • SpragmaticSpragmatic Posts: 59
    edited 2010-03-18 20:22
    I'm using the internal 4MHZ clock in the chip. I've tried running the program with and without USB key attached. No difference. I did run a simple led on/off circuit to test SX28 board and it programs and runs fine. At that point I removed all components and wires from SX28 board and loaded the initial program and tested with my FLUKE multimeter. It's doing the same thing. I think it's a program problem? What I don't get is that it works perfect on the Professional Development Board. I haven't changed anything in the code between the 2 boards. I've read the chip in the development board and it matched the set-up for the chip on the protoboard. I'm baffled!! Thanks!!

    Greg
  • SpragmaticSpragmatic Posts: 59
    edited 2010-03-18 20:52
    I'm DUMB! I found that I didn't have the pull-ups on my switches. DUH! Works like a charm!!
  • JonnyMacJonnyMac Posts: 9,211
    edited 2010-03-18 21:45
    Good news. That said, you still may want to debounce your inputs so that spurious noise doesn't cause a false start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
Sign In or Register to comment.