cancel
Showing results for 
Search instead for 
Did you mean: 

Wii Motion Plus (Cant connect)

nerijus0075
Associate
Posted on October 17, 2011 at 00:14

The original post was too long to process during our migration. Please click on the attachment to read the original post.
1 REPLY 1
Posted on October 17, 2011 at 01:00

Wow, that's quite a mess.

Couple of thoughts:

Put all the RCC stuff in one routine, and do it first. Initialize the PLL sources, then enable the APB clocks once.

The VL part only runs at 24 MHz, it does not need/use the flash controller or wait states. This code was cut-n-pasted from some place else.

Check what firmware library you're using. Last I checked the VL library code sets up the clocks/pll before calling main().

Make sure you output the address of the I2C slave device you want to talk to every time you start communication using the I2C_Send7bitAddress() command. The ''Slave Address Register'' is only of relevance if the STM32 is the slave, you presumable are the master in this context and need to control the data sequencing.

Wait in loops for the various I2C_CheckEvent() states before ploughing forward jamming stuff into the I2C peripheral, I'm pretty sure the method you're employing now is not going to be workable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..