953 views|4 replies

4

Posts

0

Resources
The OP
 

About the Common Anode Light Emitting Diode and Bit Operation in Single Chip Microcomputer [Copy link]

As shown in the figure, this is a common anode light emitting diode, that is, the positive pole of the light emitting diode is connected to the positive pole of the power supply (the common cathode is the negative pole of the light emitting diode is grounded). In the single-chip microcomputer, when operating the common anode light emitting diode, if you want to make the LED light up, the IO port should output a low level, otherwise if you want to turn off the LED, the IO should output a high level. The principle of the common cathode light emitting diode is the same.

Supplementary information on bitwise operations in microcontrollers:
Left shift << is used to shift all binary bits of a number left by N bits, discard the high bits, and fill the low bits with 0.
Right shift >> shifts all binary bits of a number right by N bits, and the low bits moved to the right end are discarded.
Bitwise AND & If both corresponding binary bits are 1, the result value of the bit is 1, otherwise it is 0.
Bitwise OR | As long as one of the two corresponding binary bits is 1, the result value of the bit is 1, otherwise it is 0.
NOT ~ Inverts the binary

Latest reply

Because there are many driver ends of digital tubes, if all of them are directly connected to the microcontroller, it will take up too many resources. Sometimes we choose to send data serially and use other hardware to realize display. At this time, we can consider using left shift and right shift to send display data outward.   Details Published on 2023-3-17 11:50
 
 

12

Posts

1

Resources
2
 
Great post, hope you can share more good information like this.
 
 
 

46

Posts

0

Resources
3
 

Is there any relationship between common anode LEDs and bitwise operations?


 
 
 

4771

Posts

12

Resources
4
 

According to the address operation, left shift, right shift and inversion are very basic and useful. I have learned it. Thanks for sharing.

 
 
 

210

Posts

3

Resources
5
 

Because there are many driver ends of digital tubes, if all of them are directly connected to the microcontroller, it will take up too many resources. Sometimes we choose to send data serially and use other hardware to realize display. At this time, we can consider using left shift and right shift to send display data outward.

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list