When you say wrong, what do mean ? When you send your data from the pc how is the data formatted ie are they ascii characters '0','1','2' etc or number values 1,2,3,4 interpretation between these values would be different especially when you send them as a string. What is a typical data packet for your code ? Echo back what you receive see if it corresponds with what you transmit. As a note when sending data in this type of format it may be an idea to structure the data in a formal packet start of data header, length of data, end of data and maybe a simple crc, this way you can always validate what you receive, it may seem excessive for these small packets but it is scaleable for larger more complex data sets. Regards --- In AVR-Chat@yahoogroups.com, "aligole_2005" <aligole_2005@...> wrote: > > Hello > I'm doing my final project of university. In a part of this I need to receive a serial data with special structure that I shared it here : > > http://www.4shared.com/file/120420235/3829d17a/Usart.html > > It's briefly a 5 byte formatted data, that every single byte has a meaning for example some of them are numbers, that I wanna show them in a graphic LCD. > > I've written a program in Code vision and I share it here because I think it would be good for you, my friends. > > http://www.4shared.com/file/119286132/69e1cd0/testc.html > > This program consists of two different part, the first is about GLCD functions that I properly can show everything on it, from pictures (bitmaps) to numbers and strings with different functions. > The second part is about the serial data getting and processing. My question is about the final part, when I want to show the received and registered serial data on GLCD, I can't do this properly, actually my numbers are not true!!! > > the registered data is in the shape of a string with the length of 5, that I defined some macros for them. My GLCD function "lcd_put_strs(x,y, *str)" can show a string in SRAM in GLCD. but when I use it, the answer is not true!!! I tried "%u" or "%X" or "%S", but unfortunately the result was wrong. > can anybody help me plzzzzzzzzz? >
Message
Re: Problem in receive a serial data and show it
2009-07-26 by s.holder123@btinternet.com
Attachments
- No local attachments were found for this message.