msPROBOT Ready for Maker Faire

I finished the first physical version of the msPROBOT just in time for Maker Faire. I have the majority of the demo code written and I will post it when I test the code. All the basic library functions are written. Just need to make a main program that strings it all together.

There is more information and PCB files you can download at the msPROBOT project page.

MSP-430 LaunchPad UART and FIFO

I just put the finishing touches on my extensive UART and FIFO library. It uses the MSP430G2553 chip which has a hardware USCI. This can be used for a hardware UART. There are a couple different options to choose from and versions with or without a FIFO.

I will be making a standalone FIFO library so one can be used to store data.

edit: The standalone FIFO library is there now. Not fully tested but should work.

Self Balance Robot Lives!

I have been slowly working on the robot for awhile now. It runs on the MSP-EXP430 board which has a built in accelerometer. The Code is almost done. Should be finished tomorrow. When im done I will be posting the build sheet and code so other people can make it. Unlike other self balance robot designs that cost upwards of $200, this one costs just under $80 to make it and you do not need any special tools to make.

MSP430 32 LED Driver PCB Done

Finished the VU. Changed the name to a 32 LED Driver as that is what it really is. The idea for the VU is to sample the sense line via an ADC a couple times and average the value. Then the MSP430 will look up that value on a table and light up that many LEDs. Should be fairly straight forward.

PID Controller Code

This is a Proportional, Integral, Derivative (PID) controller I am writing for the MSP430. Does this look correct?


/*This is a PID or Proportional, Intergral, Derivative controller.
It is used by passing the current feedback (FDB) and reference (REF) number.
The function computes the correction (COR) and returns it as an int. 
For proper functionality, this must be called at regular intervals as it does not
account for time between samples. Adding this into a interupt routine is ideal.
*/ 

/*These are the PID constants. They will need to be tweaked to get the controller to operate correctly.*/
#define Kp /*to be filled in*/ 
#define Ki /*to be filled in*/ 
#define Kd /*to be filled in*/

/*These varibles need to stick around after the function exists*/
static int Ui, Up_old;
/*Additional functions*/
int COR, ERR, Up, Ud;

/*Start PID controller sequence*/
int PID(int FDB, int REF)
{
  ERR = REF-FDB;      /*Calculate the ERR.*/
  Up = Kp*ERR;      /*Proportion*/
  Ui = Ui + Ki*Up;    /*Intergral*/
  Ud = Kd*(Up-Up_old);          /*Derivative*/
  
  COR = Up + Ui + Ud;    //Correction value*/
  
  Up_old = Up;   /*Update the derivative value*/
  return COR;    /*return the correction*/
}

Tweaking the 128×32 LEDDMD Verilog

There was a few problems with the code for the 128×32 LEDDMD. Every so often there was flickering at random spots on the screen. This was because of the way the display memory was updated. I already fixed it by putting a dummy state at the end of the display memory update. Doing so actually increased the speed that data could be sent to the FPGA. There is no waiting between the Latch pulls.

The last problem is that there is some slight ghosting on the screen. Due to the way the screen updates it looks like the Column data is updating slightly before the rows are updated. Because of this you get a ghost effect on the opposite side of the screen that is up one row.

I think the reason why is because there is a slight delay in the rows caused by the decoders. The current plan of attack is to buffer the Column data a couple cycles before outputting.