EA Electronics F5132EX User manual

MSP430F5132 Experimenter’s Board (F5132EX)
User G ide
EA Electronics
8 Maple St. Ajax, ON
Canada
www.eaelec.com
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 1

Introd ction
The Texas Instruments MSP430™ family of ultra low-power micro-controllers consists of several
devices featurin different sets of peripherals tar eted for various applications. The architecture,
combined with five low-power modes, is optimized to achieve extended battery life in portable
measurement applications. The device features a powerful 16-bit RISC CPU, 16-bit re isters, and
constant enerators that contribute to maximum code efficiency. The di itally controlled oscillator (DCO)
allows wake up from low-power modes to active mode in less than 5 μs.
Schematic
The Experimenter’s board provides the micro-controller, an RS232 serial port, a JTAG header for
software debu in , 2 low-dropout volta e re ulators and a prototypin area. The standard micro-
controller is the MSP430F5132 in the 38 pin TSSOP packa e. This chip features 8K of flash and 1K of
SRAM memory. The board is also available with the MSP430F5172 (32K flash, 2K SRAM) for
applications which require more memory.
The JTAG Header
The JTAG header (J1) is used to connect the MSP-FET430UIF. The MSP-FET430UIF is and in-
circuit pro rammin /debu in tool made by Texas Instruments. It is not included with the F5132EX but
can be purchased from any lar e distributor of TI products such as Di i-Key. The Code Composer Studio
IDE can be downloaded for free from www.ti.com and provides the assembler and C compiler.
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 2

Prototyping Area
The prototypin area has pads for 3 TSSOP devices (up to 20 pins), 3 SOIC devices (up to 20
pins), 4 DPAKs, 4 SOT-23, a 2mm header (10x2), a 1.5mm header (1x6), various DIPs and .1” headers,
and many 2 terminal devices (both surface mount and throu h hole); such as resistors, capacitors and
diodes. The port pins on the MSP430F5132 are broken out to SIP pads at the ed e of the prototypin
area. Note: the followin port si nals are not bonded out on the 38 pin TSSOP packa e: ports 3.4, 3.7,
J.4 J.5 and J.7. Pins J.0 thru J.3 are not available when usin the JTAG debu er.
Top View
GPIO Port Breako t Connections
Port 1 Port 2 Port 3 Port J
Pin 1 AGND Pin 1 DGND Pin 1 DGND Pin 1 DGND
Pin 2 P1.0 Pin 2 P2.0 Pin 2 P3.0 Pin 2 PJ.0*
Pin 3 P1.1# Pin 3 P2.1 Pin 3 P3.1 Pin 3 PJ.1*
Pin 4 P1.2# Pin 4 P2.2 Pin 4 P3.2 Pin 4 PJ.2*
Pin 5 P1.3 Pin 5 P2.3 Pin 5 P3.3 Pin 5 PJ.3*
Pin 6 P1.4 Pin 6 P2.4 Pin 6 NC Pin 6 NC
Pin 7 P1.5 Pin 7 P2.5 Pin 7 P3.5 Pin 7 PJ.6
Pin 8 P1.6 Pin 8 P2.6 Pin 8 P3.6^ Pin 8 NC
Pin 9 P1.7 Pin 9 P2.7 Pin 9 NC Pin 9 NC
Pin 10 AVCC (+3.3v) Pin 10 DVCC (+3.3v) Pin 10 DVCC (+3.3v) Pin 10 DVCC (+3.3v)
*= not available if usin JTAG debu er
#= not available if usin serial port
^= Used to drive LED2 if JP2 is installed
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 3

Power S pply
The F5132EX board can be powered in from either the MSP430-FET debu er or throu h the on
board 3.3V re ulator. When powerin from the MSP430-FET debu er remove jumper JP3 and short
pins 2 & 3 on JP1 (see photo below). When powerin from the on board re ulator, install jumper JP3 and
short pins 1 & 2 on JP1.
The main on board volta e re ulator is a 3 amp, 3.3 volt low-dropout linear re ulator. There is
also a 100 milliamp, 5 volt auxiliary re ulator for powerin analo circuits. A screw terminal connector
(W1) is provided for connectin to batteries or an external DC power supply. Maximum input volta e on
W1 is 15 volts.
Using MSP430-FET Power
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 4

