I am interfacing an led with via serial port. I have set up the serial port already.
I have a display with these specification parameters: baudrate:2400 data:8 bits end code:1bit
I am trying to display the test code which comes in the following format: "10"+"01H"+"0FFH"
I tried printf but didn't work: printf("10"+"0x01"+"0x0FF"); Any suggestions??
10x
"I am interfacing an led with via serial port."
What, exactly, do you mean by that?!
It sounds like this is not just a single LED, but some display module - is that right?
You need to give details!
"I am trying to display the test code which comes in the following format: "10"+"01H"+"0FFH"
What exactly do you mean by that? Is that supposed to be a 17-character string consisting of a double-quote followed by a '1' followed by a '0', etc...? Or is it supposed to be the 2-character string "10" followed by the 3-character string "01H" followed by the 4-character string "0FFH"? Or is it supposed to be three bytes having hex values 10, 01, FF? Or what?!
"I tried printf but didn't work: printf("10"+"0x01"+"0x0FF"); Any suggestions??"
First, you need to get a 'C' textbook - that printf call will certainly not print what you are hoping for!
Then take a look at the Keil example for using printf on the 8051: http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm
sorry for that missed some details in my prev post:
I am interfacing 8051 to an LED display module.
What i mean is that according to the display's protocol the format to display its test code is: "10"+"01H"+"0FFH"
"10":Leading code "01H":testing code "0FFH":end code
if i were using assembly to write to serial port i would use MOV SBUF,#B;
to write to serial port using C u use putchar() but thats for a single character only right? My question is what do i do for the test code format above??
My guess is that you want to send the character '1' followed by the character '0' followed by the hexadecimal value 0x01, followed by the hexadecimal value 0xff. Just remember that you must check that the UART is ready for more characters before writing a character to SBUF.
test code which comes in the following format: "10"+"01H"+"0FFH"
No, it doesn't, because that's no format. It's gibberish. You apparently ripped a possibly useful description out of its context so thoroughly that there's nothing useful left for anybody to work with. What do you mean by '+'? What are all those "quotes" doing there, and what's the difference between values with a trailing 'H' and those without it?
If i were using assembly to write to serial port i would use MOV SBUF,#B;
And what on earth would #B have to do with "10"+"01H"+"0FFH"?
Mov SBUF,#B is just an example of how one can write to a serial port using assembly it has nothing to do with "10"+"01H"+"0FFH".
My difficulty lies in how to send information to serial port using C.
Can I in anyway upload the protocol pdf file for u to clearly see what i mean?
As I said to you initially, you need to start with a 'C' textbook.
There are some suggestions here: http://www.keil.com/books/ www.8052.com/books.phtml
Then you need to study the Keil manuals, and take a look at the Keil example for using printf on the 8051: http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm
No, but you could provide a link to it.
But it certainly sounds like you should lay this aside for a while, and first spend some time learning the basics of 'C', and then then specifics of Keil C51 for the 8051.
You need to lay the foundations before you start building!
Hi Andy,
10x for advice I will have a look at the links u sent me.
Unfortunately the protocol was sent to me by the manufacturer in pdf format via email got no link for it.
If you don't understand the protocol, then you need to ask the manufacturer about that - especially as you are already in email contact with them!
If you can't clearly explain here what you need to send to the display, how are you going to be able to implement that in any programming language?!
"the protocol was sent to me by the manufacturer in pdf format via email"
What manufacturer? Don't they have a website? What is the full part number of the display you're using?
This is the model:M500N-7X80RG2. Below is a link to the user manual for PC and remote operations:
www.batteryspace.com/.../User Manual.pdf
Andy,is it possible to send u the protocol via email pls? If its a problem for u dw about it.
"Andy, is it possible to send u the protocol via email pls?"
If you want private consultancy on this, you'll have to pay for it.
Given that the protocol is not published, and has only been sent to you privately by email, are you sure that you are entitled to pass it on to any 3rd parties?
You might like to try getting something like this: www.hhdsoftware.com/.../serial-monitor-lite.html (many similar products are available - including free ones)
That will let you monitor exactly what the PC software is sending to the display. That should help you to understand the protocol...
You seem to have two problems here:
1. Learning the 'C' programming language;
2. Understanding the display protocol.
I suggest that you don't try to tackle them both at the same time - lay one aside until you've mastered the other.
Another software
Docklight - monitoring the serial port
http://www.docklight.de/
enjoy it !!
so what did we have here...razer blades, marias, and now a sales man. I am anxiously waiting for the smoked sardine :) :) :)