kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

clock to 7 segment display

Fri Feb 19, 2016 1:54 pm

Hi

I have a homework assignment to do as follows :-

clock connected to some sort of converter to then be displayed on a 7 segment display

Can this be done using the Raspberry Pi ?

I need the 7-segment to count from 1 to F then repeat this over and over again , there must be a delay of approx 1sec between the counts.

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: clock to 7 segment display

Fri Feb 19, 2016 2:03 pm

Yes.

Heater
Posts: 17137
Joined: Tue Jul 17, 2012 3:02 pm

Re: clock to 7 segment display

Fri Feb 19, 2016 2:09 pm

What kind of clock?

Simplest case might be:

A 555 timer chip wired as an oscillator, the clock, producing pulses at per second:
http://www.electronics-tutorials.ws/wav ... lator.html

A 4029 counter chip that counts the input clock pulses and produces a 4 bit binary output. 0 to F.
http://www.play-hookey.com/digital_expe ... _4029.html

A 4511 seven segment display driver chip to convert a 4 bit binary input to 7 segment drive output.
http://www.electronics-tutorials.ws/blo ... orial.html

Yes, you can do that with a Pi. The clock can be the NTP servers that your Pi connects to over the internet to get accurate time. Just write a 10 line program to output a seconds counter on 4 lines of GPIO. Feed that into your 4511 chip.

Or use 7 lines of GPIO output drive the display directly. Extra code needed to convert the count into seven segment output patterns. I would rather have transistors driving LEDs from the GPIO pins, or that driver chip.

But the thought of using a 32 bit, 1GHz processor with a gig of RAM and running Linux to do this simple thing really upsets my mind :)

Doing it the old fashioned way at least gives you the chance to learn a little electronics.
Memory in C++ is a leaky abstraction .

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Fri Feb 19, 2016 2:23 pm

thank you

the thing is I don't have access to those chips and am aware that it can be done using ICs

What I have is a PiZero and Pi Model B, + a Clock, + a 7-segment display

I wanted to do this homework assignment using what hardware I have available to me.

Can I connect a clock to the Pi , then is the Pi able to do some intelligent processing to convert those pulses so that I can light up the respective LEDs on the 7-segment display?

Heater
Posts: 17137
Joined: Tue Jul 17, 2012 3:02 pm

Re: clock to 7 segment display

Fri Feb 19, 2016 2:52 pm

I have to ask again, what kind of clock? We can't help you if you don't help us.

Yes, I think we said that already.

Connect 7 GPIO lines to the 7 LEDs of the display. You will need 7 current limiting resistors in series with those connections. See the links I gave above for details.

Now write some code to set those GPIO on and off in the correct pattern for the number and letter display given a number that is to be displayed. Use your favorite programming language, C, C++, Python, Javascript, whatever.

I'd forget the clock input initially. The Pi keeps time pretty well by itself. Just write some code to get the current time in seconds. Feed that into your code above for display on the seven segments.

We can talk about the clock input when we know what it is.
Memory in C++ is a leaky abstraction .

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 4:20 am

Sorry about that. I'm not sure what you call this clock. I seemed to have snatched it from our electronics lab when I was a 1st year student. The number on it is : M5.000F 4D

Heater
Posts: 17137
Joined: Tue Jul 17, 2012 3:02 pm

Re: clock to 7 segment display

Sat Feb 20, 2016 5:10 am

Any chance you could post a picture of this M5.000F 4D clock thing?
Memory in C++ is a leaky abstraction .

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 12:26 pm

Please see attached Pictures
Attachments
Untitled1.gif
Untitled1.gif (19.7 KiB) Viewed 3165 times

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 12:26 pm

also
Attachments
Untitled.gif
picture
Untitled.gif (13.24 KiB) Viewed 3160 times

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: clock to 7 segment display

Sat Feb 20, 2016 12:31 pm

That’s a crystal.
You need a circuit to drive it (to turn it into a clock source). The Pi can’t do it by itself, but all you need is a LVC1404, and some R’s and C’s: http://www.ti.com/lit/an/szza043/szza043.pdf

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 12:37 pm

thank you ... I'll have a look at that

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: clock to 7 segment display

Sat Feb 20, 2016 1:01 pm

Hi,
This is a 5MHz quartz crystal.
Can be uses a filter, as oscillator to generate pulses to drive some digital circuity (clock pulses).
As clock generator, it pulses at 5 million times per second.
To get 1 pulse per second, need to divide per 5 million.
Two 74HC4060 can be used as divide, with extra logic to get 5 million and display.
You can use raspberry pi to divide (need a oscillator, logic inverter like 74HC04 do), but, raspberry pi have you own internal clock, that can be uses to count 0 to F (or 0 to 15) and drive a display via GPIO.

Also, AVR or PIC can use this crystal as clock and drive display.

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: clock to 7 segment display

Sat Feb 20, 2016 1:06 pm

I'd be inclined to ask for clarification on the rules of the assignment. If you're allowed to use the Pi in the first place, you may also be allowed to use the Pi as the clock.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 1:25 pm

nah its just a refreshed for Digital systems 3 which we did about 5 years ago.
Lecturer asked us to make a circuit however we want , using a clock, some sort of converter in between to a 7-segment display.

I chose to use the Pi because that's what I have available to me.

I also have this quarts crystal, ICs - 7411, 7424, 7475, 7408, 7432, 7475, 7483, 7404, 7476, 7495, 7448, 7420, 7474, 7476, 7400, 4011, 7486, 7402 and of cos the 7-segment display.

So this is like a refresher homework assignment for what we did many years ago. I was hoping to just use the Pi to do it all - I guess that not the case.

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sat Feb 20, 2016 1:32 pm

Hi pksato

I actually got that IC M74HC04B1 not sure if thats what you are referring to. I also have the Quarts crystal M5000F4D. Shed more light on how I go about doing this please :)

User avatar
davidcoton
Posts: 5678
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: clock to 7 segment display

Sat Feb 20, 2016 4:36 pm

kallasur wrote: ... Shed more light on how I go about doing this please :)
Aren't you supposed to work out the circuit yourself -- isn't that meant to be the assignment?
Location: 345th cell on the right of the 210th row of L2 cache

kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sun Feb 21, 2016 6:28 pm

thanks. I got this to work with only the Pi, Its simple really.

Now I need to do some electronics

Anyone knows of any free software where I can actually simulate the circuit I want using the 555, 4511 and 4029 ICs , so I want to simulate this instead of physically doing it because I don't have the Hardware


kallasur
Posts: 82
Joined: Mon Dec 07, 2015 7:25 am

Re: clock to 7 segment display

Sun Feb 21, 2016 8:12 pm

Interesting ... Ill give that a shot. Thanks for the Reply :)

Return to “General discussion”