AVR C
EASY PIC'n Book

US$29.95

PIC'n up the Pace Book
PIC'n up the Pace Book
US$34.95

PIC'n Technique Book
PIC'n Technique Book

US$34.95

SERIAL PIC'n Book
SERIAL PIC'n Book

US$49.95

Programming & Customizing PIC Micro
Programming & Customizing PIC Micro
US$31.96

Design with PIC Micro
Design with
PIC Micro
US$50.00

blitzlogic










       APPLICATION #2 TWO 7 SEGMENT LED & 2 SWITCHES  

Since we can source a maximum of 20mA per pin for PORTB and total maximum source current of PORTB is 100mA, hence we can use PORTB to drive LED display directly. As shown in the circuit, 2 common cathode 7-segment LEDs are connected to PORTB with 120 Ohms current limit- ing resistor. Each segment of two LED are tied in parallel to P1. Q1 and Q2 are activated by logic high of PA0 and PA1 which switch on ground to the respective common cathode pins. PA2 and PA3 pin are use to read the inputs S1 or S2 switches.

Low Cost PIC C Compilers ?                   PCM C from CCS, USA ~US$99  


The following code, 7-SEG.C demonstrate how to drive two 7-segment LEDs. The program first display digits on the Left LEDs and counts from 0 to 9 with a delay of 1 second between each digit. Then it switches to the Right LED and repeats the same tasks and then the whole sequence is repeated all over again from the beginning.

   GET DEMO CCS C Compiler NOW ?     PCW C - for PIC16C61 1K code only ! *****  


EXERCISES

Assignment 1 :
The two 7-segment LED now is made to display 00 simultaneously and starting counting up automatically by incrementingby one with a one second delay between each increment. When count reach 99, it should reset itself to 00 and repeat all over again

Assignment 2 :
This is a modification to Asignment 1 where the increment by one is executed only when S1 switch is pressed. When the switch is released, the increment stops. When S2 switch is pressed, it initiate a decrement by one. When count is 99, and S1 is pressed, it becomes 00. When the count is 00, and S1 is pressed, it will becomes 99.

Navigation Bar

BLITZLOGIC SDN. BHD.
sales@blitzlogic.com