RSS

FlipTerm : Serial Port Monitoring Application

Hey everyone,

Couple of months back when i started my project I started looking for applications which i can use to monitor a serial port.I found some , but none were simple enough. After a lot of coding,trials , googling i came up with a code which is a mixture of all of the codes i had found and what i added on my own.So I’ve added the software FLIPTERM , which is a terminal software.I’ve kept it as open source (GPL) so that everyone can use the code. If you do use the software and find any bugs please do report it on this blog.

To download the software click on the link below.

1.Flipterm

Once installed navigate to “C:\Program Files\FlipFlop\” to get the software link and the source Code.

 
5 Comments

Posted by on May 20, 2012 in Flip

 

Tags: , ,

USB – Serial Convertor

Hey guys ,

I’ve had some trouble getting a proper usb serial convertor to connect my MSP430g2553.The problem i faced was the drivers for win 7 .After a lil research i found a way to make our own convertor. We can use FT232r serial usb convertor by FTDI.it cots around 130 – 180 Rs. .The circuit for the application is as shown.Power is drawn from usb itself.

For the Ferrite bead we can use a cable with the ferrite bead itself.Here is pic of the convertor i have used.

USB cable with Ferrite bead is shown above.

 
11 Comments

Posted by on April 1, 2012 in Flip, Flip flop

 

Tags: , ,

Working with Anaren AIR Booster Pack

hey guys ,

I bought the Anaren booster pack a month ago. It was my first time working with a rf module and msp.When i looked at the firmware of the booster supplied by anaren it drove me crazy. I’m sure that you might have felt the same. They  have used extensive generalization to include all possibilities and not to mention the cross referencing to be done to make it work. Me and my  friends tried to understand the code . But it was too confusing and hence we stopped. So I wrote the firmware myself. In this tutorial let us see how to do the same . In the code to follow we will use two launchpads and 2 AIR booster packs. I’ve changed the pin connections a little to communicate through UART . So basically we will be sending text from one computer to another by means of the RF booster pack. We will be using MSP430G2553 controller. You have to know basic UART and SPI protocols and their setup in msp to make this work.

CC110l

So let us see how to work with CC110. This rf ic works on 4 different frequencies based on the programming and the external hardware. We will be using 867 Mhz.It is controlled by msp by means of SPI interface which includes SOMI , SIMO , SCLK , CSN pins of CC110l.The GDO pins are used to update the status of the CC110l and can be programmed to interrupt the controller on start of various events. The device is configured by writing to its configuration registers and the status is known by reading form status registers. The mode of CC110 is set by using Strobe Commands. Like any transceiver it can works as a RX or TX at a time.

So with this background let us get on the board.

The connections are as shown below.

The Connections to the Computer are to established using a serial port of a computer. In case the computer doesn’t have a serial port then use a serial-USB Converter. Connect the UART_RX to the TX pin of the serial port ,UART_TX to the RX pin of the serial port and the GND  pin of bin together.The connections of the Cc110l are as shown . The connections of the Booster pack are :

I’ve used the launchpad debugger to burn the code on the ic.In the example shown the booster and the controller are mounted on a separate board and not on the launchpad.This was done to use the UART port.For those who are not interested in using the uart port then directly connect the booster to the launchpad.But some changes to the board definitions have to be made.To run the code presented here please use the connections mentioned.

Here are the project files of this example.

  1. link1

The project consists of several files which are used to make the coding simpler.Two boards are required for this example.Each Board accepts data from the hyper terminal and transmits it.The other board receives this and displays it on the hyper terminal.The same code has to be burnt on both the msp43G2553 controllers.The required software for this is a serial port access software like hyper terminal (default in win xp) .In case of Win 7 users you’ll have to download the software online.Tera term , hyper terminal and FLIPTERM are some of the software’s available on net for Win 7 .I’m using Win 7 with hyper terminal.The UART is configured for a

  • baud -9600
  • parity – none
  • flow control = none
  • stop bits – 1
  • databits – 8

