Hi,
My setup is so;
Atmega 128 communicating to the pololu servo controller through UART on the Mini SSC II mode.
The transmission signal of the UART looks fine on the oscilloscope but the pololu servo controller complains about the baud rate being too high through a green flashing light + steady red light.
Despite changing the baud rate above the 9600, to say 10000, or dropping the baud rate to 2400 or below that to even 260, the same error occurs; baud rate is too high.
I also tried using the pololu mode for it is less dependent on a specific baud rate, but the same error occurred.
I have tried changing the delay at the end of the sequence, added a delay between bytes but neither has made a difference.
Every time a change is made, i cut the power to the pololu and turn it back on to reset the device.
Any help on this issue would be greatly appreciated; been working on trying to get the servo to move for the past several days with no success.
The code being implemented is as follows;
#include <avr/io.h>
#include <util/delay.h> //including delay functions
#define F_CPU 16000000 //1843200 //clock freq.
#define BAUD 9600 //baud rate 96000
#define BRC (((F_CPU)/(16*BAUD))-1) //cal baud rate /asynchronous mode pg173
void USART_Transmit(int);
int main(void)
{
//*******************************************************************
//UART Setup
/*<< shift left. ,,8 = shift left 3 bits*/
UBRR0H = (BRC >> 8); //baud rate registers high BRC used here
UBRR0L = BRC; //baud rate register low
UCSR0B = (1 << TXEN0); //enabling transmitter in register B (left shift 1 place)
UCSR0C = /*0<< UCSZ02) | */ (1<<UCSZ00) | (1<<UCSZ01); //making 8 bit //or keeps it, and destroys it
//*******************************************************************
while(1)
{
/*transmitting data to UART*/
//Mini SSC II*************************
USART_Transmit(0xff);
USART_Transmit(0x01);
USART_Transmit(0x02);
_delay_ms(1000);
//pololu mode ************************* Note; has been commented out for did not work thus trying the simpler code to no avail
/* USART_Transmit(0x80);
USART_Transmit(0x01);
USART_Transmit(4);
USART_Transmit(0x01);
USART_Transmit(0xa2);
_delay_ms(1000);
*/
//***************************************************
}
void USART_Transmit( int data )
{
while ( !( UCSR0A & (1<<UDRE0)) ){ };
/*waiting for transmit buffer to be empty*/
/* Put data into buffer, sends the data */
UDR0 = data;
}