[moved] Want to send 8bit data to port pin of 8051, and display at two

Status
Not open for further replies.

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 .
 

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:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…