These settings are required for the terminal to operate.

The basic flow of the code is as follows :

POR => Initialize board =>Put the device in listen mode =>if data received from uart send through rf module => if data received from rf display on terminal.

The project contains different files for different initializations.The interrupt vectors are present in “pragmas.c” connect each board and program the code into them.Connect each one to a different serial port and open the corresponding hyper terminal.Once the hyper terminal is open reset the controller.This will display “*” on the terminal.Any character typed hence will displayed as a “-” on the screen.A character received will be displayed as  it is. So in the above example i ve typed “ADadw”.This was transmitted which was displayed as “-” , and received which displayed the characters themselves.

The CC110_functions.c file contains the functions to initialize the CC110l.The register values are available with the manuals provided by  Anaren.The CC110l is set to -0.5dBm power.This gives a range of about 7-10 m.To vary power edit the patable[] value to the required value.To vary the config register vary the values in this files next to the required registers.The CC110l provides the register addresses.So the device developed by me looks somewhat like this.Hope you have a fun time working with it.For any queries post a comment or mail it to me at sms219610@gmail.com.

I’ve added a schematic of the circuit used by me. NOTE THAT I HAVE USED MSP430G2553 IN 28 PIN PACKAGE.so ignore the PORT3.this circuit was used for a project of mine.If you have any queries please leave a comment.Hope this article was useful.

PLEASE NOTE:

Andy has tried the code On CCS .He is able to use the booster directly on the launchpad without much modifications. Though I ve not tried this myself he has made it work. His comment is as follows:

”  The hardware I’m using is TI launchpads with the AIR module plugged in. I was able to compile using CCS version 4 and use the virtual com ports on the launchpad. I had to make the following changes to reroute GDO0 to P1.3 and CSN to P1.4 on each AIR module. The Booster Pack User Manual describes these changes and I used 0603 resistors to make the connections. I found this manual on the Anaren site. .

1. Cut the trace between JP2 pin 1A and pin 1B. Solder a 0 ohm 0603 resistor between JP2 pin 2A and pin 2B. This routes GDO0 to P1.3 on the launchpad.

2. Cut the trace between JP3 pin 1A and pin 1B. Solder a 0 ohm 0603 resistor between 3A and 3B. This routes CSN to P1.4.

Change defines in mspboard.h to map the new connections.

#define GDO0_PIN BIT3
#define GDO2_PIN BIT0
#define CSn_PIN BIT4

Compile, flash, and execute FW each launchpad. No other changes made. I use two sessions of putty each connected to a launchpad to send and receive data.  “

 
72 Comments

Posted by on April 1, 2012 in Flip, Flip flop, MSP430 Tutorials

 

Tags: , , , , , , , , , ,

4.30 $ MSP430 Debugger/Programmer

Hey guys,

Its been a long time since i blogged . Well i was working with msp but too lazy to do anything. Today finally  after months i was able to finally program an external controller with the launchpad and also DEBUG it . It just saved me 149$ for getting the debugger and the target board . You may ask , is it not a simple connection of the program pins from the launchpad to the new controller . Well actually it is. Previously I thought that the C20 resistor would be a problem and destroyed a launchpad in the process of removing it . So after one launchpad down i ordered a new one and also got a free sample of MSP430F5521 and MSP430F4152 to try programming. While i was browsing through 43oh.com i came across the solution.So i rigged up the controller with necessary connections (I’ll tell what they are shortly) and connected the launchpad and voila!!!. The controller came to life and blinked the LED . It s a wonder how a simple act of led blinking can make an electronic geek so happy .

Generally the controllers are programmed using the JTAG protocol which uses 4 wires besides the supply. TI developed a different protocol called Spy-Bi-Wire . As the name suggests it uses only 2 wires with supply. Basically these are the modified versions of SPI(JTAG) and I2C(SBW) protocols . The JTAG debugger provided by TI can be used to program any msp430 , but you’ve to pay 75$ for the debugger. SBW debugger can be used with only certain controllers which have the capability of SBW debugging and can be done either with the JTAG debugger (a modification of pins) or our own launchpad . It’ll cost you only 4.30$ but not all msp can be programmed. So if  use the method i do then , purchase the msp with  these two pins .

  • RST/NMI/SBWTDIO 
  • TEST/SBWTCLK

