kashif_uet
Newbie level 5
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.
Thanks in anticipation.
Kashif
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