After reading so many posts concerning line feeds I’m quite certain the SSC-32 requires a carriage return AND and line feed. This is the required terminator. Without it the commands will never be acted on. The fact that the LED is blinking when you send data is a good thing. Because you are using the level shifter then there is no need to invert the data. There may be other problems that I can’t help with. But I’m quite sure about this.
So you are using the Max232, which implies that you are using RS232 level signals. So you should plug in the same cable as you used to connect to the PC into the RS232 connector (9 pin). If yo uconnect directly into the TXD/RXD pins of the SSC-32 board you will need to not use the Max232, but use TTL level signals directly.
The flashing means that it is receiving stuff, not necessarily that it is seeing valid stuff.
Things I would try include:
- try \r\n - as robot dude mentioned.
- Try connecting to 9 pin connector and try both normal and inverted levels. I don’t remember if you can configure this easily on Atmega32s usart or not. But I would think the USART on the Atmega128 would be compatible with the USART ona the Atmega on the SSC-32.
- Try bypassing the Max232 on your Atmega128 board and ouput TTL directly the the SSC-32.
That is all I can think of for now.
Kurt
your all so great!!
i will try it right now… and let you know if it works…
thank you all for your replies!!..
i tried the ‘\r\n’ thing and the bypass… but still nothing…
the invert thing i don’t really get… How am i supposed to do that?
I’m out of ideas… Sorry
I really don’t think you can invert the UART signal levels on an ATmega32… and you should not need to. It’s got to be something too simple to be catching your eye. It displays the correct string on the PC, which you should verify has the same serial port settings as the SSC-32 is configured for… don’t let the PC auto-detect… force the settings to what they are on the SSC-32… which leads to make sure the jumpers on the SSC-32 select the DB-9 and the correct baud rate you think it does.
The Atmega board MAX232 output TXD pin should go right into pin 3 of the DB-9F
The Atmega board MAX232 RXD pin should go to pin 2 of the DB-9F
The Atmega board GND should go to pin 5 of the DB-9F
Remember the pin order of the DB-9F is backwards to that of the DB-9M when looking at the business end.
Beyond that I’m not sure where to go… maybe use a meter to make sure the RS-232 levels are +/- at least 3V on the pins when connected to the SSC-32. If you still can’t find it then find an o-scope and compare the signals between PC and Atmega at the TXD/RXD jumper pins of the SSC-32… these should be TTL level and nearly identical if both the PC and the ATmega32 board are sending the same format.
if ( received_char == ASCII_CR )
{
// For carriage return, execute the command
rx_char_valid = 0 ;
execute_command ( ) ;
}
else if ( received_char == ASCII_ESC )
{
// For ESCape, kill the current command if any
rx_char_valid = 0 ;
cmd_type = CMDTYPE_NONE ;
}
else if ( ( received_char == ' ' )
|| ( received_char == ASCII_LF ) )
{
// Discard leading spaces and line feeds
rx_char_valid = 0 ;
}
else
{
// For any character but 0xFF, ESC, or CR, start parsing the name
goto_parse_name ( ) ;
}
// ASCII character defines
#define ASCII_TAB 9
#define ASCII_LF 10
#define ASCII_CR 13
#define ASCII_ESC 27
This is a piece of code i found in the ssc-32 v2.02 source code…
this sais the carriage return character executes the command
line feeds are discarded.
So ‘\n’ is not needed… ‘\r’ is enough to execute the command
I was not stating that from experience, but from reading where other users said it was required. Sorry if it was wrong.
i know… but i just wanted to proof to myself it is not nescessery to place line feeds…
Bacause i’ve done it before and it worked that time…
I’m about to trow it out of the window…
I just don’t get it…
no one has another idea?!?!
Is there a reason you “need” to use the max232 driver instead of just using TTL communication? I don’t know if it will solve your problem, but we do it all the time using the Basic Atom processors. People normally use db9 RS-232 communication from a PC to the SSC-32, but when we use a microcontroller to talk to the SSC-32 we just use TTL level comms.
sorry if i’m asking something stupid now…
TTL is the signal comming directly out of the ATmega32, without the MAX232?
just to be sure:
I need to connect the rxd/txd directly to the txd/rxd on the ssc-32 board?
Yes, but there are some issues. When we do it we are connecting a 5vdc part to a 5vdc part. Is your processor 3.3vdc or 5vdc? If it’s a 5vdc part then you are good to go. You simply connect the TX from the atmel chip to the RX on the SSC-32. There are two jumpers that enable the DB9 and max 232. If you remove the two jumpers you can connect the TTL jumpers there. Use the GND and the RX pins closest to the DB9 connector.
it is 5VDC
i connected those… but now when i don’t connect the GND the led flashes when i send somehing… but when i connect the GND it does nothing… like it is receiving nothing…
And… when the rxd and txd jumpers are removed… i still can use the GND from the DB-9 connector?
can you post images of your wiring?
every time i try to upload a link or a image it gives me an error
That’s because of our anti-spam measures. You’ll have to wait until 24 hours have passed since you signed up on the forum before you are able to post images or links. Sorry for the inconvenience.
Check out this topic for more information.
lynxmotion.net/phpbb/viewtopic.php?t=2230
80.57.49.242/pics/wiring_simple.jpg
That looks correct. You do need the ground. Something is wrong, but I do not know what it is. I would have liked to see more of the wiring for the power. I’m as perplexed as you are.