Shop OBEX P1 Docs P2 Docs Learn Events
In need of help for a finnal project in mty digital logic class...... — Parallax Forums

In need of help for a finnal project in mty digital logic class......

blind_botblind_bot Posts: 22
edited 2010-02-21 16:00 in Propeller 1
Okay, so as a finnal project I have a seven segment led, that will be connected to a led driver, and then a counter. I have each item hook up and tested.... And at about .9hz I can get it to count 0 to F, so this part is good.
·In our project we are required to get it to count from 0 to 9 then restart again. I belive that I can do this by tying two of the input from the counter threw a nand gate, then connecting the output of the nand gate to loadf, wich will bring to to ground, and cause it to reset. However this hasnt been tested and I am running out of time. Only two lab days before the finnal exame.( I hate excelorated classes). What I would like to do is use the propellor to create a frequency of about 0.86 hz, but I do not know how as I have only had my prop edu kit for about a week or so.
·So I would love it if someone could help me with codding that I might be able to use to get the 0.86 hz I need in order to read the led. Faster freq just cause the led counting to spin fast than is able to read.

· Thank you, Duane

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
00100000

Comments

  • AleAle Posts: 2,363
    edited 2010-02-20 15:49
    From the propeller manual v 1.1 (WebPM-v1.1.pdf) go to the page 218 where Waitcnt is described. All you need is there (read, read, read).

    The counter problem you solve it using weights 8 and 2 (10 dec, A hex) with a NAND or an AND, depending if the clear is triggered by a logic 1 or 0, choose accordingly, use a truth table.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
  • blind_botblind_bot Posts: 22
    edited 2010-02-20 16:03
    It will need to be a logic low which is why I will be using a nand gate as stated earlyer. Playing around with a simple flashing led using the waitcnt I was able to get a working solution. The frequency we used in lab was .86 hz, that ended being a bit fast here, but at 42 hz I have a working counter... I now need to hook up the nand, and test it out, re-draw my scematic in lab view, and tidy up my wiring. My instructor goes crazzy with messy wiring.....

    Thank you so much!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    00100000
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-20 16:57
    You are allowed to use a microcontroller to generate the clock?

    I would think they would prefer if you use gates and counter ic only for the whole project.

    As with a microcontroller, you could check the if the counter have bits 2 AND 4 high
    and send the reset signal.
  • blind_botblind_bot Posts: 22
    edited 2010-02-20 17:08
    No we are not we will use a freq generaror, I just needed to use it here at home for testing because I do not hane a freq generator.
    Right now I am still trying to figure out whu the nand gate isnt working for me.... Instead of resetting at 9 and starting over at 0 it just freezes it up...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    00100000
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-20 17:20
    read about Resetting a counter here:

    http://www.kpsec.freeuk.com/counting.htm#reset
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-20 18:05
    generating the 1hz
    Using a 16mhz crystal and divide it by 16777216.
    http://www.nxp.com/documents/data_sheet/HEF4521B.pdf

    Can also use a crystal with a range from 262khz to 8mhz as the last 7stages are outputed.

    this 4.096 mhz crystal and using Q22 (pin14) should generate exactly 1.000 hz
    ·http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=300-8412-ND


    Post Edited (tonyp12) : 2/20/2010 6:52:41 PM GMT
  • blind_botblind_bot Posts: 22
    edited 2010-02-20 20:51
    Well yeah, that all works but I do not have such crystals.. I needed a solotion today to work on my project, upon returning to school on monday I willl have access to lab equipment again.
    But thanks, might be worth ordering for the futor..

    I admit that what I am doing now is crude in conparison, but it works for what I need right now.....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    00100000

    Post Edited (blind_bot) : 2/20/2010 9:01:37 PM GMT
  • blind_botblind_bot Posts: 22
    edited 2010-02-20 20:56
    The article on the 16hmz crystal seems pretty intersting, might be cool to order one on my next degikey order.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    00100000
  • blind_botblind_bot Posts: 22
    edited 2010-02-21 16:00
    I finnaly got it working, the 7-seg led is now counting 0 to 9 and restarting at 0 again..... with only two lab day reaming I am once again saved by the propeller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    00100000
Sign In or Register to comment.