Shop OBEX P1 Docs P2 Docs Learn Events
problem with basic stamp 2p — Parallax Forums

problem with basic stamp 2p

demakidemaki Posts: 3
edited 2007-05-07 02:06 in BASIC Stamp
I have been having lots of success with the basic stamp 2, but needed to get the 2p version as to utilized the IC2 interface. Unfortunately, I can`t get the 2p to work. It is downloading the firmware all right, and I can even run the debug functions, increment a variables, ect. The problem is when I try and utilize ANY of the input output pins. I can`t even blink an LED!! To dispense with the most trivial of problems, YES I am putting the basic stamp 2p header in the file instead of the basic stamp 2 header. I can take the same program,·tokinize it on the basic stamp 2, and it runs fine - but when I tokinize it onto the 2p (changing the header and the .bs2p extension), the program doesn`t take inputs/output from the pins!! Do I need to manually configure the TRIS register?? I think not. The basic stamp compiler is supposed to do that for you. I don`t know what to do... as I have tried everything. Is it possible that the chip is defective??

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-05-06 13:24
    demaki -

    BOTH of the following PBASIC compiler directives should be at the beginning of your program:

    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}

    Do you have them BOTH there?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-06 14:52
    The BS2p is a faster processor than the BS2 and many of the time-dependent statements (like PULSIN/OUT, SERIN/OUT, RCTIME, etc.) require different timing parameters. There's a table in the PBasic manual under each such statement that gives the timing granularity involved.

    That doesn't explain the lack of function you describe since most things will still work, just with incorrect timing (SERIN/OUT will have the wrong Baud). It would help if you would explain your setup and post a program you've tried.

    If you can run some things, it's unlikely that the chip is defective. Sometimes a user will burn out a single I/O pin, but not all of them. I've had a project where I switched out a BS2 for a BS2p, just changed two constants and the chip identification directive, recompiled and downloaded and it worked fine, so things should work that easily.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-06 17:02
    Hello,

    If you’re using the Professional Development Board please note that the I/O pins don’t line up the same as they do on a BS2. Only half the I/O pins will appear on the P0-P15 socket and the remainder will be on the SX-I/O header. The P8 through P15 will actually be AUX P8 through P15. Please see the PDB Manual for complete details. Otherwise we would need to know which board you’re using as well the code that doesn’t work. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • skylightskylight Posts: 1,915
    edited 2007-05-06 17:37
    Chris, please could you clarify what you are saying above as i am a bit confused, I can see what you are saying about the aux I/O header connections in the PDB pdf yet i am using the X15 connector using the pins out for P15 through P8 without problems.

    Are you saying they·are also paralleled in the SX header or that they should be only on the aux header? Are you referring to an earlier version of the PDB?

    regards
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-06 17:39
    Don’t know how but I’d have sworn I saw BS2p40…Is this a 24-pin module? If so, please disregard my message. Somehow I thought you had a P40.· I still recommend posting a piece of code that won't work and the associated connections you're using for that code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • demakidemaki Posts: 3
    edited 2007-05-07 02:06
    Craziness... just as soon as I posted this, I tried once more... and this time I got the LED blinking function to work. I haven`t had time yet to test some of the other functions yet, but I will do that. The pulsin/pulsout advice was good. This will be helpfull to know. I am not sure why it wasn`t working before, as I didnt change anything. At least I know it`s not a chip problem now.·I am using a 24p. My goal is to·get the I2c communication to work with a 3 axis accelerometer called the LIS3LV02DQ (on a breakout board from sparkfun electronics). If I have any problems with that, I will post the code, and a link to the data sheet for the device that I am trying to communicate with. Thanks. This forum seems very eager to help!!
Sign In or Register to comment.