Question

In: Electrical Engineering

Design a circuit using PIC 18F458, which counts the number of input pluses read by any...

Design a circuit using PIC 18F458, which counts the number of input pluses read by any input I/O port of the PIC 18 and show the pulses counting state on the 7-segment display. Hint: For Input pulses function generator or 555 Astable oscillator can be used.

Solutions

Expert Solution

Coding for the designing of 7 segment display in pic18f458 is provided by me, which will give your the required results easily. -

Data lines for all SSD's are common. and they are connected to PORTD.
To select particular SSD of that Bank we have used another latch(latch 6) connected to PORTE = E0 bit

if I want to select SSD no. 2 and SSD no 10 then steps needed are as follows
PORTA - A1 =1 //Enable bank 1
PORTD - D6 = 0 //Select SSD 2 by making D6 bit low.
PORTE - E0 = 1 //Enable PORTE to load value of PORTD(in this case D6) and select that SSD.
  
PORTD= 0xFF // Send character FF to SSD 2
  
PORTA - A2=1 //Enable bank 2
PORTD - D5 = 0 // Select SSD 10 by making D5 pin low
PORTE - E0 = 1 //Enable PORTE to load value of PORTD(in this case D5) and select that SSD.
  
PORTD - D = 0xFE // Send Character FE to SSD 10.


code for the same :-

#include <p18f4550.h>

#pragma config FOSC         =    HS     // 20MHz Crystal, (HS oscillator)
#pragma config PBADEN      =    OFF // PORTB<4:0> pins are configured as digital I/O on Reset)
#pragma config WDT         =    OFF // watch dog timer off
#pragma config LVP         =    OFF // Low voltage program off


void main()
{    
     ADCON1 = 0xFF;                                    // Configure all ports with analog function as digital
     CMCON = 7;
     TRISD=0;    //make PORTD all out put
     TRISB=0xf0; //make PORTB pins 0:4 o/p and others input( we need only 0:4 pins)
     TRISA=0;
     TRISE=0;

     while(1)
     {
     PORTA=0x02; //Enable bank_1
     PORTD=0xBF; //Select SSD 2 by making D6 bit low.
     PORTE=0x01; //Enable PORTE to load value of PORTD(in this case D6) and select that SSD.
     PORTE=0x00;    //Disable PORT E so that character data won't go in SSD Select latch, i.e=PORTE - E0 bit.

     PORTD= 0xFF // Send character FF to SSD 2

     PORTA=0x04; //Enable bank_2
     PORTD=0xDF;    // Select SSD 10 by making D5 pin low
     PORTE=0x01; //Enable PORTE to load value of PORTD(in this case D5) and select that SSD.
     PORTE=0x00;    //Disable PORT E so that character data won't go in SSD Select latch, i.e=PORTE - E0 bit.

     PORTD=0xFE; // Send Character FE to SSD 10.
     }

}


Related Solutions

On logisim or any circuit building program, design a counter that counts 9,8,7,6,5,4,3,2,1,0 then back to...
On logisim or any circuit building program, design a counter that counts 9,8,7,6,5,4,3,2,1,0 then back to 9. After, add to it's output a 7 segment decoder and it's display. thank you!
design a logic circuit that counts the number of 1s in 12 inputs(a0...a11) and outputs a...
design a logic circuit that counts the number of 1s in 12 inputs(a0...a11) and outputs a 4-bit binary that represents the count of 1s. for example, if input is 111111111111 which has 12 1s, then output should be 1100 note :Do not use clocking. draw logic diagram.
Design a combinational logic circuit that takes a single digit decimal number as its input and...
Design a combinational logic circuit that takes a single digit decimal number as its input and also detects if the input is an odd number. Design a combinational circuit that accepts a 3-bit number and generates an output binary number equal to the square of the input number.
Design a “disk spinning” animation circuit for a CD player. The input to the circuit will...
Design a “disk spinning” animation circuit for a CD player. The input to the circuit will be a 3-bit binary number A1, A2, A3 provided by 3-bit up counter. The circuit for 3-bit counter has already been provided in CCT file on Google Classroom, so there is no need to design the up counter yourself. The animation will appear on the top four lights of the LED display of Figure, i.e., on X1, X2, X7, and X6, going clockwise as...
Create a schematic of a circuit using and write C program to run on a PIC...
Create a schematic of a circuit using and write C program to run on a PIC 16F88 that will flash between a red and green LED at 5Hz with the green on 75% of the time and the red on 25% of the time.
//----------------------------------------------------------------- // Counts the number of odd, even, and zero digits in an integer // input...
//----------------------------------------------------------------- // Counts the number of odd, even, and zero digits in an integer // input value. Repeat as long as the user wishes to continue //----------------------------------------------------------------- public static void main(String[] args) {     // Declare the identifiers final int SENTINEL = -99;    // Declare the remaining identifiers ... Scanner scan = new Scanner(System.in);    // Display the programmer's information              // Input an integer number          // Count the number of odd, even, and...
Design and implement a function which has one input parameter which is a number which is...
Design and implement a function which has one input parameter which is a number which is greater than 50, called num. Then the function will create a dictionary whose keys are 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9. Then the function calculates the values for each of the above keys. The value for a key is all the numbers between 2 and input “num” that are divisible by the key. The function...
Design a clipper circuit which will clip off the input above +5 V and below +2...
Design a clipper circuit which will clip off the input above +5 V and below +2 V. You may use any of the following components 1) Diodes with forward drop of 0.7V 2) Zener Diodes (Ideal) of any breakdown voltage 3) DC voltage source (any value) (Please provide all steps in detail. I wish to study using them)
a) Design and implement a combinational circuit that converts excess-3 to BCD code using 2-input NAND...
a) Design and implement a combinational circuit that converts excess-3 to BCD code using 2-input NAND gates. (Design: means show all the steps) b) Draw the logic diagram of 2x4 decoder using NOR gates only. Include an enable input. (describe in details) c) Construct a 5-to-32-line decoder with four 3-to-8 decoders with enable and a 2-to-4-line decoder. Use block diagrams for the components. (Describe in details while you are constructing the required circuit) d) Design a 2-bit multiplier using a...
Design and implement a sequential circuit that counts from 0-3 in a repeating cycle with two...
Design and implement a sequential circuit that counts from 0-3 in a repeating cycle with two inputs: step and reset. If the step input is 1 the count progresses to the next value, if 0 you stay at the current value. If the reset input is 1 the count returns to 0, if 0 it has no effect. If both step and reset are 1, reset takes precedence. Use J-K flip flops in your design and follow the design process...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT