Shop OBEX P1 Docs P2 Docs Learn Events
Question about the DSD1620 & HC4LED — Parallax Forums

Question about the DSD1620 & HC4LED

TheWizard65TheWizard65 Posts: 91
edited 2009-01-05 03:25 in Propeller 1
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.

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-03 17:25
    @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 , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-03 18:02
    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)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-03 19:01
    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
    ''
    
    [b]CON[/b]
    
      [b]_clkmode[/b] = [b]xtal1[/b] + [b]pll16x[/b]
      [b]_xinfreq[/b] = 5_000_000
    
    
    [b]OBJ[/b]
    
      text : "char_mode_08"
      temp  : "ds1620"
      delay : "timing"
      num   : "simple_numbers"
      leds  : "hc4led"
    
    [b]PUB[/b] start | i,counter, tc, tf
    
      'start term
      text.start
      temp.start(16, 17, 18)
      leds.start(0, 1)
    
      [b]repeat[/b]
          delay.pause1ms(1000)                              ' wait one second
          text.out(00)
          blank
          text.[b]str[/b]([b]string[/b](" Digital Thermometer:",13,13))
          leds.[b]str[/b]([b]string[/b](" Digital Thermometer:"))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          temp.sethigh(78)
          temp.setlo(76)
          tc := temp.gettempc
          text.[b]str[/b](num.decf(tc / 10, 3))
          leds.[b]str[/b](num,decf(tc / 10, 3))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b]([b]string[/b]("."))
          leds.[b]str[/b]([b]string[/b]("."))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b](num.dec(tc // 10))
          leds.[b]str[/b](num.dec(tc // 10))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b]([b]string[/b]("C "))
          leds.[b]str[/b]([b]string[/b]("C "))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          tf := temp.gettempf
          text.[b]str[/b](num.decf(tf / 10, 3))
          leds.[b]str[/b](num.decf(tf / 10, 3))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b]([b]string[/b]("."))
          leds.[b]str[/b]([b]string[/b]("."))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b](num.dec(tf // 10))
          leds.[b]str[/b](num.dec(tf // 10))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
          text.[b]str[/b]([b]string[/b]("F"))
          leds.[b]str[/b]([b]string[/b]("F"))
          [b]waitcnt[/b](clkfreq + [b]cnt[/b])
    
    
    
    
    [b]PRI[/b] blank
    
      leds.cls
      [b]waitcnt[/b](clkfreq / 2 + [b]cnt[/b])  
    
    
    




    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. [noparse]:)[/noparse]


    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/4/2009 12:28:25 AM GMT
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-03 23:53
    Thanks OBC, I can't wait to try this out.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2009-01-04 00:22
    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.
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-04 01:12
    Thank You very much Ken, I'll be sure to try it out.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-04 14:43
    @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... [noparse]:)[/noparse]

    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
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-05 00:18
    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)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-05 00:36
    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/
    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 , 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/5/2009 12:59:54 AM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-05 00:58
    Ok.. I'm drawn in.. [noparse]:)[/noparse]

    Getting my HC4LED display out and hooking it up.

    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
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-05 01:07
    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)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-05 01:44
    @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 , 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/5/2009 3:27:56 AM GMT
  • TheWizard65TheWizard65 Posts: 91
    edited 2009-01-05 03:07
    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)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-05 03:25
    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 , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
Sign In or Register to comment.