1

General discussion on mikroC.
Locked
Author
Message
zubairaw
Posts: 16
Joined: 13 Nov 2008 11:45

1

#1 Post by zubairaw » 11 Aug 2009 10:53

1
Last edited by zubairaw on 31 May 2010 17:56, edited 1 time in total.
zubairaw

pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

#2 Post by pwdixon » 11 Aug 2009 13:23

try changing the count to type char.

to check overall coms try usart_write('x')

CVMichael
Posts: 239
Joined: 30 Apr 2009 02:36
Location: Canada, Toronto

#3 Post by CVMichael » 11 Aug 2009 13:24

What do you mean by "only zero in decimal is receicved" ?


zubairaw
Posts: 16
Joined: 13 Nov 2008 11:45

#5 Post by zubairaw » 11 Aug 2009 17:58

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.
zubairaw

CVMichael
Posts: 239
Joined: 30 Apr 2009 02:36
Location: Canada, Toronto

#6 Post by CVMichael » 11 Aug 2009 18:29

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.

zubairaw
Posts: 16
Joined: 13 Nov 2008 11:45

#7 Post by zubairaw » 12 Aug 2009 06:21

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.
zubairaw

CVMichael
Posts: 239
Joined: 30 Apr 2009 02:36
Location: Canada, Toronto

Re: 1

#8 Post by CVMichael » 17 Jun 2010 18:07

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 ???

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: 1

#9 Post by zristic » 17 Jun 2010 19:22

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...

Locked

Return to “mikroC General”