How to use IMC301's User UART to communicate with STM32F103?

Announcements

From sunburn to sun earn – we’ve got the power! Watch our #poweringgreen videos now.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
zlz
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi,

I am using IMC301-T064 device, I want to use UART1(user mode uart) as a brige between STM32F103 and IMC301. First of all, I set InterfaceConf0=23(UART1 in user mode) and InterfaceConf1=0(DISABLE JCOM), then programming codes into STM32F103, ENABLE UART(STM32F103, I/0 PA8 and P19), send instructions  {0xFF,0x06,0x01,0x78,0x01,0x00,0xFF,0x80}  to start the motor, but it failed. I use oscilloscope to see the signal of IMC301's Rx and Tx, the Rx can receive signal from STM32F103 normally, but there is no back signal on Tx. So what's my problem?  Why there is no back signal?!

 

0 Likes
1 Solution
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @zlz,

Please ensure the user UART baud rate matches with STM32 ( by default User UART is configured to 57600 Baud rate)

Please find the below example command:

int Start_Command[8] = { 0x01, 0x03, 0x00, 0x00, 0x01, 0x01, 0xFE, 0xFB};

Start_Command :

0x01- Node address

0x03- Speed command

0x0000- Default value

0x0101 - Target speed 257 RPM

0xFBFE - Checksum ( -1 * ( 0x0301 + 0x0000 + ox 0101))

 

To get the reply from the Slave( iMotion)  the baud rate must be configured correctly and the Motor command must be in a correct format.

Refer to section 2.3 ( User UART) for commands-https://www.infineon.com/dgdl/Infineon-MCESW-RM-UserManual-v01_03-EN.pdf?fileId=5546d462719b59230171...

Please let us know if you are able to start the motor by using the above command format.

 

Thanks,

Krupashankar

 

View solution in original post

0 Likes
2 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @zlz

According to my understanding, you have already programmed the IMC301 device with the necessary configurations, confirmed the working of the motor, and now want to control the motor using an external microcontroller.  Please correct me if I am wrong. 
We will check internally if we have an example script that you could use as a reference. Meanwhile, could you please share a snapshot of the Basic System Configuration Options or share the .mc2 file?

Thanks and Regards,
Rakshith M B
0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @zlz,

Please ensure the user UART baud rate matches with STM32 ( by default User UART is configured to 57600 Baud rate)

Please find the below example command:

int Start_Command[8] = { 0x01, 0x03, 0x00, 0x00, 0x01, 0x01, 0xFE, 0xFB};

Start_Command :

0x01- Node address

0x03- Speed command

0x0000- Default value

0x0101 - Target speed 257 RPM

0xFBFE - Checksum ( -1 * ( 0x0301 + 0x0000 + ox 0101))

 

To get the reply from the Slave( iMotion)  the baud rate must be configured correctly and the Motor command must be in a correct format.

Refer to section 2.3 ( User UART) for commands-https://www.infineon.com/dgdl/Infineon-MCESW-RM-UserManual-v01_03-EN.pdf?fileId=5546d462719b59230171...

Please let us know if you are able to start the motor by using the above command format.

 

Thanks,

Krupashankar

 

0 Likes