Electro Fan, you describe a lot of the details, show us a program, but completely and uttery miss the most important thing: What protocol do you want use?
Assming it's a single serial UART line, and typical 8N1, then you need to send _ten_ bits at a time. First a start bit (always LOW), then eight data bits, which can be whatever you like, and last, but no less important, you send the stop bit (always HIGH).
Hideki, hamster_NZ, and everyone, thank you for your patience and help.
I have attempted to clean up the comments as psycho0815 suggested.
Below is a sketch that produces a
Capital A ASCII character with the decoder. The decoder
displays the bits in Binary as 01000001 (this is how the bits are rendered from left to right on the scope screen with the decoder set to LSB).
I could be mistaken but the Start bit is not only the starting bit but it is also the first data bit. That leaves the next seven bits as the remaining bits in an eight bit byte. Clearly, this sequence produces the Capital A as expected based on the ASCII table. This leaves two more bits (bit #9 is a 1 (LOW) - which I'm not sure of, and bit #10 which is a 0 (HIGH), which presumably is the Stop bit.
So, this conforms pretty closely to what you (Hideki) prescribed in your post (the first bit is the LOW start bit and the last bit is the HIGH Stop bit, and there are 8 data bits (including the Start bit), but what is the 9th bit? I am guessing that it could be a Parity bit - I have my scope set to "None" for parity which conforms to your 8N1.
Also, is the 8th bit (as shown in the sketch below) the MSB (Most Significant Bit)?
Comments? Thanks!
/*
ASCII Generator, Create Capital A
*/
// Pin 13 has an LED connected on the Arduino board.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, LOW); // make the voltage LOW (turn the voltage off) 1 = Start bit
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0
delay(1); // wait for a second
digitalWrite(led, LOW); // make the voltage LOW (turn the voltage off) 1
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0 = MSB?
delay(1); // wait for a second
digitalWrite(led, LOW); // make the voltage LOW (turn the voltage off) 1 = Parity bit?
delay(1); // wait for a second
digitalWrite(led, HIGH); // make the voltage HIGH (turn the LED on) 0 = Stop bit
delay(1); // wait for a second
}