Noob 1st Project with Prop
Ken Gracey
Posts: 7,390
Hey there,
Programming the Propeller for the first time has been some kind of therapy session for me. As you know, I'm really·in business at Parallax. I could easily spend more than 110% of my time in issues related to inventory, marketing, manufacturing, etc.·It wasn't until Thursday that I actually had time to start in with the Propeller in earnest.·What·I initially thought·would be a big hurdle went really well. Of course it doesn't hurt that I have access to Beau, Andy, Chip and Jeff as needed, of course.·
First, the project.·I know·it could be done on the·weakest 8051. But for me, this little step with the Prop was·a breakthrough!·I simply wanted a temperature display for my home office.·My office/shop is a·400 sf room with radiant heat system and a spring thermostat. The spring thermostat·doesn't show the correct temperature,·but it's consistent in it's error. It's set at 50F but·this setting holds the temp at about 70F in the office. All I wanted was to see the temperature. . . nothing else.
No video output, no keyboards or mice - just a little·project that suits my needs. I only wanted to break the barrier of Propeller OOP (or whatever the agreed-upon term has become in other threads), parameter passing, getting the result,·using/creating an object (the dual-seven segment displays), and debugging with Parallax Serial Terminal.
Because I'm so excited about my next project I didn't bother·with comments and documentation in my Spin code, though·there's really nothing to comment since it was so simple. The most difficult part was·soldering the dual seven-segment displays anyway. Aside·from that, the only problem I encountered was that I first put the DS1620 on P30-31, which initially prevented·me from using Parallax Serial Terminal.·Once I got the DS1620 moved around·everything came together.
I can't wait to get started on my next project. I'll take advantage of multi-processing, global RAM, and·objects from OBEX.parallax.com.·I'll do my best to read the resources before asking questions in this forum.
Ken Gracey
Parallax, Inc.
Programming the Propeller for the first time has been some kind of therapy session for me. As you know, I'm really·in business at Parallax. I could easily spend more than 110% of my time in issues related to inventory, marketing, manufacturing, etc.·It wasn't until Thursday that I actually had time to start in with the Propeller in earnest.·What·I initially thought·would be a big hurdle went really well. Of course it doesn't hurt that I have access to Beau, Andy, Chip and Jeff as needed, of course.·
First, the project.·I know·it could be done on the·weakest 8051. But for me, this little step with the Prop was·a breakthrough!·I simply wanted a temperature display for my home office.·My office/shop is a·400 sf room with radiant heat system and a spring thermostat. The spring thermostat·doesn't show the correct temperature,·but it's consistent in it's error. It's set at 50F but·this setting holds the temp at about 70F in the office. All I wanted was to see the temperature. . . nothing else.
No video output, no keyboards or mice - just a little·project that suits my needs. I only wanted to break the barrier of Propeller OOP (or whatever the agreed-upon term has become in other threads), parameter passing, getting the result,·using/creating an object (the dual-seven segment displays), and debugging with Parallax Serial Terminal.
Because I'm so excited about my next project I didn't bother·with comments and documentation in my Spin code, though·there's really nothing to comment since it was so simple. The most difficult part was·soldering the dual seven-segment displays anyway. Aside·from that, the only problem I encountered was that I first put the DS1620 on P30-31, which initially prevented·me from using Parallax Serial Terminal.·Once I got the DS1620 moved around·everything came together.
I can't wait to get started on my next project. I'll take advantage of multi-processing, global RAM, and·objects from OBEX.parallax.com.·I'll do my best to read the resources before asking questions in this forum.
Ken Gracey
Parallax, Inc.
Comments
Welcome to the Propeller! [noparse]:)[/noparse]
It's in a clear case.. Does this mean we get to see the back? [noparse]:)[/noparse]
Nice Job!
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
Have to ask you about your project case or enclosure... I've been looking into laser cutting and engraving equipment and that sure looks like laser cut acrylic to me! Is that right? Is that right!??
Thanks,
Tim
Now that you are "dogfooding" you can help with the feedback process for prop II!
@Tim. It's right here http://www.mountainkingtech.com/ and I highly recommend their enclosures. They're entirely Parallax-based and they have cutouts for programming, accessing the power switch, power, etc. Really nice laser-cut acrylic. The only problem is the price, as they're quite expensive.
@soshimo. Indeed. If I can get up and running in a morning then most technical people should be Prop-capable within an hour or two. Prop II? Sure! Chip is always one year from production. In 2007 he was one year from production, and today he is one year from production. It's always "one year". Back in the day (1995) the BS2-IC was announced about a year before it was actually available. This was around the time when we relied entirely on printed advertisements and the internet wasn't so common. I'm sure you remember that time. Anyway, our staff did a full mutiny against the leader for making the mistake of announcing a product that wasn't ready. Over ten years later we're talking again about something that is still in design. And it wasn't our marketeers that started the Prop II discussion - it was Chip! Enthusiasm got the best of him.
My advice is to keep learning with Prop I in the meantime.
Ken Gracey
Chip congrats on making an electronic chip that has the ability to change a suit into a programmer, that in itself is a remarkable feat. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Nice first project - congratulations! A couple of suggestions:
1. Next Steps with the Thermometer:
A. Add a third 7-segment display. Now you can annotate your temperature in degrees F or C as you can make both the letters F and C with a 7-segment display. Make the display alternate between F and C, or add a button that allows you to select always F, always C or alternating F and C.
B. Add a second sensor for outdoor temperature display. Add one or two single LEDs or use the decimal point on the 7-segment F/C display to indicate whether you're displaying indoor or outdoor temperature. Again, add functionality to the button to select alternating indoor/outdoor etc. This enhancement might be a good candidate to try with multiple cogs.
2. Proto-Board Re-Use:
Next time, I suggest you try using wire-wrap with your Propeller proto-board. There are a few reasons:
A. Wire-wrap compared with point-to-point wiring is fast, neat and relatively easy to modify if you make a mistake.
B. With wire-wrap, there's no soldering on the proto-board. If you want to use the proto-board for a new project or make major changes, just un-wrap everything, rip up the sockets from the board, and start all over again. The proto-board is like new again.
C. By its very nature, wire-wrap results in everything being in sockets. IMHO that's a good thing when prototyping.
Wire-wrap is relatively easy and cheap to do. You need one wrap-unwrap tool (<$10 USD ea., see below), a roll of wire wrap wire (<$9/100ft. spool, www.sparkfun.com), and some wire wrap sockets (around $1 or $2 each, SparkFun). The wrap-unwrap tools typically have a built in wire stripper. But in the long run I suggest you get a decent pair of wire strippers that can handle 28-30 AWG wire (<$5 ea., SparkFun).
Wire-wrap wire is unlike ordinary wire. The insulation is designed to displace when wrapped on the square wire-wrap socket pins so the pin and wire make electrical contact. So only use wire specially designated for wire-wrap.
With wire-wrap you need to stick with a 0.1" DIP IC package, unless you have an SMT to DIP adapter of-course. I plug passive components into wire wrap sockets and headers; the machined pin-sockets take passive part leads nicely. You can buy wire-wrap posts to carry soldered leads that don't plug into wrap sockets (like switches etc.) Instead, I just tear a wire-wrap socket apart and use the bare pins that fall out.
If you're not familiar with wire-wrap Look here:
en.wikipedia.org/wiki/Wire_wrap
www.tecratools.com/pages/tecalert/wirewrap_guide.html
Finally, be careful when buying hand wrap-unwrap tools. The silver one shown in the attached picture is sold by Radio Shack and costs $6.95 USD (the same tool can be had from SparkFun for $16.95). I have a couple just like it; they wrap and unwrap (spin the other way) and there's a stripper if you pull the end-cap off (first thing to get lost). I prefer the blue wrap-unwrap tool shown in the second picture as it has dedicated wrap and unwrap bits on each end and the stripper is embedded in the middle of the handle. I bought a few of the blue tools in Singapore a few years ago for around $7 USD each, but I've seen them resold in the US for $20-$40 USD! It is not uncommon for parts suppliers to over-charge for wire-wrap tools and wrap-wire - especially in the U.S. and EU - buyer beware.
Good Luck, David
Post Edited (Drone) : 1/6/2009 5:02:33 AM GMT
Carve my words: such an attitude about NOT commenting code is the first step down the short slippery road to coding perdition!
Can't you see the evil in your thinking here? As you learn new things, the code will ALWAYS be "so simple" it won't be worth commenting on. Then, next thing you know, you've got this humongous horned beast of a program without a hair of included commenting - and a year later, when you need to fix it, you'll be gnashing your teeth, as clueless as can be. Or, like so many others who have gone before you, you will post this grand brilliant program on the OBEX, only to leave newbies clawing at themselves, writhing in anguish and wailing "Just exactly how does this work? Why are there no comments to save me from my ignorance and confusion? Whaaaa-whaaaaa...."
Don't make the same mistake so many of us have made before you. Before it's too late, start commenting everything now! Save yourself before it's too late!
OK, you got it. Good advice taken and I shall do exactly as you suggested. I don't want to develop any evil habits that leave other newbies writhing in anguish while they wonder how something works.
David,
I've been looking for such an overview on wire wrap, and I've now ordered the correct tools to improve my abilities. I'd much rather go to sockets/wire wrap where possible. Thank you for taking the time to describe the right tools and process, as I'll put your suggestions to use exactly as described.
Sincerely,
Ken Gracey
Don't sweat not showing the backside.. I'll be there in a couple weeks to take a peek. <SMIRK>
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
One day, I'll make the trip too!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Just as well the rear view is not included - I didn't want to see your backside anyway !!!
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Those who can, do.Those who can’t, teach.
The aforementioned 'pilgrimage' is also on my wish list !!
Rgds,
John
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Those who can, do.Those who can’t, teach.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
and perhaps some video (live?) Anything you guys have ever wanted to see at Parallax,
let me know and I'll get a shot. (All that is, except the back of Ken's project.)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
This might be the best thing since the invention of the solar powered tanning booth.
What you say about time to speed on the Prop (for serious developers) could not be more true...
I had no hardware background at all... didn't know a microcontoller from a hole in the ground and found the Spin language a breeze (Spin is so natural, it actually requires almost no documentation... and yet, it is fully documented).
I'm not buying the timeline for the Prop II... I think you guys are trying to be sneaky.
You should hold a contest and the guy closest to the release date gets an autographed PropII...
My guess is an online release...12 Noon, July 4, 2009. And I fully expect Chip to cooperate with me on this.
Nick...
that's not a boulder... that's the granite in the garage of Ken's condo in Aspen.
Rich
President for Life
EAPUG
my vote:
Febuary 14, 2010 in honor of the first uC.
Anyway, back on topic: Ken, are you going to make it a new thermostat controller, or simply an inspirational desktop display? You could make a nice system with a servo (to control the temperature arm) and a PID loop to get the right temperature.
@rjo_ you overestimate our planning abilities! Aspen. . yeah, right!
@nick: Sierra Nevada granite rock with chunks of occasional gabro throughout, stacked atop Brazilian soapstone,·installed by myself and Aristides (who rarely appears on these forums).
Ken Gracey
You should show rjo_ your view ... I'd much rather be where you are than Aspen - lol
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Now... since no-one actually knows what Chip is going to do next... but I claim a psychic connection... why don't we open this contest up to Parallax employees... Anyone closer than Ken gets to see the back of his proto board.
Rich
I was simply amazed at how quickly I got my prop doing all sorts of things (I am experienced, but still amazed). The structure of the prop is so simple, it was so easy to learn.
And now you too can keep the pressure on Chip for the PropII :-D
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Tools under Development or Completed (Index)
http://forums.parallax.com/showthread.php?p=753439
cruising][noparse][[/noparse]url=http://www.bluemagic.biz]cruising[noparse][[/noparse]/url][/url]
This is a [noparse][[/noparse]b]bold[noparse][[/noparse]/b] test.
Congrats on you project.
As far as the enclosures, the prices don't seem too bad for something so beautiful.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
You're asking me for Propeller help? OK, I'll accept the invitation to give something back around here for once.·But keep in mind I'm learning, too.
You didn't clarify whether or not your problem lies with the DS1620 interface or with driving the displays.
Here's what I'd do: break this down into the smallest pieces possible and make them work once piece at a time. For example, drive the four 7-segment LEDs alone and get the bit pattern resolved. Save this code and tuck it away. Next, interface to the DS1620 alone and forget about driving the four seven-segment displays. Use Parallax Serial Terminal to display the results from the DS1620. Save the code and tuck it away. Once you've got these two different I/O projects properly resolved, integrate them together.
For example, here is a stand-alone Spin program that can increment the LEDs. Change the bit pattern to reflect the particular displays you've chosen to use:
'LED Incrementer
'Example program which increments two seven-segment LTS4801JF amber LEDs
'
CON
'Set clock speed to 80 MHz
· _clkmode = xtal1 + pll16x······· 'Sets the clock speed to 80 MHz using a times 16 multiplier
· _xinfreq = 5_000_000············ 'Crystal speed: 5 MHz
· Zero· = %00000011
· One·· = %10011111
· Two·· = %00100101···
· Three = %00001101
· Four· = %10011001
· Five· = %01001001
· Six·· = %01000001
· Seven = %00011111
· Eight = %00000001
· Nine· = %00001001
·
VAR
· Byte OnesPosition
· Byte TensPosition····················
· Byte InnerLoop
· Byte OuterLoop
Pub LEDIncrementer················
· DirA[noparse][[/noparse]0..15] := %11111111_11111111·········
· OutA[noparse][[/noparse]0..15] := %00000000_00000000·········
·········
· OuterLoop := 0
· Repeat OuterLoop from 0 to 9
··· OutA[noparse][[/noparse]8..15] := Zero························
··· TensPosition := Lookupz(OuterLoop: Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine)
··· OutA[noparse][[/noparse]0..7] := TensPosition········
····· InnerLoop := 0
····· Repeat InnerLoop from 0 to 9························
······· OnesPosition := Lookupz(InnerLoop: Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine)
······· OutA[noparse][[/noparse]8..15] := OnesPosition········
······· WaitCnt(10_000_000 + Cnt)
Once you've got all four displays properly driven, you can tuck this away and worry about the DS1620. This is the top Spin file for testing out the DS1620. The other objects are included in the attached archive. The way it works: put in your DS1620 constants, compile using F-11 to EEPROM, open Parallax Serial Terminal and select the same COM port used in the Prop IDE (press F7 to see what your Prop IDE is using).
'DS1620 with DEBUG and Parallax Serial Terminal
'Display temperature from a DS1620 on two LTS4801JF yellow/orange LEDs
'
CON
'Set clock speed to 80 MHz
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000············ 'Crystal speed: 5 MHz
VAR
· Long· fData
· Byte· tensValue
· Byte· onesValue
·
OBJ
· Display : "LEDDisplay"
· Temperature : "DS1620"
· Debug· : "FullDuplexSerial"
PUB Main
· Repeat
··· Temperature.Start(16,17,18)··· ' <= put your DS1620 connections in here
··· fData := Temperature.gettempf
···
··· tensValue := (fData/100)
··· onesValue := (fData/10)-((fData/100)*10)
··· debug.start(31, 30, 0, 9600)
··· debug.dec(tensValue)
··· debug.dec(onesValue)
··· debug.str(string(" F"))
··· debug.tx(13)
···
··· WaitCnt(120_000_000 + Cnt)
Everything working independently so far? Then you're ready to turn your display code into a stand-alone object and pass it parameters from your top program. Let me know where you're stuck now and I'll try to move you to the next step. I think maybe the stand-alone LED example up top is what you need.
Ken Gracey
Parallax, Inc.
I believe he's using the HC4LED device that Bean was selling at the show.
It's an SPI driven, 4 LED module. I'm not sure where Bean got all these,
but next to using the LED's on the PPDB, they are pretty cool.
@Wizard,
I'll do you one better. Any chance you'll be off in Orrville this Friday?
Bring your rig to the shop. I'll be there late afternoon working with a
customer. As soon as he bugs out I *know* we can get it working.
(Marvin is somewhat curious about the Propeller himself, so I know he won't
mind you showing off your setup while we're working on his computer.)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
Post Edited (Oldbitcollector) : 1/7/2009 5:59:01 AM GMT
Thanks for helping him, OBC.
- Ken
BTW: Ken, if you really want to be cool, it's n00b! [noparse]:)[/noparse]
Of course, that was a damn solid bit of help. Maybe you can graduate to L337 d00d!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!