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);
}
zubairaw
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.
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.
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.
For 20 Mhz crystal
_FOSC_HS_1H Checked
_FOSC_HSPLL_HS_1H Unchecked
_FOSC_INTOSC_HS_1H Unchecked
_CPUDIV_OSC1_PLL2_1L CPU CLOCK EQUAL TO 20 MHZ
_PLLDIV_5_1L 20 MHZ DIVIDED BY 5
_USBDIV_2_1L 48 MHZ FOR USB
And everything goes to normal.
zubairaw
Re: 1
zubairaw,
This is for ban.
We can recover all your posts from the backup, so you accomplished nothing but a ban.
Sorry, you choose your way...
This is for ban.
We can recover all your posts from the backup, so you accomplished nothing but a ban.
Sorry, you choose your way...