background image

The Demo Program

The F5132EX board is factory programmed with a simple demo program. To use the demo: leave

the jumpers in their factory setting, connect  the board to a PC serial port using the cable included, start 
up a terminal program 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 using 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 program,  the demo program 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 program echoes back :

NOW HEAR THIS. 

The program also configures all port pins (except P1.1 & P1.2) as outputs and toggles them twice

a second.

Demo Source 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 END_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 = UCBRF_0;               // Modulation UCBRSx=3, UCBRFx=0

UCA0CTL1 &= ~UCSWRST;                     // release USCI for operation

F5132EX User’s Guide                                      Rev. 1.1 – Apr./2016

Page 

6

Summary of Contents for F5132EX

Page 1: ...MSP430F5132 Experimenter s Board F5132EX User Guide EA Electronics 8 Maple St Ajax ON Canada www eaelec com F5132EX User s Guide Rev 1 1 Apr 2016 Page 1...

Page 2: ...e micro controller an RS232 serial port a JTAG header for software debugging 2 low dropout voltage regulators and a prototyping area The standard micro controller is the MSP430F5132 in the 38 pin TSSO...

Page 3: ...not available when using the JTAG debugger Top View GPIO Port Breakout 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...

Page 4: ...the on board regulator install jumper JP3 and short pins 1 2 on JP1 The main on board voltage regulator is a 3 amp 3 3 volt low dropout linear regulator There is also a 100 milliamp 5 volt auxiliary r...

Page 5: ...ry or DC supply Power Minimum input voltages on W1 for proper regulation 3 8 volts if using only the 3 3V supply 5 5 volts if using both the 3 3V and 5 volt supplies F5132EX User s Guide Rev 1 1 Apr 2...

Page 6: ...k NOW HEAR THIS The program also configures all port pins except P1 1 P1 2 as outputs and toggles them twice a second Demo Source Code include msp430 h include stdio h include ctype h void initPortPin...

Page 7: ...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 END_OF_BUFFER void serial_echo void check for a character...

Page 8: ...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 c...

Page 9: ...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 2...

Page 10: ...Bill of Materials F5132EX User s Guide Rev 1 1 Apr 2016 Page 10...

Reviews: