Home > other >  The old man how to programming with c language
The old man how to programming with c language

Time:03-15

one Requirements
Make it an electronic clock, using digital tube display points, six seconds,
two Objective
1. Further master the use of timer and programming methods,
2. Learn the elements of the seven segment digital display digital,
3. Master with a section of the latch, a bit latch also revealed a number of digital technology,
3. The principle of
1. Dynamic display is a one to take turns to light up display various (scan), use P1 mouth for a period of lock
Storage is used, the P2 mouth as a latch,
2. The use of the timer 1 timer interrupt, walking control electronic clock, using digital tube display points, six seconds, made a
Electronic clock, display format is: (points) - xx xx (in seconds)
Timing time constant calculation method is: the timer 1 work in mode 1, crystal vibration frequency of 12 MHZ, so the timing of initial value for X:
Machine cycle=12 members present crystal frequency=12/(12 x 106
)=1 del.icio.us (216 -) X X 1 X 10-6=0.05, can be obtained by X=15536
Into hexadecimal X=3 cb0h, so the timing of initial value of TH1=3 ch, TL1=B0H
3. The experimental wiring will be P1 mouth P1.0 ~ P1.7 with six digital tube LED1 ~ LED6 section of the line is linked together, P2.0 ~ P2.5 with six digital
Tube connected to a line,

CodePudding user response:

School curriculum should have relevant knowledge, want me to teach 2 slices without latch, with 1 piece of latch can be done? Have a code and videos,

CodePudding user response:

Look from the topic should be 51 lie to chicken, egg can participate

CodePudding user response:

1. After you choose the right microcontroller model, has 16 normal IO MCU drive digital tube is enough, then draw a schematic diagram with drawing software, you it's not for real, direct Proteus simulation, or the Multism
2. Write your program on the keil software, a very simple function, 51 microcontroller will do the trick, T1 timing, external low frequency high precision clock, the clock you make error should be not more than 1 s/24 h.

CodePudding user response:

Don't suggest you use the latch guo sent way, use a timer 0, it was very convenient to as to how long are you going to write you into a set time,

CodePudding user response:

Don't suggest you use the latch guo sent way, use a timer 0, it was very convenient to write a T0 interrupt a month's time is very easy to do,
  • Related