1
Posted: 11 Aug 2009 10:53
1
The output on communication terminal of MikroC shows continues zeros coming in decimal format. which shows that hardware is OK but the program is not sending the required output.. i have changed the code as per "pwdixon" as [/img]CVMichael wrote:What do you mean by "only zero in decimal is received" ?
Code: Select all
void main() {
CCP1CON= 0x00; // Compare / Capture disable
CCP2CON= 0x00; // compare / Capture disable
ADCON1 = 0b00001001; // Configure analog inputs and Vref
TRISA = 0xFF; // PORTA is input
TRISB = 0b11000011; // Pins RB7, RB6 are inputs
TRISD = 0x00; // PORTD is output
TRISC = 0b00000001; // PORTC is output
PORTA=0x00; // Initializing PORTA
PORTB=0x00; // Initializing PORTB
PORTC=0x00; // Initializing PORTC
PORTD=0x00; // Initializing PORTD
PORTE=0x00; // Initializing PORTE
Usart_Init(2400);
delay_ms(50);
do {
Usart_Write('z');
Usart_Write('u');
Usart_Write('b');
Usart_Write('a');
Usart_Write('i');
Usart_Write('r');
} while (1);
}
Thanks 'CVMichael" and "Milan" for your help and coorporation. The code is working with the proper setting of occilator. the setting for this are asCVMichael wrote:Make sure that boud rate in MikroC is 9600, and other settings are correct.
Go to the link that zristic provided, and make sure the clock is set up properly.
Change the output type to HEX in MikroC (hopefully you can, I forgot if it has that option, I can't check that now), and take a print screen (Alt+PrtScr) and post it here.