Help with Embedded Design: Push Buttons & 7 Segment Displays

  • Thread starter Thread starter Ian_Brooks
  • Start date Start date
  • Tags Tags
    Design
AI Thread Summary
The discussion focuses on developing microcontroller code to take inputs from three push buttons representing hundreds, tens, and ones, and display the output on three 7-segment displays. The user plans to program in C and convert it to assembly, with a basic structure outlined in pseudo code. There is a suggestion that a basic stamp or PIC microcontroller would be suitable for small projects, while an 8051 might be better for larger applications, although the latter's development kit can be costly. It is noted that most low-end microcontrollers may lack sufficient I/O pins to drive three 7-segment displays directly, necessitating the use of an interface chip. Overall, the thread seeks guidance on implementation and hardware selection for the embedded design project.
Ian_Brooks
Messages
127
Reaction score
0

Homework Statement



I'm very new to embedded design and wanted to develop a micro controller code that

*takes 3 inputs from 3 push buttons
- hundreds, tens, ones respectively
* displays the output on 3 7segment displays
* outputs a fixed binary number to another microcontroller / or perhaps use it for another aspect inside the microcontroller.


Homework Equations



None that I know of.
I'll most likely program it in C and use the ctoasm function to convert it into assembly

The Attempt at a Solution



This is the design I'm hoping for.
http://img228.imageshack.us/img228/9088/sampledesigndv7.gif

rough pseudo code for now

Code:
int hundreds, tens, ones;

boolean set = 0; // when pressed the final value is calculated and stored
boolean input1 = 0;
boolean input2 = 0;
boolean input3 = 0;

while (set != 1) {
  if (input1 == 1){
    BCDOUT_1(hundreds++);
  }
  else if (input2 == 1){
   BCDOUT_2(tens++); 
  }
  else if (input3 == 1){
   BCDOUT_3(ones++);
  }

}//end while - loop ends when set = 1

finalVal = (100*hundreds) + (10*tens) + ones;

things to include:
i'll have to #define the push button addresses
in the main code I'll have to define the output ports as

byte *output_port = (byte *) display; //or something or rather

could someone help - or atleast point me in the right direction
 
Last edited by a moderator:
Physics news on Phys.org
Which micro depends on how many you want to make.
A basic stamp or pic is easiest is you only want one or two, if you are making more then something like an 8051, but the dev kit is expensive for one off.
It is unlikely you will find a low end micro with enough i/o pins to drive 3 x 7segment directly, you probably need an interface chip to run the display.
 
Back
Top