Shop OBEX P1 Docs P2 Docs Learn Events
Newbie needs help! — Parallax Forums

Newbie needs help!

ArchiverArchiver Posts: 46,084
edited 2000-12-13 10:21 in General Discussion
I just set up my BS2 starter kit and everything seemed to be working fine.· I'm just running tests using an LED and resistor to get some of the commands down.· I have the LED set up to pin 2 and a current limiting resistor connected·between·the LED and ground.· I can only get the LED to light up for a little less then a second no matter what I do.· for instance I run the program:

HIGH 2
PAUSE 9999

and it flashes·on then off once quickly.

Then I try the program:

MAIN:
HIGH 2
PAUSE 500
LOW 2
PAUSE 500
GOTO MAIN

and again it flashes on then off once quickly


Ok, I just·tried hooking up 2 LEDs to the circuit one to pin2 and one to pin5· then tried this program:

HIGH 5
PAUSE 500
HIGH 2

here light 2 never lights up, however if I try:

High 5
Pause 300
High 2

Then the second LED will light.

This lead me to believe the program is halting after a specific amount of time as instructions aren't executed after a certain time.· After a little experimenting with the time settings it appears that in the above program if the pause is set to anything above 291 then the following instruction will not execute.· Also in the range of 265-291 the closer I get to 291 the less time the second LED is lit.

Am I doing something wrong or is the board I am using possibly defective.· Any help is appreciated.

-Desperate Soul

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-12-13 10:21
    At 01:41 AM Wednesday 12/13/2000 -0800, you wrote:

    >I just set up my BS2 starter kit and everything seemed to be working
    >fine. I'm just running tests using an LED and resistor to get some of the
    >commands down. I have the LED set up to pin 2 and a current limiting
    >resistor connected between the LED and ground. I can only get the LED to
    >light up for a little less then a second no matter what I do. for
    >instance I run the program:
    >

    Hi Jason -

    These are the COMPLETE Demo programs from the PBASIC Stamp II manual.
    Perhaps you have missed the concept of DIRS and how it effects the
    operation of the I/O pin PORTS. DIRS is a very IMPORTANT concept, and NOT
    one which is easily understood at first read.

    [noparse][[/noparse]' = Remarks ]

    ' LOW Demo Program

    ' This program shows the bitwise state of the DIRS and OUTS variables
    ' before and after the instruction Low 4. You may also connect an LED
    ' to pin P4 as shown in figure I-6 to see it light when the Low instruction
    ' executes.

    Dirs = % 10000 ' Initialize P4 to high <<=====*****======

    debug "Before: ",cr
    debug bin16 ? dirs,bin16 ? outs,cr,cr
    pause 1000
    LOW 4
    debug "After: ",cr
    debug bin16 ? dirs,bin16 ? outs

    ' HIGH Demo Program

    ' This program shows the bitwise state of the DIRS and OUTS variables
    ' before and after the instruction High 4. You may also connect an LED to
    ' pin P4 as shown in figure I-5 to see it light when the High instruction
    ' executes.

    debug "Before: ",cr
    debug bin16 ? dirs,bin16 ? outs,cr,cr
    pause 1000
    HIGH 4
    debug "After: ",cr
    debug bin16 ? dirs,bin16 ? outs

    Hope that gets you started : )

    Regards,

    Bruce Bates
Sign In or Register to comment.