These are the pins used for debugging.RST and TEST may be present even without the SBW. So watchout for the names in RED.In the datasheet It’ll be mentioned if the controller supports SBW.

So now you have the controller.Next step connections . For the demo I’ve used msp430f4152.

  • So take the launchpad and update the firmware.
  • Now remove the MSP430 on the launchpad (in the DIP Socket).
  • Set up target .I soldered the msp430f4152 on a 64pin breakout board . Connect these pins of the F4152 to the launchpad board.

DVCC and AVCC  -(Pin 7 and Pin 64 )  to the Vcc of Launcpad

DVSS and AVSS  (Pin 10 and Pin 62) to the Gnd of launchpad

                RST/NMI/SBWTDIO pin to the Reset Pin on the Launchpad

                TEST/SBWTCLK pin to the Test pin on the launchpad.

And Of course an LED with a series resistor to a port. I’ve used P4.6

  • With these connections open IAR and write a small code to toggle the LED.

Change the Following settings .

  1. Project Options> Target > MSP430F4152
  2. Project Options > Debugger > FET Debugger > Texas Instruments USB-IF  and Select Manual Selection of SBW in Debug Protocol as  show below.

Also sometimes the launchpad is not detected at the correct port . In this case in the connection tab in the above figure manually select the COM port. Here i ve chosen HID0026:COM6 as can be seen besides TI USB-IF.

  • Now we are all set. Hit the Download & Debug button and run the code.

I ve made a expansion board for the Launchpad which brings out the supply and debug pins together so that i can easily wire the hardware.

Here is the image of the hardware.

 
7 Comments

Posted by on March 29, 2012 in Flip, Flip flop

 

Tags: , ,

Free Art !!!!

Hey everyone,

Till my 9th std. i never believed that i could do anything worthwhile in arts.That year my dad bought me a PC and i started off with photoshop.It was not out of interest but out of boredom.But then i got addicted and have been doing something or the other with it.During my engineering course i ve used this knowledge of the wonderful software to design small stuff like T-shirts , banners, certificates,etc..A year ago my senior and a very good friend Ashwith introduced me to Fedora and with it i was introduced to a whole set of new softwares which i found first of FREE!!! and very versatile and easy to use.i ve stopped using Photoshop now.The software i use are

I have learnt Inkscape to a certain extent and it continues to  surprise me with what can be done with 150mb of software.Compare this with 1gb of Ps.the other tools are next in my list to learn.The learning materials for these are quite a lot!!!! with documents to videos theres  there is everything we need to learn.For Inkscape i refer to the SCREENCASTER.HEATHENx.Excellent video tutorials are provided on using inkscape and also combining it with the other softwares.Also CHRISdesign has some amazing designs.SO with this i hope you are kind of wanting to try those softwares too.if you do and create some designs please do send me link to the image or the model .thanks for reading..Have a nice day :)

 
Leave a comment

Posted by on October 23, 2011 in Flip flop, Flop, Free Art

 

Clocks and MSP430

hi there everyone,

in this tutorial let us check out the all clocks that msp has got to offer us.After studying 8051 and comparing that to controllers like msp and AVR makes me wonder how much development has taken place over the years.The 8051 controller had just one clock.It was external with maximum range of 16Mhz.If it failed then the controller would fail.So what makes msp better.It has 2 built in clocks and one external.Some have a provision for 2 external clocks and th series 5xx and 6xx have dedicated clock built in for Real time Clock facility.When i first read through i was wondered.What do you do with all these clocks?Do we really need it?

