OUT
value
V
1.99 V
6.00 V
1.99 V
Decimal
78
51.5 mV
51.5 mV
-
-
=
=
»
VID Interface
(1)
To set the output voltage to 6 V, write a value of 78 into the register of the output port connected to the
VID interface using the command
VID_POUT = 78;
The VID_POUT definition is the output register of port 1 (P1OUT).
An Excel® sheet containing the precise calculations for all 256 steps and also examples for generating
sinusoidal waveforms is available on
http://www.ti.com/tool/pmp7233
.
The
pulse.c
file also contains three test functions, which are not used but show an easy method for
generating a rectangular, a saw tooth, and a sinusoidal waveform.
•
void generate_pulse_test_mode_1(void) — Rectangular waveform
•
void generate_pulse_test_mode_2(void) — Sawtooth waveform
•
void generate_pulse_test_mode_3(void) — Sinusoidal waveform
4.2
Programming the Microcontroller
Debugging the program and flashing the microcontroller requires a debugger to connect the EVM with the
computer. One can either use the MSP430 USB Debugging Interface (MSP-FET430UIF) or the
inexpensive MSP430 LaunchPad (MSP-EXP430G2). Either option uses the Spy-Bi-Wire interface to save
pins on the microcontroller instead of using a true JTAG connection.
4.2.1
Using the USB Debugging Interface
1. Remove jumper J13, close to the microcontroller, to disconnect the reset line from the supply voltage
supervisor TPS3809K33-Q1
2. Connect the EVM to a power supply (24 V).
3. Connect the USB debugging interface and J14 of the EVM using a ribbon cable.
4. Start Code Composer Studio and import the project (HVL068A_software.zip).
5. Select the project and press F11 or click on
Debug HVL068A – Cranking Simulator
6. After programming of the microcontroller is finished, press F8 to start the program.
7. Debugging can be aborted by pressing CTRL + F2.
8. Unplug the USB cable from the computer.
9. Remove the ribbon cable between the EVM and the USB debugging interface.
10. Insert jumper J13 on the EVM.
11. The EVM is now ready to be used with the new firmware.
4.2.2
Using the MSP430 LaunchPad
1. Remove all five jumpers (VCC, TEST, RST, RXD, TXD) of J3 on the LaunchPad.
2. Remove jumper J13, close to the microcontroller, to disconnect the reset line from the supply voltage
supervisor TPS3809K33-Q1.
3. Make sure that the EVM is
NOT
connected to a power supply.
4. Connect the EVM and LaunchPad as follows using jumper cables.
EVM
LaunchPad
Description
J14-4
J3 VCC (emulation side)
Voltage to supply the MSP430 from LaunchPad
J14-8
J3 TEST (emulation side)
Spy-Bi-Wire test clock
J14-1
J3 RST (emulation side)
Spy-Bi-Wire test data input/output
J14-9
J6 GND (MSP-EXP430G2 side)
Ground connection
8
Automotive Cranking Simulator User’s Guide
SLVU984 – December 2013
Copyright © 2013, Texas Instruments Incorporated