Shop OBEX P1 Docs P2 Docs Learn Events
Discussion of Stamp I/O Registers - Page 3 — Parallax Forums

Discussion of Stamp I/O Registers

13»

Comments

  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-18 01:55
    Publison

    The chip is the point.

    Doesn't matter what programmer he used at the time.

    Basic stamps are custom ordered PIC '57's or '58's.

    So you get a '58 and program it in Assembler or C.

    I would figure it can be programmed with a PICkit 2 or 3.

    There! That ought to work.

    Thanks!
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-18 02:15
    Developers

    From John Loomis Stamp article.

    Chip -- The PBASIC interpreter chips may be purchased separately and integrated directly into production products. Additionally, the BASIC Stamp I editor now includes the ability to program a PIC16C58 with your PBASIC code!

    There!

    Can program PIC 16C58 three ways. PBASIC, C and Assembler.

    This is going to be big fun!

    https://www.arrow.com/en/products/pic16c56-xtp/microchip-technology

    Thanks!
  • I don't know who John Loomis is, but his website is way out of date, and his links are 404 stale. There's nothing there worth considering that I can see.

    -Phil
  • Phil

    That's how Parallax got started.

    Custom ordered PIC's. They also made PIC products.

    John Loomis and PH Anderson were big time Stamp 1 era microcontroller boosters

    when most people didn't know and didn't care what a microcontroller was.

    Programming a pin compatible or number of pins compatible PIC to swap out into socket with Stamp

    sounds like fun to me.

    Thanks!



  • Developers

    The thing a bout a stamp is that it bootloads AND it has it's own programming language

    to send hex to the processor.

    It's own bootloader maybe requires it's own language.Don't know.

    Thanks!
  • Developers

    Anybody know PIC part number for Stamp 1 and Stamp2?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Depends on the specific part used, but you can find more information here: https://www.parallax.com/catalog/microcontrollers/basic-stamp/oem
  • Chris

    No. I mean PIC chip.

    What kinds of PIC chips are used in the BASIC Stamp?
    The BASIC Stamp I uses a PIC16C56 and the BASIC Stamp II uses a PIC16C57.'

    http://www.johnloomis.org/ece445/stamp/stamp_faqs.pdf

    Is this correct?

    Thanks!
  • Chris

    No. I mean PIC chip.

    What kinds of PIC chips are used in the BASIC Stamp?
    The BASIC Stamp I uses a PIC16C56 and the BASIC Stamp II uses a PIC16C57.'

    http://www.johnloomis.org/ece445/stamp/stamp_faqs.pdf

    Is this correct?

    Thanks!

    I don't think it really matters now since the programmers are long gone.

    Maybe you can find you on ebay, but you will not find one here.



  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-19 23:57
    Publison

    What do you mean by programmers?

    Don't you just program it with a PICkit2 or 3?

    Won't find any here?

    This is a forum. Didn't know they sold anything.

    Edit:

    Thanks!
  • Publison

    What do you mean by programmers?

    Don't you just program it with a PICkit2 or 3?

    Won't find any here?

    This is a forum. Didn't know they sold anything.

    Thanks!

    The BS1 and BS2 chips that are sold by Parallax are already programmed. They can not be re-programmed. Parallax does not sell any PIC devices that be programmed. They do not sell any programmers that can program PIC devices.

    You will have to look elsewhere.



  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-20 00:40
    Publison

    Okay. Will do.

    Just noticed it says Parallax forum NOT Stamp and Propellor forum.:)

    Got it.

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Chris No. I mean PIC chip.

    What kinds of PIC chips are used in the BASIC Stamp?
    The BASIC Stamp I uses a PIC16C56 and the BASIC Stamp II uses a PIC16C57.'

    http://www.johnloomis.org/ece445/stamp/stamp_faqs.pdf

    Is this correct?

    Thanks!

    The page I sent you to would have answered that question as the parts are clearly marked. However though-hole and SMD versions have slightly different part numbers to differentiate. You cannot replace a BASIC Stamp Interpreter with the raw PIC part as it comes pre-programmed with firmware from us.
  • Chris

    Which one is it closest too please?

    I think I'm in the ballpark with the 16C's.

    Cause that would have been a big plus then if

    Stamp had a no-mess no-fuss bootloader invisible to user.

    I want to bounce back and forth between Stamp and PIC to help

    figure this thing out.

    Thanks!
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-29 00:38
    Developers

    Okay. Back to PINS and DIRS.

    PINS and DIRS are Labels for memory location bytes in PORTS.

    LOW and HIGH are commands.

    INPUT and OUTPUT are commands.

    'Writing to PINS will store a high or low value on the respective I/O pins (though only on pins that are set to outputs).'

    This sentence can mislead you.

    One way of writing to DIRS and PINS is done with LOW and HIGH one bit(PIN) at a time.

    You can read DIRS and PINS whole byte.

    We will keep looking to see how to write the whole byte.

    INS and OUTS are latches. That's another subject.

    Have a nice day!
  • ElectrodudeElectrodude Posts: 1,614
    edited 2017-01-28 21:51
    You can write the whole DIRS and PINS bytes. But you usually don't want to do that (except maybe at startup), since it will set the direction or value of every pin.

    You might want to write all of DIRS and PINS at startup as a quick way to specify all at once which pins should be outputs and what their initial values should be. If you do this, you should set PINS before setting DIRS, so that outputs don't go low for an instant by having their bits set by DIRS before going high from setting PINS.

  • Electrodude

    Duly noted.

    Will look through Basic Stamp Help and Stamp Syntax & Reference Manual

    for that.


  • Developers

    Progress:

    Memory Map shows PORTS word occupied.

    Says 'PINS'.

    DEBUG PORTS returns a number.

    Will attempt DEBUG with a binary formatter and see if that

    is 0's and 1's.

    Check if binary number reflects PORTS as set by HIGH LOW INPUT and OUTPUT.

    Two bytes of PORTS, PINS and DIRS should be 0's when powering up Stamp 1.

    Have a nice day!
  • Developers

    Progress:

    Memory Map shows PORTS word occupied.

    Says 'PINS'.

    DEBUG PORTS returns a number.

    Will attempt DEBUG with a binary formatter and see if that

    is 0's and 1's.

    Check if binary number reflects PORTS as set by HIGH LOW INPUT and OUTPUT.

    Two bytes of PORTS, PINS and DIRS should be 0's when powering up Stamp 1.

    Have a nice day!

    Do you have a question?



  • Publison

    Sure.

    Is that going to work?

    DEBUG PINS or DIRS and show what's in the registers?

    Looking for 0's and 1's.

    I'm not the only person that has gone round and round

    with this.

    See the section in Basic Stamp Manual.

    It makes things clear as mud.

    Have a nice day!
  • PublisonPublison Posts: 12,366
    edited 2017-01-30 18:25
    Publison

    Sure.

    Is that going to work?

    DEBUG PINS or DIRS and show what's in the registers?

    Looking for 0's and 1's.

    I'm not the only person that has gone round and round

    with this.

    See the section in Basic Stamp Manual.

    It makes things clear as mud.

    Have a nice day!

    Can you post the program that you expect to work? That would make it easier to debug it.

    The BS1 has been out since 1992. Thousands of people have been able to go through the manual. The Basic Stamp Manual is solid and explains everything.

    Please explain in detail what you can't comprehend.


  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-30 19:58
    Publison

    I can't comprehend why the documentation for I/O registers is

    scattered all over the place.

    Just now I found DIRSH and OUTH in a WAM experiment.

    I am looking into I/O registers on Stamps.

    I can change the title of post to Stamp not Stamp 1 or 2.

    I wanted to keep it simple but Stamp2 has improvements for I/O

    that are hard to ignore.

    Will fall back to Stamp 1 to learn other commands READ WRITE etc.

    Have a nice day!
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-01-30 20:16
    Publison

    It starts here. Page 81.

    'The second byte of PORT, DIRS, controls the direction of the I/O pins.
    Each bit within DIRS corresponds to an I/O pin's direction. A high bit (1)'

    It seems to go over and over the same thing without any insights to using

    other commands or tips for 'further studies'.

    It's not making the subject clear.

    Have a nice day!

  • Pulison

    This is from Stamp Help.

    'When the BS1 is powered up, or reset, all memory locations are cleared to 0, so all pins are inputs (DIRS = %00000000). Also, if the PBASIC program sets all the I/O pins to outputs (DIRS = %11111111), then they will initially output low, since the output latch (PINS) is cleared to all zeros upon power-up or reset, as well.

    There's two problems with it.

    ' Also, if the PBASIC program sets all the I/O pins to outputs (DIRS = %11111111),'

    Funny way of saying writing to PINS.

    'since the output latch (PINS) is cleared to all zeros upon power-up or reset, as well.'

    What?! He introduces new idea 'output latch' and doesn't go into any depth on it.

    I guess that's the problem. Lack of depth in these articles.

    Everything is covered I suppose but they lack any pointers about using the new info.

    For that you have to go track it down yourself in experiments and other documentation.

    A lot of jumping around.

    Have a nice day!



  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-03-13 01:08
    OUTPUT.

    Ran across this and it's another piece in the Basic Stamp

    pin I/O puzzle.

    Will paste in part that I'm scrutinizing right now.

  • I think I got it this time.

    There are a truckload of problems with this 'Explanation'.

    'Explanation
    There are several ways to make a pin an output. Commands that rely on
    output pins, like PULSOUT and SEROUT, automatically change the
    specified pin to output. Writing 1s to particular bits of the variable DIRS
    makes the corresponding pins outputs. And then there’s the OUTPUT
    command.
    When a pin is an output, your program can change its state by writing to
    the corresponding bit in the OUTS variable (PINS on the BS1). For
    example:
    OUTPUT 4
    OUT4 = 1
    When your program changes a pin from input to output, whatever state
    happens to be in the corresponding bit of OUTS (PINS on the BS1) sets the
    initial state of the pin. To simultaneously make a pin an output and set its
    state use the HIGH and LOW commands

    Will get to that next.

  • You can throw out the first paragraph and use first sentence of last paragraph.

    So we end up with:

    'When a pin is an output, your program can change its state by writing to
    the corresponding bit in the OUTS variable (PINS on the BS1). For
    example:
    OUTPUT 4
    OUT4 = 1'

    Then we need to correct 'When a pin is an output, your program can change its state'

    to 'To make a pin an output write to the corresponding bit in OUTS variable.'

    'For example' could have been 'This is how you write to OUTS variable.

    'OUT (pin number) = (0,1).

    Pheww!



  • PINS variable is bit addressable.

    Here's a sample program.

    ' {$STAMP BS1}
    ' {$PBASIC 1.0}

    DIR0 = 1

    PIN0 = 1

    DEBUG PIN0

    DIR0 = 1

    PIN0 = 0

    DEBUG PIN0
Sign In or Register to comment.