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 16F88 Serial Communication

Status
Not open for further replies.

kashif_uet

Newbie level 5
Joined
Feb 7, 2008
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
Dear All Hi!
I am new on PIC controller and currently i am using following software

:arrow: mikroC, mikroElektronika C compiler
for Microchip PIC microcontrollers
Version: 8.1.0.0


The problem i have faced is that my code works good with Proteus, I have attached my code & proteus File as well. But in real time (on hardware) i am not able to communicate properly. According to my code the controller must wait till i send any charater and once character recieved it must reply that character back where as on recieving charater "s" the controller will not further recieve any data i.e. exits from the loop. But in real time (on hardware) it overlook the condition of Usart_Data_Ready() and contiously send zero (0) data.

I have applied 4.5V to PIC16F88 and using baudrate of 57600, some where i read that for higher baudrates supply voltage must be greater then 2.7 and less then 3.3.

Guide me how i could check or make sure that internal oscillator is @ 8 MHz.

My CONFIG word is 0x2F71 and OSCCON is 0x70.

Code:
My Code:-

int i = 0x4B;

void main()
{
  OSCCON = 0x70;
  ANSEL = 0;
  CMCON = 0x00;
  Usart_Init(57600);

 while(i != 0x73)
 {
  if(Usart_Data_Ready())
    {
      i = Usart_Read();
      Usart_Write(i);
    }
 }
}

Thanks in anticipation.

Kashif :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top