Machine programming a 7segment LED

In summary, Mike is trying to understand processors and how code can be written to interact with LEDs. He is also trying to gain an understanding of how the simplest computer program would work. He is not sure if there is a question in the post, but he recommends looking into the Microchip PIC chips if you want to get started.
  • #1
Loki23
11
0
Hello,

Lately I've been trying to gain an understanding of processors/cpu's and the very lowest possible code you can engineer. I decided I would do a thought experiment where I would distill the computer down to the most basic level I could conceive, and decided that such a computer would be a single 7 segment LED. That seemed sufficiently simple, yet in some ways, still mysterious to me.

Here's an example of what I mean:

7segled_full1.jpg


Imagine this LED hooked up to a keypad with numbers 0-9, each key sending a different signal to the processor. The processor, as I understand it, is best visualized as a network of on/off switches. But this is too general.

I want to go into more specific details but I'm not sure how. When you press a key on a small 0-9 numbered keypad, what exactly are the interactions occurring to produce the simple 7 bulb display? It's so simple, yet it's still not easy to see.

I put together another gif of the next step in complexity, primitive animation:

7seganimation.gif
 

Attachments

  • 7segled_full1.jpg
    7segled_full1.jpg
    4.3 KB · Views: 293
  • 7seganimation.gif
    7seganimation.gif
    9.2 KB · Views: 386
Engineering news on Phys.org
  • #2
I'm not sure if there is a question in your post, but if you want to pursue the "simplest" computer program to make your gif example in "reality" I would suggest looking into the Microchip PIC chips, perhaps the 16F818. You can find some free C compilers and assemblers...I would start with C, and then look at the assembly code...and go to town.
I think sparkfun.com may have some kits and stuff that you could use to get going. Microchip has programmers and software but seems to want money in exchange...
 
  • #3
At the most basic level you don't need any code or even a processor. All you need to do is connect the cathode of each LED to ground and connect the anodes of the LEDs through diodes to the ten switches. For instance the switch for the number one would have two separate connections through resistors and forward biased diodes to the two rightmost vertical LED segments. The keys for all the other numbers could be hard wired through resistors and diodes to the segments they're are supposed to light.

If you want to use code and a processor then each digit (0..9) is mapped to a character that represents the seven segments (or eight if you count decimal points) and sent to the output port. The LED segments are connected to the output port and are lit when the 7 segment character is output.
 
  • #4
skeptic2 said:
At the most basic level you don't need any code or even a processor. All you need to do is connect the cathode of each LED to ground and connect the anodes of the LEDs through diodes to the ten switches.

Hold on a second. When you say each LED, are you talking about each of the 7 bulbs that comprise a single 7 seg LED?
 
  • #5
Getting used to processors can be intimidating. If your doing this outside of a supporting group, I recommend you start with a project that works. Then, modify it and learn the nomenclature and import of the pieces. There are some books with support code. As I recall, the PIC parts are good about this.

Best Wishes,

Mike
 
  • #6
Loki23 said:
Hold on a second. When you say each LED, are you talking about each of the 7 bulbs that comprise a single 7 seg LED?

Yes, each 7 segment LED comes with a pin for each segment plus a common. I was assuming common cathode but there probably also are common anode 7 segment displays. In that case the cathode of the appropriate segments would be pulled low.
 
  • #7
skeptic2 said:
Yes, each 7 segment LED comes with a pin for each segment plus a common. I was assuming common cathode but there probably also are common anode 7 segment displays. In that case the cathode of the appropriate segments would be pulled low.

Can we explore some extremely basic things based on what you just wrote?

Terms I am not familiar with:

pin (an anode?)
common (a cathode?)

I also don't know what you mean by "assuming a common cathode" what do you mean?

All I really know at this point is that electricity flows into the anode and out the cathode. I hardly know much else. Just hoping you could explain things as fundamentally as possible, even if that means helping me get a handle on some of the most rudimentary terms in electronics.

What would be the difference between a common cathode and common anode display?

What does it mean to pull the cathode low? no idea what that would mean.
 
  • #8
Mike_In_Plano said:
Getting used to processors can be intimidating.

Extremely. I don't even want to try to tackle it without getting a grasp on engineering a keypad to light up 10 different combinations of lights (0 - 9). That's boggling enough.

If you're doing this outside of a supporting group, I recommend you start with a project that works.

Can you give me an example of such a project? Let's keep it real simple too, for instance, do you think it's appropriate for me to focus on 7 seg LEDS?

Then, modify it and learn the nomenclature and import of the pieces. There are some books with support code. As I recall, the PIC parts are good about this.

What do you mean by importing pieces? I'm not sure code is the best place for me to start. I understand a bit of programming (python), but I really want to focus on the most fundamental thing I can think of, and that is a single 7 seg LED fed by a 0 to 9 digit keypad.
 
  • #9
Whats your backround Loki23?
You might want to try with some chips that don't have much complicated syntax. I have used Lego mindstorms, paralax robotic kit, and trying now to do some project on PIC. Lego and paralax have some simle and intuitive development software.
 
  • #10
Loki23, common anode means that all 7 anodes of the 7-segment display are tied (connected) together. Common cathode is the same, except with cathodes connected instead. If you think about it, you only need to control one end of an LED to turn it on or off.

Pulling something low means connecting (via your microcontroller) that something to ground. Pulling high means connecting it to 5V or whatever your voltage happens to be. Note that most LEDs can't handle 5V directly, and you need a small resistor in-between your input and the LED.
 
  • #11
...and pin refers to the wire lead coming out of the 7 segment module.
 

Related to Machine programming a 7segment LED

1. How does a 7segment LED work?

A 7segment LED is made up of seven individual LED segments, arranged in a specific pattern to display numbers and letters. Each segment is connected to a corresponding input pin, and by selectively turning on and off these segments, different characters can be displayed.

2. What is the difference between common cathode and common anode 7segment LED?

In a common cathode 7segment LED, all the cathodes (negative terminals) of the individual segments are connected together and controlled by a single input pin. In a common anode 7segment LED, all the anodes (positive terminals) are connected together and controlled by a single input pin. The main difference is the direction of current flow, but both types can be programmed in a similar way.

3. Can a 7segment LED display more than just numbers and letters?

Yes, a 7segment LED can also display some basic symbols and special characters. However, the range of display options is limited compared to other types of displays, such as LCD or OLED screens.

4. How can I program a 7segment LED to display a specific number or character?

To program a 7segment LED, you will need to connect each segment to a corresponding input pin on a microcontroller or other programmable device. Then, you can use code to selectively turn on and off the segments to display the desired number or character. There are also some pre-made libraries and modules available that can make the programming process easier.

5. What are the common applications of 7segment LED displays?

7segment LED displays are commonly used in digital clocks, calculators, electronic meters, and other devices that need to display numerical or alphanumeric data. They are also popular in DIY electronics projects and can be found in various consumer products such as kitchen appliances and car dashboards.

Similar threads

  • Differential Equations
Replies
1
Views
788
Replies
6
Views
1K
Replies
3
Views
1K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
Replies
5
Views
1K
  • STEM Academic Advising
Replies
12
Views
1K
  • Electrical Engineering
Replies
3
Views
4K
  • Programming and Computer Science
Replies
29
Views
3K
  • Programming and Computer Science
Replies
6
Views
1K
  • DIY Projects
Replies
23
Views
4K
Back
Top