Previous in Forum: Short Circuit Protection at Downstream Converter/Inverter   Next in Forum: Bonding Jumper
Close
Close
Close
29 comments
Rate Comments: Nested
Power-User

Join Date: Nov 2010
Posts: 277

Program in C for 8051 Propeller Display

01/30/2011 8:41 AM

I need to feed a program in C into the 8051. The basic idea of the project is that an LED array rotates, and the LED sequence makes a particular string of characters displayed.

I am using the port 1 as the LED display, and the port 3 to connect through RS 232 to the comp from where I would enter the string. Can anyone guide me how I would do this connection from the microcontroller to the computer?


I understand the logic of the LED sequence (with delays) that must be displayed for each characters. But how do I get the micrcontroller to READ a particular entered string from a keyboard of the comp.

If I could know a program to do that, It could serially read and the program could direct it to the function of a particular alphanumeric. For instance if I have string "ST", it would go to a defined function:

void code_S (void)
{
P1=0x(1st hex value for LED sequence);
delay(ms);
P1=0x(2nd hex value for LED sequence);
delay(ms);
..
..
P1=0x(nth hex value for LED sequence);
delay(ms);
}

and then go to a function to display "T" like:

void code_T (void)
{
P1=0x(1st hex value of LED sequence);
delay(ms);
P1=0x(2nd hex value of LED sequence);
..
P1=0x(nth hex value of LED sequence);
delay(ms);
}
.

But my question is by what program could I get the microcontroller to read "ST" and branch into these functions? The return values and arguments are also void right?

Would like some help.

Thanks and regards,
Jay.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Jul 2008
Posts: 1688
Good Answers: 145
#1

Re: Program in C for 8051 Propeller Display

01/30/2011 8:12 PM

A UART and RS-232 to logic level translators is what you need. Depending upon what chip you have you may or may not have a UART on the processor chip. The UART will translate the serial stream to something you can use (parallel, I2C, whatever).

I'm assuming you don't know about UARTs. Beyond giving you the term to Google you pretty much have to do the rest of the work yourself.

__________________
Few things limit our potential as much as knowing answers and setting aside questions.
Register to Reply Score 1 for Good Answer
Member

Join Date: Aug 2010
Location: India
Posts: 6
#2

Re: Program in C for 8051 Propeller Display

01/31/2011 3:37 AM

Jay You need to know Hardware concept of scanning LED Display. Then you got toknow timer. Develop basic concept of yours to scan LEDs to display, that is fixed pattern. Say all LED on, All Off, Alternate on and off..... C programming is simple and far off. Hardware and physicality of job is prim and first on time scale. Best luck.

Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#4

Re: Program in C for 8051 Propeller Display

01/31/2011 10:13 AM

I have the connections in circuit diagrams. I have uploaded these, see if they say anything to you guys about the project. Even though this shows a two port microcontroller, I am using 8051. But I don't see any difference that would come, it would just mean Port 0 and Port 2 aren't connected. Am I right?

I got a 200 rpm motor, and the crystal of the microcontroller 6 MHz. I can get a program to keep the motor speed at 150 rpm. And I think could also use the MAX 232 IC to connect to the computer to input the string.

The general idea I have is that a sequence of LED pattern will switch on, of at every interrupt of the interrupt module. But I need a program now to read the string entered serially and display the LED pattern for the alphanumerics at every interrupt from the interrupt module.

Try and make sense of it through the circuit diagrams and pics I have uploaded.

MAIN CIRCUIT (LED ARRAY connected to Port 1, Interrupter to Port 3).

INTERRUPTER

MAX 232

ROTOR ASSEMBLY

Thank you all for your efforts in helping me through this,

Jay.

Register to Reply
Anonymous Poster
#5

Re: Program in C for 8051 Propeller Display

01/31/2011 10:16 AM

Thanks Andy. I posted my reply just before you posted yours. I will check it up. =)

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#6

