On the Design of Flashing Lamps Using 51 Single Chip Microcomputer

1. Circuit diagram

On the Design of Flashing Lamps Using 51 Single Chip Microcomputer

A diode lights up at a current of 3mA to 10mA, and diodes have a voltage drop of 1.6V to 1.7V.

2. Light the diode:

(1) Bit operation: sbit led0=P0^0; led0=0;//assignment of single bit

(2) Bus operation: P0=0xfe;//11111110 The entire 8-bit pin is assigned together

3. Software Simulation:

Click the d icon on the toolbar, double-click on a line to set a breakpoint; to use software simulation to view the execution time of a statement, be sure to set the crystal frequency in the Options for target -> target-”Xtal(MHz) to Microcontroller The frequency is the same. (Machine cycle = 12 * crystal oscillator cycle = 12 * system clock cycle, the higher the crystal frequency, the faster the microcontroller execution speed, the frequency of 11.0592M is generally used for serial communication between the microcontroller and the microcontroller or the host)

4. 51 MCU 31-pin EA, when connected to a high level, read the instruction execution from the on-chip memory; read the off-chip memory when the level is low.

5. 51 single-chip microcomputer P1, P2, P3 have pull-up resistors, and P0 no, so, in order to make P0 as a normal I / O port, you need to add pull-up resistors (such as exclusion).

6. After some compilers have finished compiling, they will automatically loop your program in an infinite loop. If you want the program to stop after a certain statement, add “while(1);” after the statement.

7. #include function _crol(k,1) /* for shift assuming that k is 11111110 and k is 11111101*/ after function execution.

8. After the 51 MCU is powered on, the default I/O port status is high.

Absolute Encoder

Absolute rotary Encoder measure actual position by generating unique digital codes or bits (instead of pulses) that represent the encoder`s actual position. Single turn absolute encoders output codes that are repeated every full revolution and do not output data to indicate how many revolutions have been made. Multi-turn absolute encoders output a unique code for each shaft position through every rotation, up to 4096 revolutions. Unlike incremental encoders, absolute encoders will retain correct position even if power fails without homing at startup.

Absolute Encoder,Through Hollow Encoder,Absolute Encoder 13 Bit,14 Bit Optical Rotary Encoder

Jilin Lander Intelligent Technology Co., Ltd , https://www.jllandertech.com