So I read through and yeah we do  need it whn we are thinking of very low power consumption.The MSP430 has usually 3 clock sources.

  1. LFTXT1      or   External low frequency oscillator (usually 32768 Hz but can have a max of 16Mhz.)
  2. DCO            or   Internal Digitally Controlled Oscillator stabilized with Frequency Locked Loop.
  3. VLO            or   Internal  Very Low Power Very Low Frequency Oscillator.

Some of the controllers have a XT2 oscillator which is a external high frequency oscillator.And as mentioned the 5xxx and 6xxx series have a REFOCLK which is stabalized 32768Hz clock internal to the chip to be used in place of the LFTXT1.It consumes lesser power than the LFTXT1.

These Clocks source 4 Clock signals.They are

  1. MCLK       or    Master Clock.
  2. SMCLK     or   Sub-Master Clock.
  3. ACLK        or   Auxiliary Clock.
  4. ACLKn      or  Auxiliary Clock divided by n.

The different registers used to modify the Clocks are shown below.These were taken from the user guide provided by ti.


The Master Clock signal is Used to source the CPU.So the speed of the CPU depends on the MCLK and this signal is switched off during LPM0.By default in the absence of External crystal the DCO sources the MCLK.

The DCOCTL,The range select bits in BCSCTL1 and BCSCTL2 are used to configure the MCLK.

Now let us see how to control the DCO frequency.The DCOx and RSELx are together used to vary the DCO frequency from about few hundreds of hertz to 16Mhz.The MODx bits are used to obtain the intermediate frequency.The SELMx and DIVMx are used to select the source for the MCLK signal and division factor.The following code encompasses the above.

#include "msp430x20x2.h"
int main (void)
{
  WDTCTL=WDTPW+WDTHOLD;               //hold watchdog
  P1DIR=BIT0+BIT6;                   
  P1IE=BIT3;                          //enable interrupts
  int i=0;
  _EINT();            
  while(1)
    {
    for(i=0;i<30000;i++);             //toggle LED1 at PIN 0
    P1OUT^=BIT0;
    }
}

#pragma vector=PORT1_VECTOR           //ISR for PIN 3
__interrupt void pin3 (void)
{
static int range=0,dco=0;             
dco++;                                //increment the dco step
dco=dco%8;
range=range%3;
switch(range)                         // step up range every 8 clicks of S2 switch
  {
  case 2:BCSCTL1=RSEL0+RSEL1+RSEL2+RSEL3;
         break;
  case 1:BCSCTL1=RSEL0+RSEL1+RSEL2;
         break;
  case 0:BCSCTL1&=~(RSEL0+RSEL1+RSEL2+RSEL3);
         break;
  }

switch(dco)                         //step up speed every click
  {
  case 0:DCOCTL&=~(DCO0+DCO1+DCO2);
         break;
  case 1:DCOCTL=DCO0;
         break;
  case 2:DCOCTL=DCO1;
         break;  
  case 3:DCOCTL=DCO0+DCO1;
         break;
  case 4:DCOCTL=DCO2;
         break;
  case 5:DCOCTL=DCO0+DCO2;
         break;
  case 6:DCOCTL=DCO1+DCO2;
         break;
  case 7:DCOCTL=DCO0+DCO1+DCO2;         //increment the range
         range++;
         P1OUT^=BIT6;
         break;
  }
P1IFG&=~BIT3;
}

The above graph explains the variations in the DCO frequency.The above code also checks for the RSEL values and DCO values as in graph. Every time the RSEL value increments the green led toggles and the red led is a indicator of the speed of CPU as the LED is toggled by a delay loop f(or loop) which uses the CPU Registers to count .As i dont have a CRO I’ve limited the code to just the 3 values of the RSEL .Please do check if there are any variations for other values.There are modulation bits which allow us to further vary the frequency.I’ll be putting up separate post on it sometime later.Now let us see how to vary the source for the MCLK from DCO to  other sources and to change the division factor.

