Machine programming a 7segment LED

Click For Summary

Discussion Overview

The discussion revolves around the fundamental concepts of programming a 7-segment LED display, exploring the interactions between a keypad and the display, and the basic principles of electronics involved in such a setup. Participants share their thoughts on the simplest way to implement this idea, including hardware connections and programming considerations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant proposes a thought experiment to understand the lowest level of computer programming using a single 7-segment LED and a keypad.
  • Another suggests looking into Microchip PIC chips for practical implementation, recommending starting with C programming before exploring assembly code.
  • Some participants explain that a simple hardware setup could involve connecting the cathodes of the LEDs to ground and using switches to control the anodes, without needing a processor.
  • There is a clarification about the terminology used, such as the meaning of "common cathode" and "common anode" displays, and how they relate to controlling the LED segments.
  • One participant expresses a desire for a more fundamental understanding of electronics, asking for explanations of basic terms and concepts related to the operation of the 7-segment display.
  • Another participant mentions that pulling a pin low means connecting it to ground, while pulling it high means connecting it to a positive voltage.

Areas of Agreement / Disagreement

Participants generally agree on the basic principles of connecting a 7-segment LED display to a keypad, but there are varying levels of understanding and familiarity with the terminology and concepts involved. Some participants seek clarification on fundamental terms, indicating that the discussion remains somewhat unresolved regarding the foundational knowledge needed.

Contextual Notes

There are limitations in the discussion regarding the assumptions made about participants' prior knowledge of electronics and programming. Some technical terms remain undefined for certain participants, which could affect their understanding of the proposed ideas.

Who May Find This Useful

This discussion may be useful for beginners in electronics and programming, particularly those interested in understanding the basics of interfacing a keypad with a 7-segment LED display.

Loki23
Messages
11
Reaction score
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: 356
  • 7seganimation.gif
    7seganimation.gif
    9.2 KB · Views: 455
Engineering news on Phys.org
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...
 
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.
 
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?
 
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
 
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.
 
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.
 
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.
 
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
Replies
6
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
1
Views
2K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 25 ·
Replies
25
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 23 ·
Replies
23
Views
5K