Jun 1, 2015 #1 T thiru1879 Newbie level 6 Joined Feb 5, 2010 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Location India Activity points 1,377 Pl, any body can reply for this, I want to send 8bit data into different port pin of 8051 , for example a=0x06; this is to be displayed D0 on P2.7 and balance to be displayed on P3.2 to P3.7 .
Pl, any body can reply for this, I want to send 8bit data into different port pin of 8051 , for example a=0x06; this is to be displayed D0 on P2.7 and balance to be displayed on P3.2 to P3.7 .
Jun 2, 2015 #2 M milan.rajik Banned Joined Apr 1, 2013 Messages 2,524 Helped 540 Reputation 1,078 Reaction score 524 Trophy points 1,393 Activity points 0 I think you meant Bit 0 to P2.7 and the rest to P3.1 to P3.7. Here is the code. Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 char dat = 0; void main() { P0 = 0x00; P1 = 0xFF; P2 = 0x00; P3 = 0x00; Delay_ms(200); while(1) { dat = P1; P2 = (P2 & 0b01111111) | ((dat & 0b00000001) << 7); P3 = (P3 & 0b00000001) | (dat & 0b11111110); } } broken link removed Attachments Move Data.rar 55.6 KB · Views: 80 move data.png 34.3 KB · Views: 98 Last edited by a moderator: May 22, 2022
I think you meant Bit 0 to P2.7 and the rest to P3.1 to P3.7. Here is the code. Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 char dat = 0; void main() { P0 = 0x00; P1 = 0xFF; P2 = 0x00; P3 = 0x00; Delay_ms(200); while(1) { dat = P1; P2 = (P2 & 0b01111111) | ((dat & 0b00000001) << 7); P3 = (P3 & 0b00000001) | (dat & 0b11111110); } } broken link removed