Continue to Site

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.

[PIC] pic RX line time out require

Status
Not open for further replies.

pmbhalani

Newbie level 2
Newbie level 2
Joined
Jun 1, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
18
Dear All,

I have two PIC micro controller for UART communication As progamed below,


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
void main() {
char p;
trisb=0xff;
delay_ms(1000);
UART1_Init(9600);               // Initialize UART module at 9600 bps
Delay_ms(100);                  // Wait for UART module to stabilize
 while(1)
 {
    p = portb;
    UART1_Write(p);
    Delay_ms(1000);  
  }
}



And second program


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void main() {
char p;
trisb=0x00;
UART1_Init(9600);               // Initialize UART module at 9600 bps
Delay_ms(100);                  // Wait for UART module to stabilize
portb = 0;
while(1)
{
if (UART1_Data_Ready() == 1) {
p = UART1_Read();
}
  // UART1_Write_text(p);
   portb = p;
   portd = 0;
   Delay_ms(500);
   portd = 0xff;
  }
}



i want to blink port D continuous in second micro controller how i can blink port d, because second microcontroller continuous monitor serial port how to pass it,

Please help me,

i am not expert in microcontroller,
 
Last edited by a moderator:

i want to blink port D continuous in second micro controller how i can blink port d, because second microcontroller continuous monitor serial port how to pass it,
You can make the changes as shown..Try out this code and let me know what happens....
Code:
void main() {
char p;
trisb=0x00;
UART1_Init(9600);               // Initialize UART module at 9600 bps
Delay_ms(100);                  // Wait for UART module to stabilize
portb = 0;
while(1)
{
if (UART1_Data_Ready() == 1) {
p = UART1_Read();
}
  // UART1_Write_text(p);
   portb = p;
   portd = 0;
   {portd = 0xff;
 Delay_ms(500);
   portd = 0x00;
Delay_ms(500);
}
      
  }
}
 

You can blink portd continuously by activation interrupt ( RCIF , RCIE )
 

set uart receiving interrupt
at the interrupt vector you can check received data and save on register

rest of time you can implement portd blinking

hoped this will help you
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top