Using Battery (or DC s pply) Power
Minim m inp t voltages (on W1) for proper reg lation:
3.8 volts if usin only the 3.3V supply
5.5 volts if usin both the 3.3V and 5 volt supplies
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 5

The Demo Program
The F5132EX board is factory pro rammed with a simple demo pro ram. To use the demo: leave
the jumpers in their factory settin , connect the board to a PC serial port usin the cable included, start
up a terminal pro ram on the PC (Hyperterm or Tera Term, for example) set the port for 9600 bps, 1 stop,
no parity, HW control off. Connect the F5132EX to a DC power supply or battery usin connector W1.
You will see the banner on the PC:
***********************************
* EA Electronics *
* MSP430F5132 Demo Program V1.0 *
***********************************
If you type a line in lower case on the terminal pro ram, the demo pro ram echoes back the line
in upper case after you hit the enter key. So if you type:
now hear this.
Followed by the enter key, the pro ram echoes back :
OW HEAR THIS.
The pro ram also confi ures all port pins (except P1.1 & P1.2) as outputs and to les them twice
a second.
Demo So rce Code
#include <msp430.h>
#include <stdio.h>
#include <ctype.h>
void initPortPins(void);
void send_msg( char * buf, int len );
char startup1[] = {"\n***********************************\n\r"};
char startup2[] = {"\n* EA Electronics *\n\r"};
char startup3[] = {"\n* MSP430F5132 Demo Program V1.0 *\n\r"};
char startup4[] = {"\n***********************************\n\r"};
char newline[] = {"\n\r"};
#define E D_OF_BUFFER 50
void initPortPins(void);
void send_msg( char * buf, int len );
void serial_echo( void );
/*
* main.c
* Serial port echo and toggle IO pins
*/
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
unsigned int j;
initPortPins();
// set up Serial port for 9600, 1 stop, no parity
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600
UCA0BR1 = 0x00; //
UCA0MCTL = UCBRS_3+UCBRF_0; // Modulation UCBRSx=3, UCBRFx=0
UCA0CTL1 &= ~UCSWRST; // release USCI for operation
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 6

// print start-up banner
send_msg( newline, sizeof(newline) );
send_msg( startup1, sizeof(startup1) );
send_msg( startup2, sizeof(startup2) );
send_msg( startup3, sizeof(startup3) );
send_msg( startup4, sizeof(startup4) );
for(;;)
{
for( j=0; j<15000; j++)
{
serial_echo();
}
P3OUT = (0xAA);
P2OUT = (0xAA);
P1OUT = (0xAA);
PJOUT = (0xAA);
for( j=0; j<15000; j++)
{
serial_echo();
}
P3OUT = (0x55);
P2OUT = (0x55);
P1OUT = (0x55);
PJOUT = (0x55);
}
return 0;
}
// echo routine
unsigned int b = 0; // buffer index
char inbuf[E D_OF_BUFFER];
void serial_echo( void )
{
// check for a character on the input
if(UCA0IFG&UCRXIFG)
{
// save it in the buffer
inbuf[b] = toupper(UCA0RXBUF);
b++;
// check for end of line or buffer full
if( (inbuf[b] == '\r') || (b == E D_OF_BUFFER) )
{
// echo the message
send_msg( inbuf, b-1 );
send_msg( newline, sizeof(newline) );
b = 0;
}
}
}
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 7

void send_msg( char * buf, int len )
{
int i;
for( i=0; i<len;)
{
if(UCA0IFG&UCTXIFG) // USCI_A0 TX buffer ready?
{
UCA0TXBUF = ( buf[i] ); // TX -> RXed character
i++;
}
else
{
continue;
}
}
}
void initPortPins(void)
{
P1DIR |= BIT1; // Set P1.1 as TX output
P1SEL |= BIT1 + BIT2; // Select P1.1 & P1.2 to UART function
P2DIR = 0xFF; // all pins as outputs
P3DIR = 0xFF; // all pins as outputs
PJDIR = 0xFF; // all pins as outputs
}
You can download the entire Code Composer project for the demo pro ram, o to:
www.eaelec.com\ea_eval\eval.htm
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 8

The Serial Port
The serial port utilizes only 3 pins on the DB9M connector (TX, RX and GND). A null modem
serial cable is included for connection to a PC serial port .
Cable Drawing
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 9

Bill of Materials
F5132EX User’s Guide Rev. 1.1 – Apr./2016 Page 10
Table of contents