Re: Program in C for 8051 Propeller Display

01/31/2011 10:34 AM

Check out this link about RS232 interfacing to an 8051 (includes C examples for character I/O).

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply Score 1 for Good Answer
Power-User

Join Date: Nov 2010
Posts: 277
#7

Re: Program in C for 8051 Propeller Display

02/01/2011 5:40 AM

Thanks John, that link is helpful. First time Im programming a micrcontroller, you guys are being really helpful.

I will buzz this topic back if I have any doubts or questions. Thanks for all, once again.

Regards,

Jay

Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#8

Re: Program in C for 8051 Propeller Display

02/02/2011 8:15 AM

Hi John,

Your link was helpful. It gives a program to send a string to the serial port which is what I am looking for. The program in your link only displays "I AM MAHESH". We would have to get to the program to put a new string right? But what if I want the string to be entered by the user and not be part of the program? Can I use scanf?

Secondly, I got a 6MHz crystal is that okay?

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#9
In reply to #8

Re: Program in C for 8051 Propeller Display

02/02/2011 7:11 PM

scanf() should work - alternatively you could use getchar() to build the string character-by-character.

Are the strings coming from a PC?

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#10

Re: Program in C for 8051 Propeller Display

02/02/2011 7:17 PM

Basically as I see it this project has a flow as follows:

1. Input alphanumeric from keyboard - For this I can use the MAX232 and connect as the John's link showed.

2. Allow the micrcontroller to store the alphanumeric entered after entering. As you said John, I can enter it through getchar(); Yes, the string is coming from a keyboard.

3. Read the alphanumeric string serially (one character at a time) and display the LED pattern for each - I have done the LED patterns which will be displayed by the LEDs connected to Port 1, but how do I get a program to read the string one character at a time? From here I can branch it to a switch statement for displaying the LED pattern of which ever alphanumeric it is right?

4. Program to indefinitely repeat the LED code when the interrupt beam cuts in the next revolution of the motor, till a keyboard interrupt is applied.

Have I got this right? Have I missed anything?

Regards and thanks,

Jay.

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#11
In reply to #10

Re: Program in C for 8051 Propeller Display

02/03/2011 3:29 AM

Not around much today - out on a service job.

In short, use getchar() repeatedly to read the incoming characters into an array of type char. You can then just loop through it, taking one character at a time and passing it to the decode (switch statement) and display procedures.

To make life easier while getting it working, I'd suggest using a couple of characters as string delimiters - e.g. # and *. Your input procedure would use getchar() until it finds a "#", then store all input in the array until it gets "*".

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#12

Re: Program in C for 8051 Propeller Display

02/03/2011 5:26 AM

Hey John, thats okay take your own time. I already appreciate it that you are helping me willingly, because I can't honestly do this alone. So thanks you and other who've contributed too. I have typed this program and think it may be the function (part of the main program) to read and display the string. I am almost certain it would have errors in it, or even be completely wrong. So here goes:

=======


void read_n_display()
{
unsigned char c[19];
int i;

for (i=0; i<20;i++) // Thought it should display only max 20 char ignore the rest
{
c[i] = getchar();
enum c
{
A = 1,
B = 2,
C= 3,
D = 4,
..
..
Z = 26,
'!' = 27,
'.' = 28,
};

switch (c)
{
case 1:
code_A(); // code_A etc defined outside the for loop.
break;

case 2:
code_B();
break;
...

case 27:
code_wow(); // code_wow (for exclamation mark) also defined outside for loop
break;

case28:
code_dot(); //code_dot is for period/full-stop
break;

case '0':
code_zero(); // code for zero defined outside loop like all others
break;

case '1':
code_one();
break;
...
...
...
default: // displays blank spaces
code_blank(); //no values of LED till the next IR beam cuts module


} // end of switch
} // end of for loop
} // end of read_n_display


