PDA

View Full Version : Question about the DSD1620 & HC4LED



TheWizard65
01-04-2009, 12:17 AM
I know TPW and Bean, had done something with the HC4LED soon after the Prop Expo in Norwalk. My question is: Can you get a read out from the DS1620 to the HC4LED Display, or am I kicking a dead mule. I'm not savvy with Code so any help and advice will be helpful (hint, Mike Green) Thank You all in advance.

Oldbitcollector (Jeff)
01-04-2009, 01:25 AM
@Wizard

zip up and post your code so we can see it.
Sounds like you will simply need to use the LED driver code
like you would an output display. (VGA, composite, etc)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

TheWizard65
01-04-2009, 02:02 AM
I'll get the hang of this forum yet, thanks OBC, here are the ones I have been using.

Post Edited (TheWizard65) : 1/3/2009 6:08:31 PM GMT

Oldbitcollector (Jeff)
01-04-2009, 03:01 AM
I don't have your setup ready over here, but I *think* this will either work
or get you really close. Save this code as a .spin file in the same folder
with the contents of the objects mentioned in OBJ. (Your first two .zip files)

Double check the .start commands and make sure you are using the pins
indicated or change them to your configuration.

This should display both on the LED module and your TEXT display at the
same time.




''
'' Display temps on both HC4LED and TEXT displays
''

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000


OBJ

text : "char_mode_08"
temp : "ds1620"
delay : "timing"
num : "simple_numbers"
leds : "hc4led"

PUB start | i,counter, tc, tf

'start term
text.start
temp.start(16, 17, 18)
leds.start(0, 1)

repeat
delay.pause1ms(1000) ' wait one second
text.out(00)
blank
text.str(string(" Digital Thermometer:",13,13))
leds.str(string(" Digital Thermometer:"))
waitcnt(clkfreq + cnt)

temp.sethigh(78)
temp.setlo(76)
tc := temp.gettempc
text.str(num.decf(tc / 10, 3))
leds.str(num,decf(tc / 10, 3))
waitcnt(clkfreq + cnt)

text.str(string("."))
leds.str(string("."))
waitcnt(clkfreq + cnt)

text.str(num.dec(tc // 10))
leds.str(num.dec(tc // 10))
waitcnt(clkfreq + cnt)

text.str(string("C "))
leds.str(string("C "))
waitcnt(clkfreq + cnt)

tf := temp.gettempf
text.str(num.decf(tf / 10, 3))
leds.str(num.decf(tf / 10, 3))
waitcnt(clkfreq + cnt)

text.str(string("."))
leds.str(string("."))
waitcnt(clkfreq + cnt)

text.str(num.dec(tf // 10))
leds.str(num.dec(tf // 10))
waitcnt(clkfreq + cnt)

text.str(string("F"))
leds.str(string("F"))
waitcnt(clkfreq + cnt)




PRI blank

leds.cls
waitcnt(clkfreq / 2 + cnt)






Nice to see you tinkering with code these days!

Reviewing this, I'm not sure what the "." will display,
being an LED display, but it should be interesting anyway. :)


OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

Post Edited (Oldbitcollector) : 1/4/2009 12:28:25 AM GMT

TheWizard65
01-04-2009, 07:53 AM
Thanks OBC, I can't wait to try this out.

Ken Gracey
01-04-2009, 08:22 AM
theWizard65,

I just made functional my first Propeller project with a DS1620 and two seven-segment LEDs. Could have been done on nearly any processor, but I'm using small projects to start learning the Propeller.

Altough we're using different displays, maybe you will find the DS1620·interface useful if you have trouble in that area.

I have not commented the code yet (it is very basic) but will do that next.

Ken Gracey
Parallax, Inc.

TheWizard65
01-04-2009, 09:12 AM
Thank You very much Ken, I'll be sure to try it out.

Oldbitcollector (Jeff)
01-04-2009, 10:43 PM
@Wizard: Did that code work for you?

@Ken: Nice simple LED code! (Added to my library) I'm surprised that you aren't using a PPDB... :)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

TheWizard65
01-05-2009, 08:18 AM
OBC, I'm getting errors when trying to use the code. I'm getting: ERROR;Expected a subroutine name in Propeller tool, and I'm getting a
hc4led-Error at (123,30) Unable to locate Method/Constant in Object in BST. Here is what I'm working with. BTW, in stead of me getting my feet wet on this I'm literaly soaking wet from head to toe.(LOL) My Hats Off to BradC for allowing me to use my Power Mac to do prop work.Thank You Everybody.

Post Edited (TheWizard65) : 1/5/2009 12:38:06 AM GMT

Oldbitcollector (Jeff)
01-05-2009, 08:36 AM
I'm using BST too, I'm going to cross-check this code under actual Propeller Tool
and see if it will compile. I'm thinking it *might* be a new BST issue, as I'm
pretty sure your LED code worked before. checked

Nope, BST is clear of this one.. The LED code won't compile.
Were you able to use this code to display characters on the LED before?

TPW's original code is here: obex.parallax.com/objects/360/ (http://obex.parallax.com/objects/360/)
but it isn't as nearly as userfriendly as Jon's code. (Then for some reason
which escapes me, Jon's won't compile..) Jon??


OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

Post Edited (Oldbitcollector) : 1/5/2009 12:59:54 AM GMT

Oldbitcollector (Jeff)
01-05-2009, 08:58 AM
Ok.. I'm drawn in.. :)

Getting my HC4LED display out and hooking it up.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

TheWizard65
01-05-2009, 09:07 AM
Well I thought I done every thing right, Just like all my projects they don't work until I call out the heavy artillary. Or maybe it just can't be done. I even tried Kens Object with no luck. Thanks OBC for your help. BTW,OBC don't pull out to many hairs on this one My head hurts trying to get this going.

Post Edited (TheWizard65) : 1/5/2009 1:28:12 AM GMT

Oldbitcollector (Jeff)
01-05-2009, 09:44 AM
@Wizard,

Something to check..

I couldn't get mine working for several mins as I was trying to plug my
wires directly into the plug. They did not make connection.

Also, the two I still have used different color combinations of wire.
Make sure that PIN 1 (data) is the line starting from the left as the wires
come out of the front of the display. WHITE is not 5V on either of mine.

I switched to some extra long M/M breadboard pins and finally got
TPW's code working.

Now to see what I can make of yours..

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

Post Edited (Oldbitcollector) : 1/5/2009 3:27:56 AM GMT

TheWizard65
01-05-2009, 11:07 AM
I wired my LED's according to the booklet that came with my LED's. (I have TPW's program Lighting up my LED in a clock wise fashion, Is ths set up correct.

Oldbitcollector (Jeff)
01-05-2009, 11:25 AM
Ok, this drove me a little nuts until I found a way to make it work.

Attached is a modified copy of Ken's RoomTemperature program using the HC4LED
(I'm using TPW's driver)

Just change the pin settings in CON to match your configuration.

For simplicity I didn't bother to add the TV output.
Let me know how it works for you.

BTW, you are using 220ohm resistors to protect the Prop on the Clk/Data
pins aren't you? Not a bad idea since with is fed with 5v. (Although I chose to risk it.)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)