UART NOT WORKING IN ATMEGA2560

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
pschauhan09
Posts: 1
Joined: 12 Apr 2019 13:42

UART NOT WORKING IN ATMEGA2560

#1 Post by pschauhan09 » 12 Apr 2019 14:02

Hello

I am doing a project on my custom design board with ATMEGA2560.
i am using 16MHz oscillator
Now the problem is that when i try to send something via UART, i got NULL character like 0000000000000... (i am using docklight terminal v2.2).
i am enclosing the image(PFA).
and also the delay_ms() function is also not working. as when i use delay_ms(100).
it will generate way more delay then 100ms.

So plz suggest me so that is can finish my work.
i am posting my code.





void main() {

UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

UART2_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

UART3_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

UART4_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

while (1) {
UART1_Write_Text("Init");

UART2_Write_Text("Init");

UART3_Write_Text("Init");
UART4_Write_Text("Init");


}
}
Attachments
image 1.png
image 1.png (79.19 KiB) Viewed 1702 times

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: UART NOT WORKING IN ATMEGA2560

#2 Post by jovana.medakovic » 15 Apr 2019 11:58

Hello,

I believe I answered you on the ticket, so we can continue the conversation there.

Kind regards,
Jovana

Post Reply

Return to “mikroC PRO for AVR General”