void code_A() // the function for LED sequence for "A" displayed at port 1
{

P1=0x00;
delay(prev_space); //distance from previous character displayed
P1=0x3E;
delay(d); // prev_space, d are unsigned int defined at main()
P1=0xA0;
delay(d);
P1=0x90;
delay(3*d);
P1=0xA0;
delay(d);
P1=0x3E;
delay(d);
}

void code_B()
{
..
}

..
..
..
..
void code_one() // the function for LED sequence for "1"
{
P1=0x00;
delay(prev_space);
P1=0x02;
delay(d); // function delay(unsigned int); defined separately
P1=0x42;
delay(d);
P1=0xFE;
delay(d);
P1=0x02;
delay(2*d);
}

====

Is this right for getting the character string and then displaying the code? I think the function read_n_display(); should itself be inside another while loop (continuous) which repeats the function when the IR beam from MOC7811 is cut at every revolution (see the pic given below).

ABOUT DELAY

I need to decide on the values of the delay "d" and I have decided that "prev_space" will be half of the delay "d". Their values are obviously dependant on the rpm of the motor. The motor I got has a 200 rpm, but I am not sure how much it will reduce after I mount the LED array and all over it.

Another question I had is about the delay, which I define using nested for loops. I was going to define the function like this:

void delay (unsigned int ms) // defining the delay function
{
unsigned int i, j;
for (i=0; i<ms; i++) // The value "ms" depends on the msecs of delay required
for (j=0; j<x; j++) // The value "X" is the question here.

}

Given that I am using uC 89V51RD2BN, with a 6 MHz crystal, what should be the value of x, if I want the delay to be almost precisely "ms" milliseconds?

Apart from that where do I type in the commands like TMOD = 0x20; TH0 = 0xFA; SCON = 0x50; for the baud rates and all, auto-relaod mode etc. Those will be part of the program too right because we are using a keyboard to input the string?

Regards,
Jay.

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#13
In reply to #12

Re: Program in C for 8051 Propeller Display

02/03/2011 7:07 PM

Just a quick word here, but in answer to: "Is this right for getting the character string and then displaying the code?" - IMHO this isn't the best approach.

Here's a quick bit of pseudo-kinda-code which I think would be more appropriate:

unsigned char DisplayString[19];

main{

unsigned char BufferString[19];

get character from serial input

if Start_character then set input pointer to start of BufferString, then loop

if End_character then copy BufferString to DisplayString, then loop

put character in BufferString and increment pointer

}

OptoInterrupt{

display whatever's in DisplayString

}

Haven't used C in anger for about 15 - 20 yrs. Sorry about syntax etc. - getting old.

Point I'm making is to split up the keyboard input stuff (which can get characters anytime) from the display stuff (which must be synchronous with the rotor).

More thoughts tomorrow pm.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#14

Re: Program in C for 8051 Propeller Display

02/05/2011 4:58 PM

I am not sure I understand your previous reply John. But thanks. Could anybody comment on the program I typed in my previous post here?

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#17
In reply to #14

Re: Program in C for 8051 Propeller Display

02/06/2011 4:40 PM

Not commenting on your code, Jay, there's more than one way to skin a cat.

What you must grasp, is that there are two mutually asynchronous processes here.

Task 1: Read input from keyboard, build string of characters to be displayed. If terminating character, copy to "stuff_buffer" and start again.

Task 2: Use rotating LEDs to display stuff from "stuff_buffer" (I'm not sure from your descriptions about exactly what you want to display).

Task 1 can happen any time - you never know when someone will press a key, and you know it won't be very often (compared with the rotation period of your LED array).

Task 2 must start when the photo-switch triggers it - otherwise the display would be scrambled.

My suggestion is to use the keyboard input function within main{}, and to use another process (started by an interrupt) when the optosensor senses the start of a rotation) to perform the display functions.

So you have:

