Soft_Usart Routine

General discussion on mikroC.
Post Reply
Author
Message
ROGERR
Posts: 3
Joined: 26 May 2005 16:40

Soft_Usart Routine

#1 Post by ROGERR » 26 May 2005 16:46

Is it me or is there a problem with these routines. When I try to compile I get a DIVIDE BY ZERO + other compiler errors!

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

Re: Soft_Usart Routine

#2 Post by zristic » 26 May 2005 17:05

Please post your code.

ROGERR
Posts: 3
Joined: 26 May 2005 16:40

Re: Soft_Usart Routine

#3 Post by ROGERR » 26 May 2005 19:14

zristic wrote:Please post your code.
void main()
{
Soft_Uart_Init(&PORTB, 1, 2, 9600, 0);
}

I have tried various processors!

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

Re: Soft_Usart Routine

#4 Post by zristic » 26 May 2005 19:20

That simple? Hmmm.

Have you checked if your clock is not equal to zero?

I will check it tomorrow morning anyway.

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#5 Post by gambrose » 26 May 2005 19:42

This is not a compiler problem but a documentation problem see this post.

http://www.mikroe.com/forum/viewtopic.php?t=1481

use:

Code: Select all

void main()
{
     Soft_Uart_Init(PORTB, 1, 2, 9600);
} 
Graham Ambrose

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

#6 Post by zristic » 26 May 2005 20:29

Thanks gambrose, I was just about to start digging into mikroC documentation. You saved my evening.

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#7 Post by gambrose » 26 May 2005 21:53

Glad i could help. :D
Graham Ambrose

ROGERR
Posts: 3
Joined: 26 May 2005 16:40

#8 Post by ROGERR » 27 May 2005 07:52

Many thanks to you both! I was just following the example provided.
Happy coding!

Post Reply

Return to “mikroC General”