Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

MSP430G2553 Interfacing w/ PS2 Controller

$
0
0

I am a 4th year electrical Engineering student and for the final project in my embedded class I took on a personal project because I had taken some labs with 7 segment displays further using shift registers, so I asked the prof if I could do a PS2 controller controlled Roomba.  I built the motor controller boards myself, everything works great, I can tell it turn and drive around, but I can not get the code to communicate with a wireless PS2 controller to get data on the RX pin correctly.  Data is being pushed out the TX pin correctly and RX is either sitting at 0xFF (which it should at for the first byte of the header sent), but it will occasionally read 0xB4 or 0x82, but it will not ever register 0x41 or 0x5A for the second and third bit of the header, it seems to be getting stuck on line 34 and it sometimes opens memcpy.c which I have no idea what that is.  I have asked my prof about it, he has pointed out a few things I had minor problems, but he hasn't seen too much wrong with it and I feel probably he doesn't want to give too much either, but I am an EE student, not a CS student so I figured out how to make a program to communicate with shift registers, but using SPI and what not is foreign to me.  I could really use a hand with the coding for this.

 

The code I uploaded is only for communicating with the PS2 controller, I haven't added in control for the motors yet as I know it works, I had it doing figure eights earlier, but no point doing much more with it until I can communicate with the controller.

Attached Files


Viewing all articles
Browse latest Browse all 2077

Trending Articles