cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

Anonymous
Not applicable

Hello,

   

I'm currently trying to open communication to the Sparkfun Razor 9-DOF sensor which has an atmega chip onboard and outputs sensor data via UART (TX/RX). I have set up basic open communication using a UART on the Psoc 5lp (Term) and a UART connected to the TX and RX pins on the sensor (IMU). 

   

The baud rate on the sensor is set to 57600. Tera Term and both UARTs are set to the same.

   

The main.c is as follows I have also posted the whole project. 

   

////////////////////////////////////////////////////////////////////////////

   

#include <project.h>
  
uint8 Ch;

   

int main()
{
    Term_Start();
    IMU_Start();
    
    while(1){
        
        if((Ch=IMU_GetChar())){
            Term_PutChar(Ch);   
        }
        
        if((Ch=Term_GetChar())){
            IMU_PutChar(Ch);
        }
    }
}

   

////////////////////////////////////////////////////////////////////////////////

   

The communication is there, but the output is gibberish. I see the following in Term after hitting the reset button on the sensor:

   

üüüüààüàüààüüüüüüüüüüüüüàüüüüüüüüüüüüüàààüàüüààüàüàüàüüààüààüüüüüààüüàààüàüüàààüüüàüüüüüààüàüààüüüüüüüüüüüüüüüüüüüüüüüüüüàààüàüüààüàüàüàüüààüààüüüüüààüüàààüàüüàààüàüüà (it looks different on tera term)

   

The worst part about this whole thing is that I got it working before, changed some stuff around, and can't get back there no matter what I try.

   

Any help is appreciated. Thanks!

0 Likes
1 Reply
Bob_Marlowe
Expert II

The baud rate for Term is not the same as for IMU. Check the settings.

   

When the PWMs are used to control servos, you'll need a pulse width of 1 to 2ms with a repetition rate of at least 20ms.

   

 

   

Bob

0 Likes