- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi! I am only able to receive the last char from the UART and was wondering how can I receive a string from UART
HyperTerminal -> UART -> Terminal 0 (Nios II Console) I am using Nios II C Programming I guess... Please Help Me! Thank You!Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, which board, which NIOS II program, which UART driver ?
In almost programs for beginner ("getting started", tutorials), every time you send a character to UART, it triggers an interruption and copy it to the Nios II Terminal. A string is a suite of characters. So what is the problem ? You want Terminal to print the entire string ? You have to memorize the characters until a Carrier Return is received and after print it to terminal... Regards.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Hi, which board, which NIOS II program, which UART driver ? In almost programs for beginner ("getting started", tutorials), every time you send a character to UART, it triggers an interruption and copy it to the Nios II Terminal. A string is a suite of characters. So what is the problem ? You want Terminal to print the entire string ? You have to memorize the characters until a Carrier Return is received and after print it to terminal... Regards. --- Quote End --- Hi! I am able to receive a string from the HyperTerminal and send it toDE2_115 Altera Board using C Programming but I am unable to detect the carriage return ? i compare it with \r but it didn't get into the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try with '\n'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to compare with the message I get but it still doesn't works...
is there any other way?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you beginner in C program ?
Comparing strings in C is not so easy as comparing integers. Keep in mind that a string in C is terminated by a NULL character '\0' You can compare a suite of characters. Before comparing, just try to simply print the received strings. The output may be buffered. So "printf" seems to not work. You can "force" the print by adding a function that looks like "flush()". could you please tell us what you exactly want to do ?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page