Page 1 of 1

1

Posted: 11 Aug 2009 10:53
by zubairaw
1

Posted: 11 Aug 2009 13:23
by pwdixon
try changing the count to type char.

to check overall coms try usart_write('x')

Posted: 11 Aug 2009 13:24
by CVMichael
What do you mean by "only zero in decimal is receicved" ?

Re: PIC 4550+ 20MHz + RS232 +PC receives zero only

Posted: 11 Aug 2009 13:58
by zristic

Posted: 11 Aug 2009 17:58
by zubairaw
CVMichael wrote:What do you mean by "only zero in decimal is received" ?
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]

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);
}
but still the output is only zero's on charaters.

Posted: 11 Aug 2009 18:29
by CVMichael
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.

Posted: 12 Aug 2009 06:21
by zubairaw
CVMichael 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.
Thanks 'CVMichael" and "Milan" for your help and coorporation. The code is working with the proper setting of occilator. the setting for this are as

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.

Re: 1

Posted: 17 Jun 2010 18:07
by CVMichael
I am curious why you edited the first post and put "1" in the subject and body of the post ?

[edit]
OMG !! you did that to all your threads ! WHY ???

Re: 1

Posted: 17 Jun 2010 19:22
by zristic
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...