multiplexed 7 segment


Posted on Feb 7, 2014

The basic technique is the same like the last lesson except fact that we have added a counter which counts between 0000 and 9999. Our counter increments with 1 second delay. /* ` <7465> * ` Lesson nr. 12: ` Multiplexed 7Segment as counter mode ` Done by: ` Aureliu Raducu Macovei, 2010. ` ` This code demonstrates displaying number on fo


multiplexed 7 segment
Click here to download the full size of the above Circuit.

ur 7-segment display (common ` cathode), in multiplex mode. All 7-segment displays are connected to PORTB ` (RB0. RB7, segment A to RB0, segment B to RB1, etc. ) with refresh via pins ` RA0. RA3 on PORTA. Number is incremented for 1 second. ` To define this project, a counter is added (counts from 0000 to 9999). ` Test configuration: ` MCU: PIC16F628A ` Test. Board: WB-106 Breadboard 2420 dots ` SW: MikroC PRO for PIC 2010 (version v4. 15) ` Configuration Word ` Oscillator: INTOSC:I/O on RA. 6, I/O on RA. 7 ` Watchdog Timer: OFF ` Power up Timer: Disabled ` Master Clear Enable: Enabled ` Browun Out Detect: Enabled ` Low Voltage Program: Disabled ` Data EE Read Protect: Disabled ` Code Protect: OFF ` <7465> * */ //*Header*/ unsigned short mask(unsigned short num) { switch (num) { case 0 : return 0x3F; case 1 : return 0x06; case 2 : return 0x5B; case 3 : return 0x4F; case 4 : return 0x66; case 5 : return 0x6D; case 6 : return 0x7D; case 7 : return 0x07; case 8 : return 0x7F; case 9 : return 0x6F; } } /*Endless mask*/ unsigned short shifter, portb_index; unsigned int digit, number; unsigned short portb_array[4]; void interrupt() { PORTA = 0; // Turn off all 7seg. displays; PORTB = portb_array[portb_index]; // Bring appropriate value to PORTB; PORTA = shifter; // Turn on appropriate 7seg. display; //move shifter to next digit; shifter <<= 1; if(shifter > 8u) shifter = 1; //increment portb_index; portb_index + ; if (portb_index...




Leave Comment

characters left:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    Model rocket launch controller
    Headlight circuit
    Touch Switch I
    Alternate Tone Alarm Circuit
    Stablised Power Supply With Short Circuit Indication
    Oscillator Design Guide Structure
    Fun Game Circuits
    12v iPad Charger
    Quiz Circuit PCB
    Ultrasonic Beam Barrier Circuit
    5 Zone Alarm System



    Top