#include "msp430x20x2.h"
void main()
{
WDTCTL=WDTPW+WDTHOLD;
P1DIR=BIT0+BIT6;
P1OUT=0X00;
P1IE=BIT3;
_EINT();
int i=0;
while(1)
{
for(i=0;i<32000;i++);
P1OUT^=BIT0;
}
}
//------------------------------------------interrupt isr
#pragma vector=PORT1_VECTOR
__interrupt void pin3(void)
{
static int source=0,divide=0;
divide++;
divide=divide%4;
source=source%3;
switch(source)
{
case 0:BCSCTL2&=~(SELM0+SELM1);         //Select DCO
        break;
case 1:BCSCTL2=SELM1;                   //select XT2 else LFTXT1 or VLO
        break;
case 2:BCSCTL2=SELM0+SELM1;             //select LFTXT1 or VLO
        break;        

}
switch(divide)
{
case 0:BCSCTL2&=~(DIVM0+DIVM1);         //Divide the source / 1
        break;
case 1:BCSCTL2=DIVM0;                   //divide by 2
        break;
case 2:BCSCTL2=DIVM1;                   //divide by 4
        break;        
case 3:BCSCTL2=DIVM0+DIVM1;             //divide by 8
        source++;
        P1OUT^=BIT6;
        break;
}
P1IFG&=~BIT3;
}

So in the above code toggling of the green led is an indicator of the change of source and the red light toggle indicates the frequency due to change in the division factor.The same applies to the SMCLK and ACLK too.The SELSx and DIVx bits are used to change the source and the division factor for the SMCLK.The DIVAx bits are used for the ACLK.The default clock for ACLK in case the external oscillator is not present is VLO.To check the frequency of the ACLK ,SMCLK and MCLK the following code can be used.The ACLK and SMCLK are usually connected to the GPIO’s in case of the launchpad it being the PIN0 and PIN5.The MCLK can be checked by a delay loop.

#include "msp430x20x2.h"
void main()
{
WDTCTL=WDTPW+WDTHOLD;
P1DIR=BIT0+BIT5+BIT6;
P1SEL=BIT0+BIT5;            //Select the secondary pin funcitons i.e ACLK SCLK.

while(1)
{
P1OUT^=BIT6;
}
}

The Frequency will have to be checked on a CRO as the Flicker on the led too fast to see.Also there are default values stored in the memory of the chip which can be used to configure the controller to predefined frequencies.These are given in the library file as CALDCO_16MHZ,CALBC1_16MHZ,.. etc.These can be directly entered on the code to get the desired calibration.Please leave a comment if there is something I can help with or if there is an error.I hope this blog was useful.Thank you for reading.Have a nice day :)

 
Leave a comment

Posted by on October 5, 2011 in Flip, MSP430 Tutorials

 

Tags: ,

Image

Muninagar : My first/last Intro trek

hey guys,

yesterday i.e, 2nd October 2011 all the machas and machis of BMSCE set out for a small trek to Muninagar .Around 170 students took part in this annual trek where the first year students get to meet the rest of the college and go together on a trip.I had been to the same place for the intro trek during my first year.So it was nostalgic to be back.The day started at 7 when everyone gathered at the Katte for breakfast.After a round of Idly vadas and the warm up exercises (my favourite) we set off in three buses.Three lecturers also accompanied us to the place and am sure they had great time too.I got to meet the group of students from the international hostel.They had come to BMS from SriLanka ,Qatar ,AbuDhabi , Bangladesh and others i cant remember.Had a great time in the bus journey too. Thanks to the juniors.

We reached the place at about 10.30 i think.We started to trek with an expectation to find elephants which according to the locals had crossed the place the previous night.We were given instructions By our dear BM (a.k.a Harsha) as to what we have to do just in case.Then we set out.All the way up we only found elephant shit but no elephants .It was really a beautiful place and i recommend all those who have not gone to go.Thank you for reading :)have a nice day

This slideshow requires JavaScript.

 
Leave a comment

Posted by on October 3, 2011 in Flop

 
 
Follow

Get every new post delivered to your Inbox.