cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing PS2 controller with STM32F103RBT6

HDUTIIITIXI
Associate

Hi, I am trying to interface a PS2 controller with a STM32F103RBT6 board and I'm relatively new to STM32 in generally. I have understood how the PS2 protocol works and was able to find references with codes to run with. Unfortunately, the board configuration in the ioc file of the given by the reference is of a STM32F103C8Tx board(surprisingly it operated successfully on my RBT6 board and was able to get the key input readings), and the key input reading are not reflected properly when running the codes (with only changes to microsecond delay functions) with a STM32F103RBTx board configuration.

Is there any explanation and solution to this? Any help is greatly appreciated!

Full files of the PS2 controller interfacing code is attached to my google drive in the following link. ("PS2" folder is for C8Tx version, "PS2_RBver" is for RBTx version)

https://drive.google.com/drive/folders/1BYTq7MRy8VRNGXaSP2vrUbU0-paIUpZd?usp=sharing

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_ST
ST Employee

Hello,

In the RBT6 project clock configuration, the APB2 prescaler is set to 2, when it is 1 in the CBT6 project.

You're using the TIM1 which is on the APB2 bus, and with the same settings for prescaler and counter period in both projects.

So whatever you're doing with TIM1 might be wrong.


Also, the PS2_AnologData() in not the same in the 2 projects.


For the delay function, you might want to stick to the working one of the original project.

View solution in original post

1 REPLY 1
Mike_ST
ST Employee

Hello,

In the RBT6 project clock configuration, the APB2 prescaler is set to 2, when it is 1 in the CBT6 project.

You're using the TIM1 which is on the APB2 bus, and with the same settings for prescaler and counter period in both projects.

So whatever you're doing with TIM1 might be wrong.


Also, the PS2_AnologData() in not the same in the 2 projects.


For the delay function, you might want to stick to the working one of the original project.