main{

get a character from the keyboard;

if (it's a START character), clear the input string buffer;

if (it's an END character), copy the input string buffer to the display string buffer and clear the input string buffer

if (neither of the above), add the character to the end of the string

}

Then, a procedure which must start when the optosensor triggers it:

display{

Take the characters in the input buffer, and for each:

calculate (which LEDs should be on for this character at this time), turn on the LED's accordingly

}

Hope this helps.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#19
In reply to #17

Re: Program in C for 8051 Propeller Display

02/07/2011 5:24 AM

Correction.

"display{

Take the characters in the input buffer, and for each:"

should read

"display{

Take the characters in the display string buffer, and for each:"

Sorry.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#15

Re: Program in C for 8051 Propeller Display

02/06/2011 5:03 AM

I am sure that there is some good expertise here for the8051 and its derivatives, but surely its has been mainly superceded by more modern and even cheaper chips like the many PICs now available. Also the knowledgeable people do not seem to be here much either and you do not have the knowledge yourself....

PICAXEs (there are many different chips available today, this is just one of them!)are available with many different configurations, with such fast basic that you could even write your program in basic first and test it on the special free software supplöied.....they start with prices under $2 each for the simple chips.....

If I was building such an object today and did not have much of an idea myself, I would first build one of the many examples I posted for you and THEN and only THEN, I would try and strike out on my own.....changing the processor, improving the software etc...

Sorry to be so negative in this matter.....but you appear to be floundering and the expertise/help you need is seemingly not available here on CR4....

Best of luck......

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#16

Re: Program in C for 8051 Propeller Display

02/06/2011 10:14 AM

Thats okay Andy, you didn't sound negative. What you say may be the truth of the matter. I will check this place and try getting help for this from other places too. Thanks for all your efforts all of you.

Regards,

Jay.

Register to Reply
Member

Join Date: Aug 2010
Location: India
Posts: 6
#18
In reply to #16

Re: Program in C for 8051 Propeller Display

02/07/2011 4:54 AM

I hope This may help you: /*-----------------------------------------------*/ /* Assumptions: 8051 with Dots_In_Circumferance = 100 bytes of xdata available on chip You Know time for 1 revolution. You will devide 1 Revolution time by Dots_In_Circumferance = T_Dot You will initialize T0 timer to produce interrupt @T_Dot time This is first proto. If you succeed, we can interface Opto interrupter and make pattern steady by adding more logic The next will be lookup tables and receiving data via UART */ #define Dots_In_Circumferance 100 /* Assuming Circle is devided in 100 Parts */ /* Modify to your requirement */ unsinged char xdata Dot_Buf[Dots_In_Circumferance]; unsigned char Dot_Counter; void T0_Interrupt(void) INTERRUPT 1 { // Reload TL0, if needed P0 = Dot_Buf[Dot_Counter]; Dot_Counter++; if(Dot_Counter > Dots_In_Circumferance) Dot_Counter = 0; } void init_Variables(void) { Dot_Counter = 0; } void Fill_Dot_Buf(void) { // To fill Pattern of alternate dot On and off unsigned char m; for(m=0; m<Dots_In_Circumferance; m++) { Dot_Buf[m] = 0xAA; m++; Dot_Buf[m] = 0x55; } } void main(void) { Init_Variables(); Fill_Dot_Buf(); // initialize T0 to produce Timer Interrupt @ 1/Dots_In_Circumferance Sec whlie(1) {}; }

Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#20

Re: Program in C for 8051 Propeller Display

02/07/2011 6:16 AM

Okay John, so this is what you are saying:

main{

get a character from the keyboard;

if (it's a START character), clear the input string buffer;

if (it's an END character), copy the input string buffer to the display string buffer and clear the input string buffer

if (neither of the above), add the character to the end of the string

}

Then, a procedure which must start when the optosensor triggers it:

display{

Take the characters in the display buffer, and for each:

calculate (which LEDs should be on for this character at this time), turn on the LED's accordingly

}

***

So now I understand that I can use a start character as #, or end character as *. But I would it be the user's work to put these start and end characters? Like if I want to display "Jay", would I need to input "#Jay*"? I don't want it that way (if it is that way).

I thought I would do it this way: Any string entered is considered a 20 character string. If I enter "Jay", what would be displayed is "Jay(and space 17 times)". It wouldn't make a difference because the LED sequence value for a space is no LEDs being displayed.

That is why in the switch statement I selected the default as space. This would leave the program to read "J" and then display the LED sequence for J, then read "A" and for A, then read "Y" and for Y. After that it would read nothing and then go to default to put space (remaining 17 times).

If I want to make one thing clear (which I apologize for not probably mentioning earlier) is that the string is displayed not simultaneously as the user inputs it from the keyboard. Its more like a string is entered, when "enter" is pressed the display of that string starts. After that, to enter a new string any keyboard intrrupt needs to be given. It should provide options for displaying a new string or exiting the whole thing.

If the first option, it will take a new string for it to be displayed, if the second option the whole thing is switched off.

Regards,
Jay

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#21
In reply to #20

Re: Program in C for 8051 Propeller Display

02/07/2011 6:46 AM

I was suggesting that you use the start and end characters while developing the system, to make life easier ! Fail. try again:

main{

get a character from the keyboard;

if (already 20 characters in buffer) ignore it;

if (it's an end-of-line character){

if necessary, pad the input string buffer with spaces to make it 20 chars long;

copy the input string buffer to the display string buffer and clear the input string buffer;

}

if (neither of the above), add the character to the end of the input string buffer;

}

A problem you may have with this is determining exactly what the end-of-line character is (i.e. what is generated when "enter" is pressed). It could be CR, LF, both, or something completely different!

Note that if you type "enter" without typing in any characters before it, this will pass a string of 20 spaces to the display buffer, so nothing will be displayed.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#22

Re: Program in C for 8051 Propeller Display

02/16/2011 1:47 PM

John, thanks for your reply. I didn't visit this site for some days. Regarding what you say about the start and end characters, I still didn't (unfortunately!) understand the logic behind it. But apart from that, would it still be okay if there were no start or end characters?

"A problem you may have with this is determining exactly what the end-of-line character is (i.e. what is generated when "enter" is pressed). It could be CR, LF, both, or something completely different!"

I didn't understand what are CR and LF. My idea is that a string is entered, and it displays the first 20 characters (space being included as a character), after "enter" is pressed.

"Note that if you type "enter" without typing in any characters before it, this will pass a string of 20 spaces to the display buffer, so nothing will be displayed."

There is no problem in that actually for me - thats how I want it. That is why I put the default as space in my switch statement.

As long as it wouldn't be an incorrect display its fine, and nothing typed is (to the eye) same as 20 spaces here, I guess. But would there be a problem in anyway?

Once again thank you for your replies, John. Its been really helpful.

Regards,

Jay

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#23
In reply to #22

Re: Program in C for 8051 Propeller Display

02/17/2011 4:57 AM

Forget about start and end characters - they seem to have lead more to confusion than clarification.

No problem about the "20 spaces" - I assumed that was the effect you wanted if the operator just hit the [ENTER] key.

The problem I'm addressing is determining what character (or characters) get sent to the micro when the [ENTER] key is pressed, and how the program in the micro deals with them.

Just to fill you in, CR and LF represent carriage return and line feed. The ASCII codes for these are 0x0D and 0x0A respectively. I hope not to confuse you, but you may benefit from looking at this article:

http://en.wikipedia.org/wiki/Newline

Can we back-track a bit here? Please explain your setup - you have a micro connected to the display hardware, and with an RS232 serial input connection. That's clear.

In your OP (original post) you said the RS232 is connected to a computer. What program are you using on the computer to translate key presses to characters and transmit them via the serial port?

[By the way - I've just spotted a logical error in my post #21. The test for end-of-line should be done before the test for 20 chars in the buffer, otherwise if 20 characters were typed, any more characters, including end-of-line, would never be seen.]

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#24

Re: Program in C for 8051 Propeller Display

02/21/2011 11:27 AM

"The problem I'm addressing is determining what character (or characters) get sent to the micro when the [ENTER] key is pressed, and how the program in the micro deals with them."

Okay. I read the intro of the Newline article. I just want to say that there is only one line being displayed at a time. My description below may explain what I plan to do - its just to display one string at a time. I thought that would be easiest.

"Please explain your setup - you have a micro connected to the display hardware, and with an RS232 serial input connection. That's clear."

Basically, I need to display a string entered (through a keyboard) in a display. Its like this:

I enter just one string, and display it at a time. Then I can connect it to the keyboard again, replace it with a new string and then I get to display that.

The process of string-entering and displaying doesn't have to be simultaneous. Its fine if I can enter a string through the keyboard, store it in the micro and then go ahead to disconnect the keyboard, RS 232, and then display it. To enter another string I would/could connect it again and type it. Having it like this is sufficient. I would have it anyway which is the simplest and easiest.

I wanted a particular key to press so that the process of storing the string into the microcontroller starts, and the program goes to the part of reading the string and displaying what was just entered - I assumed this "particular key" could be the ENTER key.

To display it I would require the microcontroller to serially read the string from the stored location and display its code. I thought I could do this by calling the string something like c[20] and then using the getchar (as you said) in a for loop, to get each character at as the loop plays 20 times. As the micro reads it one character at a time, it display each character's code which is a hex code and is displayed at port 1.

I hope my explaination is clear on what I plan to have.

"What program are you using on the computer to translate key presses to characters and transmit them via the serial port?"

No idea yet actually. I have never done micro programming before, and didn't think that I would require a program for keyboard keys pressed to be translated to characters they respresent on the keyboard. I thought entering anything in the keyboard would get it to the microcontroller through RS 232, and that I would only need a program to STORE it in the micro.

Thanks for helping me John, I am still filled with doubts though. I really appreciate you responding to my queries here.

Regards,
Jay

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#25
In reply to #24

Re: Program in C for 8051 Propeller Display

02/23/2011 5:45 AM

"Basically, I need to display a string entered (through a keyboard) in a display ..."

Do you have a keyboard with an RS232 interface, or are you using a PC? Please get this clear for me.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#26

Re: Program in C for 8051 Propeller Display

02/23/2011 10:50 PM

Keyboard, sorry if I said PC.

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#27
In reply to #26

Re: Program in C for 8051 Propeller Display

02/24/2011 2:17 AM

Good. Your keyboard should've been supplied with a table showing what character is sent via the RS232 for each keypress. So you know the code representing end-of-line.

That was a struggle !

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Participant

Join Date: Jan 2013
Posts: 1
#28

Re: Program in C for 8051 Propeller Display

01/02/2013 9:34 AM

mr. jay
i wanna implement this project nowdid u finally got proper output in this???plz do me a reply ASAP

Thank you

Regards

Raja Ram

Register to Reply
Power-User

Join Date: Nov 2010
Posts: 277
#29

Re: Program in C for 8051 Propeller Display

01/02/2013 10:11 AM

Yes I did. However, we didn't interface it with keyboard. We just had a string displayed in the LEDs.

You just connect all the LEDs to the Port 1 (at P1.0 to P1.7). Make all the cathodes at ground, and all the anodes at the respective terminals. Then connect an interrupt at one of the pins (I did on 3.2). In every revolution this interrupt should be activated by motion of the LEDs

Register to Reply
Register to Reply 29 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Andy Germany (2); Anonymous Poster (1); BruceFlorida (1); Jay_ (12); JohnDG (10); Rajarammaze (1); Vimal Amin (2)

Previous in Forum: Short Circuit Protection at Downstream Converter/Inverter   Next in Forum: Bonding Jumper

Advertisement