problem interfacing with rs232 Daisy Mp3

Hi,

I'm hoping that someone will be able to help me out. I am trying to interface with the Daisy MP3 player from Teuthis. The instructions say that I am supposed to do this:
"To set track number: send an ascii "t" and then two bytes, high byte then low byte. The second two bytes are not ascii, they are just pure bytes."

so I use:
Serial.write('t');
Serial.write(0,BYTE);
Serial.write(1,BYTE);

I am trying to select track one. What I think is happening is that I am sending a null byte and so the one isn't being printed. Is this the case? Any suggestions?

Thanks,

I am trying to select track one. What I think is happening is that I am sending a null byte and so the one isn't being printed. Is this the case? Any suggestions?

I doubt it. The first numeric byte you send will almost always HAVE to be a zero, if I understand the instructions correctly. Besides, a NULL byte terminates a string, and no mention of strings is being made anywhere here.

What language are you writing in? I would guess in Arduino you would use something like:

Serial.print('t');
Serial.print(0, BYTE);
Serial.print(1, BYTE);

On my computer this sends the byte stream 166 (ASCII 't') 0 1. Have you got your baud rate and serial configuration setup correctly?

Mikal

Mikalhart,

Thanks for the response. I am using arduino. When I use the same code:

Serial.print('t');
Serial.print(0, BYTE);
Serial.print(1, BYTE);

I only get the 't' on the serial monitor, no zero or one. I am using Real Term to monitor the output on the serial port and I am not getting a 't' or any other recognizable characters.

Okay, So I adjusted some settings in my serial capture program and i put the code into a loop like this:

void loop(){
delay(100);
digitalWrite(ledPin, HIGH);
Serial.print('t', BYTE);
delay(100);
Serial.print(0, BYTE);
delay(100);
Serial.print(1, BYTE);
delay(100);
digitalWrite(ledPin, LOW);
delay(3000);

the serial monitor on the arduino program shows 'tttttttt.. etc' and the serial monitor on my PC shows this "FE C6 C6" then with the next sending of the loop it shows "C6 FE FE". It looks to me like the data isn't being translated properly.

Hmm.. When I run your code on my (Windows) Arduino monitor I see

t**t**

where * is that little box character indicating that the character is unprintable.

Have you made sure that your serial ports on configured correctly on both ends?

That is interesting. I am using 9600 8N1 on my serial monitor. I am not sure what the arduino is sending. I know that it is 9600 and 8N1 seems to be the standard.

Another interesting thing is that my character count on the serial capture program goes up by two not by one for each character. I am guessing that is an indication of a problem

If you Serial.println("Hello, world") does that work?

Mikal

Nope,

I get the following: 27748

when I do Serial.println('hello world');

Oops,

Too much actionscript. I do get hello world when I do: Serial.println("hello world");

I was not using the full quotes just the '