Ds1620
Jon Williams
Posts: 6,491
This will get released as part of an archive so you can run it, but I'm posting it here so that BASIC Stamp users familiar with the DS1620 can get an idea how Spin works.
A funny thing happened today... a Nuts & Volts reader send me a note claiming that the Propeller was an elaborate April Fool's Day joke.· Yeah, like we'd go through THAT much trouble for a prank.· The funniest part of the whole deal was that the domain used by the reader had "robots" in it and yet when I visited the site there was nothing but pictures of donkeys.· Who's fooling with whom?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
A funny thing happened today... a Nuts & Volts reader send me a note claiming that the Propeller was an elaborate April Fool's Day joke.· Yeah, like we'd go through THAT much trouble for a prank.· The funniest part of the whole deal was that the domain used by the reader had "robots" in it and yet when I visited the site there was nothing but pictures of donkeys.· Who's fooling with whom?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Comments
..Clear, easy to read, and no "fat" in the code.
...It shows encapulation, which has a number of benifits:
..#1 For the beginner who is trying to learn uMicro programming, it hides the "details" and lets then work on getting the "code" working.
..#2 It lets the programmer determin "how deep" they are going to go into the program they are writing.
..#3 It gives the expierenced programmer the examples needed to expand on the code.
..#4 It provides for recycled code.
I hope you and the other Propeller gods are planning on doing exactly what you did for this device for other devices Parallax sells.
... looking foward to reading and seeing more code...
If you moved the CON and VAR statments into the OBJ block, would that make all the CON's and VAR's private to that object, making the entire object private, excluding the pub routines ?
What I'm seeing here is if this object is loaded with another object in the same window, then the CON's and VAR's would be intermixed.· Is that right?· Or, does the IDE provide the encapulsation between the objects?
Lastly, is there an object explorer within the ide?· For example, I load the BS2 Object lib.· Can I explore the various functions / procedures within that object without knowing first hand what they are?· (I envision something like VB's editor, where you type the object, when you hit the "." you get a list of valid objects you can work with.)·
.... Man, I can't wait to get my hands on the IDE, chip & dev board and some goodies! ...
BTW: Thanks...
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
Post Edited (Kaos Kidd) : 3/29/2006 2:20:57 PM GMT
Object variables (even global)·are always private to that object.· Constants can, however, be accessed and used by a top-level object that uses a lower-level object.· That is demonstrated in this line of code:
··lcd.putc(lcd#LCD_LINE0 + 9)
The format is:
· objectName#CONSTANT_NAME
In this case the lcd object·has a lot of useful constants that can be accessed by any object using lcd.
The Propeller Tool has some neat tricks that make exploring a project nice.· One is the Object View of the current project -- it shows the objects used and their hierarchy.· Here's the object view from my DS1620 demo:
Of note is that the timing object is used three times in the project.· There's no worry about code-bloat, though, the compiler has an element called the "object distiller" so that that there is only one set of code for any Spin object in memory.
Another nice feature is the Summary View of the editor pane:
And finally, if the programmer has added appropriate documentation comments, the Documentation View in the editor pane will probably look something like this:
Pretty neat, huh?· And on a chip that runs twice as fast as the BS2px -- with seven engines (cogs) to spare!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 3/29/2006 3:45:17 PM GMT
... and how I used elements to create a timing diagram in my ShiftIO object:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 3/29/2006 4:56:25 PM GMT
I didn't see this answer jump out me in Jon's post, but at this point typing in an object name and "." will not provide in text help as to the methods and such within it.· I've asked for it, though even allowing the Explorer window to be expanded out to see the methods within it.
A·nice feature·that does help·is the spilt screen, so you can have the method object showing documentation view in one section (or computer screen) and the code you are working on in another.
I'm sure once everything is done and released, they'll be able to take a breather and start on enhancing the software based on demand and benefits.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
Southern Illinois University Carbondale - Electronic Systems Technologies
Personal Links with plenty of BASIC Stamp info
StampPlot - Graphical Data Acquisition and Control
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Real nice...
Sweet answers to some of the toughest questions:How to make a tool that works for most everyone...
And thanks for the answers...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
Another shortcut I like very much is CTRL-rightArrow or leftArrow, which moves you rapidly from one tab to the next. (Jeff promised to add that to the Stamp IDE -hint hint) Shortcut CTRL-T always takes you right to your top object file.
Of course there are bookmarks, similar to the Stamp IDE, with up to 10 per tab. The IDE remembers those bookmarks for the last 10 files that you use. You can also toggle line numbers on and off with CTRL-N. The list of navigation and editing shortcuts that we get out of the starting gate goes on and on!
Jon, great job on the DS1620. I hadn't received my printed copy of April N&V yet, so I finally wnt online to activate the online version. They don't make it easy to find how to do that. Great cover article. Six more years assured, acting as the lead helicopter pilot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Honestly, I may actually be one of the guys precariously dangling from the helicopter skid, but I'm up for it. To be candid, the last week things have really become fun for me; Spin is sinking in a feeling more natural, and when I ran my DS1620 program yesterday it actually worked on the first try. That made me smile, big time. Now it's a matter of going through and refining so that it's as elegant as I can make it (my code, that is).
After some obligatory office paperwork I'm going to make a DS1620HR object for 0.05c resolution -- thanks to tricks I learned from you, Tracy!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I am getting a temperature somewhat offset with my DS1620. It gives me 25C, however other mercury and digital thermometers around say 22C. Do any of you have similar findings? Please send me a private message and carbon copy it on the board.
Thanks.
About your question... I have gotten very accurate readings from my DS1620. Could the reading be a little higher due to heat produced by the chip itself, or other nearby components (voltage regulators can put out quite a bit of heat)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian Meade
"They who dream by day are cognizant of many things which escape those who dream only by night" - Edgar Poe
When you write :
Is it realy 0.05°C resolution or is that a mistake ?
I find a DS1620HR in the Maxim site but it look to not existing ?
dro.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
in medio virtus
Jon is around, being an actor, he would wrap himself in new roles, new names.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thanks for your reply.
>Could the reading be a little higher due to heat produced by the chip itself, or other nearby components (voltage regulators can put out quite a bit of heat)
The DS1620 is very far from everything besides the DIP40 Propeller, where it is 0.3" away. When I touch the propeller with a finger, I don't detect any warmth from it. I have the propeller reading the temperature once every 2 seconds. I suppose internal heat could be the cause. I'll try putting a little fan on top of the DS1620 and see if it changes anything.
So Brian, how did you mount the chip? Are you using the PDIP package DS1620?
I have used a 8 pin DIP, I just had it plugged into a solderless breadboard. The breadboard is a good 3 inches from the PCB that the Propeller and related circuitry was located.
Could there be minor variations in manufacturing for the DS1620? If you had 2 otherwise identical DS1620's next to each other, would they give the same temperature measurement. I would say repeatability of measurements is more important. If it reads 2 degrees different than a mercury thermometer, that ok, as long as it's always 2 degrees different.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian Meade
"They who dream by day are cognizant of many things which escape those who dream only by night" - Edgar Poe