Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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 .
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
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);
     }
}




118055d1433224926-move-data.png
 

Attachments

  • Move Data.rar
    55.6 KB · Views: 6
  • move data.png
    move data.png
    34.3 KB · Views: 11
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top