Basic Stamp 1 Symbols (Variables)
microcontrolleruser
Posts: 1,194
in BASIC Stamp
What was that catch about writing to a register?
You have to create a variable first?
I would like to avoid getting stuck in that endless loop again.
Comments
It can be downloaded at:
https://www.parallax.com/product/27218
Publison
Let me look at manual and come up with a specific question.
I think some of the registers you can write to directly with HIGH/LOW type commands
or input/output.
You can write binary b'11111111' to them.That is just an example.
Let me read a little and see.
Good steer! I forgot about going in that way.
Have been going to reference manual pdf or paper.
Lots of interesting stuff.Scratchpad ram. I can relate to that.
Can start out with Stamp 1. I think it writes to scratch ram.
Now that would be I/O
I think PIN is just an extra to write to a certain pin.
That should be writing to a register or two to have the pin be input/output and high/low.
Let me see if there are general purpose registers.I think there are.
Maybe that was the catch. They can only be written to by variables.
It does say there is scratch ram.
That is on chip data memory.
The BS1 does not have Scratchpad RAM nor does the BS2. Only the BS2e, BS2sx, BS2p, BS2pe, and BS2px have it.
Refer to page 92 of the BASIC Stamp Manual because it says that ScratchPad RAM uses the GET and PUT commands.
https://www.parallax.com/sites/default/files/downloads/27218-Web-BASICStampManual-v2.2.pdf
The BS1 is very limited and most of the Parallax texts were written for the BS2 and What's a Microcontroller was written so that even teenagers can learn how to program and use the BS2.
https://www.parallax.com/sites/default/files/downloads/28123-Whats-a-Micro-v3.0.pdf
Edit:You caught me! Have not had time to work on it yet!
That's okay. It does not look like something I want to start with anyhow.Stamp 1 it is.End Edit.
This reminds me to say 'one thing at a time/then explain it' when I write.
'The purpose of the PIN directive is to give an alias to an I/O pin and let the compiler determine whether a given line of code requires a numeric value for the pin, the output bit for that pin, or the input bit for that pin'
That is from PINS directive.
What? Could they repeat that in English please?
There are W0 to W5 General Purpose registers.
You can name them with a variable.
Next is finding out how to load a value to a variable.
Goal is to see if if value show up in Memory Map or you can use a Debug statement.
Think there was a thing about Memory Map shows you what 'Program says is in there' not what is really in there.
Some statements require a number corresponding to the I/O pin number (like 0-7). Other statements require a bit mask with a single 1 bit corresponding to the I/O pin. This made it difficult for people to document I/O pin usage in that they needed two symbols, one for the pin number and another for a bit mask. Thus, Parallax created the useful kludge of the PIN directive which allows the use of a single symbol for an I/O pin and lets the compiler figure out which form the statement requires.
Thank you very much for the insight that they headed in one direction and
then another.
I was wondering about that.
Okay.I will keep an eye out for that.
SIDE NOTE Found one of my dev boards supports 16F54 (what a Basic Stamp is underneath) so that sub project will move along!
You can declare aliases to these predefined variables. You can't create any other variables. There are also predefined names for the individual bytes of each word and for the bits of PORT and W0.
Predefined. That's today's word. 'Now go ahead. You say it.' It's a nice day in Mr. Parallax's World.
I am side stepping I/O commands right now.
Did see GET and PUT for Ubicom based Stamps.
What about Memory Map actually being what's in there?
This is a map of the EEPROM; code builds from the bottom working up, user data is stored at the top. In the BS1, location 255 in the EEPROM is the size of the program.
Back in the DOS days of the BS1, there was an EEPROM command in the language that would cause the binary data that would written to the EEPROM to be saved in a file. I used this data to create my own DOS-based map (written in Turbo Pascal to mimic the DOS DEBUG memory dump output). Parallax took this and made it far more useful. Mind you, my project was back in 1994. I wanted the map so that I could experiment with different coding styles to see the effect on EEPROM use. Originally, the only thing the DOS editor had was a low-resolution progress bar.
I've never used a BS1 so I am not very familiar with it but remember that it uses PBASIC 1.0 which is different than the PBASIC 2.5 that the BS2 uses.
The BS1 uses a system variable called PINS to change the output value of each I/O pin. The BS2 equivalent is OUTS.
PBASIC 2.5 has a PIN "directive" which allows you to assign an I/O pin to a variable.
Don't get the 2 mixed up which is why I keep saying just use the BS2 because What's a Microcontroller explains much of this.
Mike, Jon,
Is there a What's a Microcontroller or something similar for the BS1?
BTW Jon, welcome back to the Forum.
I think the way to go for the Stamp 1 is the Nuts and Volts articles in the archives here.
I saw a Stamp 1 starter kit on Ebay with a book. Don't remember the title of it.
It might still be there for reference. Might just be early version of What's...
I still write a lot of BS1 code, especially this time of year as the EFX-TEK Prop-1 (BS1-based, not Propeller-based) is a very popular controller for Halloween and Christmas decorators. People usually start with this kit:
-- http://www.efx-tek.com/topics/prop-1_starter.html
These get a lot of use in simple props and small-scale industrial devices (e.g., a paint skimmer in a metal works in NC). One customer (entertainment venue) put 80 of them in a box to twinkle faux candles on a big Christmas tree. They use the Prop-1 for small props and displays in other areas of the venue.
PBASIC 1 is very small and not very fast, but for small projects it it can be quite useful. I know a lot of tricks since I started programming the BS1 in early 1994. I recently compressed a substantial BS2 program into the BS1 that my customer just couldn't muster. When he asked if I could do it, I replied, "Yes, but you won't be able to understand the code." It took a few hours (that's a LONG time for a BS1 program) but I did make it work. My customer called me with a chuckle. The only thing he could understand was the part he needed to understand: the lock/unlock sequence (this was for an escape room puzzle). Here's the cool bit: He buys the Prop-1 controller from us for about $40, adds some reed switches, LED faux candles, a mag lock, and a small box, and sells it to his customers for $700. It's a nice profit and powered by the original Parallax microcontroller.
Jonny
Who's website changed? Parallax or Nuts and Volts?
Edit Good!
Parallax BS1 and BS2 and SX App Notes still there on Parallax!
So are Nuts and Volts articles.
You almost gave me a heart attack!
Wow! Nuts and Volts cleaned out their old Stamp articles. That's kind of ungrateful to people who put them on the map!
Have to think about that.
.
I have copies of N&V volumes 1 through 8 if that would help.
https://www.parallax.com/search?search_api_views_fulltext=Nuts+and+Volts