Functions | Variables
LowLevelFunc430X.c File Reference

Detailed Description

Low Level Functions regarding user's Hardware.

Definition in file LowLevelFunc430X.c.

#include "LowLevelFunc430X.h"
Include dependency graph for LowLevelFunc430X.c:

Go to the source code of this file.

Functions

unsigned long AllShifts (word Format, unsigned long Data)
 Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first). More...
 
void InitController (void)
 Initialization of the Controller Board. More...
 
void SetVCoreUp (word level)
 Function to set a specific voltage level via the PMM. More...
 
void SetTargetVcc (word level)
 Set target Vcc (supplied from REP430F) More...
 
word Get_target_Vcc (void)
 Determine target VCC. More...
 
word Get_Ext_Vcc (void)
 Determine external VCC. More...
 
word Get_Vx (word index)
 Measure different voltages via ADC12. More...
 
void TDI_dir (word dir)
 Set the direction for the TDI pin. More...
 
void TDOI_dir (word dir)
 Set the direction for the TDO pin. More...
 
void TEST_dir (word dir)
 Set the direction for the TEST pin. More...
 
void TMS_dir (word dir)
 Set the direction for the TMS pin. More...
 
void RST_dir (word dir)
 Set the direction for the RST pin. More...
 
void TCK_dir (word dir)
 Set the direction for the TCK pin. More...
 
void SetVpp (word source)
 function to set the fuse blow voltage Vpp More...
 
void Enable_Vpp (void)
 Enable fuse blow voltage Vpp. More...
 
void Disable_Vpp (void)
 Disable fuse blow voltage Vpp. More...
 
void configure_IO_JTAG (void)
 Set JTAG pins to output direction - from REP430F to target. More...
 
void configure_IO_SBW (void)
 Set SBW pins to output direction - from REP430F to target. More...
 
void IO_3state (void)
 Set all JTAG pins to input direction - from target to REP430F. More...
 
void TDOisInput (void)
 This function switches TDO to Input (used for fuse blowing) More...
 
void DrvSignals (void)
 Set up I/O pins for JTAG communication. More...
 
void RlsSignals (void)
 Release I/O pins. More...
 
void InitTarget (void)
 Initialization of the Target Board (switch voltages on, preset JTAG pins) More...
 
void ReleaseTarget (void)
 Release Target Board (switch voltages off, JTAG pins are HI-Z) More...
 
void MsDelay (word milliseconds)
 Delay function (resolution is 1 ms) More...
 
void usDelay (word microseconds)
 Delay function (resolution is ~1 us) More...
 
void TCLKstrobes (word Amount)
 This function generates Amount strobes with the Flash Timing Generator. More...
 
void ShowStatus (word status, word index)
 This function controls the status LEDs depending on the status argument. It stops program in error case. More...
 

Variables

byte tdo_bit
 Holds the value of TDO-bit. More...
 
byte TCLK_saved = SBWDATO
 Holds the last value of TCLK before entering a JTAG sequence. More...
 

Function Documentation

unsigned long AllShifts ( word  Format,
unsigned long  Data 
)

Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first).

Parameters
[in]Format(number of bits shifted, 8 (F_BYTE), 16 (F_WORD), 20 (F_ADDR) or 32 (F_LONG))
[in]Data(data to be shifted into TDI)
Returns
unsigned long (scanned TDO value)

Definition at line 246 of file LowLevelFunc430X.c.

void configure_IO_JTAG ( void  )

Set JTAG pins to output direction - from REP430F to target.

Definition at line 630 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void configure_IO_SBW ( void  )

Set SBW pins to output direction - from REP430F to target.

Definition at line 642 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void Disable_Vpp ( void  )

Disable fuse blow voltage Vpp.

Definition at line 622 of file LowLevelFunc430X.c.

void DrvSignals ( void  )

Set up I/O pins for JTAG communication.

Definition at line 670 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void Enable_Vpp ( void  )

Enable fuse blow voltage Vpp.

Definition at line 613 of file LowLevelFunc430X.c.

Here is the call graph for this function:

word Get_Ext_Vcc ( void  )

Determine external VCC.

Returns
word (external VCC in mV)

Definition at line 454 of file LowLevelFunc430X.c.

Here is the call graph for this function:

word Get_target_Vcc ( void  )

Determine target VCC.

Returns
word (target VCC in mV)

Definition at line 446 of file LowLevelFunc430X.c.

Here is the call graph for this function:

word Get_Vx ( word  index)

Measure different voltages via ADC12.

Returns
word (voltage in mV)

Definition at line 462 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void InitController ( void  )

Initialization of the Controller Board.

Definition at line 310 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void InitTarget ( void  )

Initialization of the Target Board (switch voltages on, preset JTAG pins)

For devices with normal 4wires JTAG (JTAG4SBW=0)
For devices with Spy-Bi-Wire to work in 4wires JTAG (JTAG4SBW=1)

Definition at line 699 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void IO_3state ( void  )

Set all JTAG pins to input direction - from target to REP430F.

Definition at line 650 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void MsDelay ( word  milliseconds)

Delay function (resolution is 1 ms)

Parameters
[in]milliseconds(number of ms, max number is 0xFFFF)

Definition at line 716 of file LowLevelFunc430X.c.

void ReleaseTarget ( void  )

Release Target Board (switch voltages off, JTAG pins are HI-Z)

Definition at line 707 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void RlsSignals ( void  )

Release I/O pins.

Definition at line 687 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void RST_dir ( word  dir)

Set the direction for the RST pin.

Parameters
dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 564 of file LowLevelFunc430X.c.

void SetTargetVcc ( word  level)

Set target Vcc (supplied from REP430F)

input - 10*Vcc[V]-> range 2.1V to 3.6 V (data 21 to 36) or data = 0 -> Vcc OFF

Parameters
[in]level(requested VCC in V * 10)

Definition at line 426 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void SetVCoreUp ( word  level)

Function to set a specific voltage level via the PMM.

Parameters
[in]level

Definition at line 396 of file LowLevelFunc430X.c.

void SetVpp ( word  source)

function to set the fuse blow voltage Vpp

Parameters
source(Select the pin to which Vpp is applied according to chosen interface)

Definition at line 594 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void ShowStatus ( word  status,
word  index 
)

This function controls the status LEDs depending on the status argument. It stops program in error case.

Parameters
[in]status(4 stati - can be extended to 8 - possible for 3 LEDs - Yellow,Green,Red)
[in]index(additional number for detailed diagnostics or watch variable during debugging phase)

Definition at line 880 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void TCK_dir ( word  dir)

Set the direction for the TCK pin.

Parameters
dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 581 of file LowLevelFunc430X.c.

void TCLKstrobes ( word  Amount)

This function generates Amount strobes with the Flash Timing Generator.

Frequency fFTG = 257..476kHz (t = 3.9..2.1us). Used freq. in procedure - 400 kHz
User knows target frequency, instruction cycles, C implementation.
No. of MCKL cycles - 18MHz/400 kHz = 45 or 12MHz/400 kHz = 30

Parameters
[in]Amount(number of strobes to be generated)

Definition at line 827 of file LowLevelFunc430X.c.

void TDI_dir ( word  dir)

Set the direction for the TDI pin.

Parameters
[in]dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 506 of file LowLevelFunc430X.c.

void TDOI_dir ( word  dir)

Set the direction for the TDO pin.

Parameters
dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 518 of file LowLevelFunc430X.c.

void TDOisInput ( void  )

This function switches TDO to Input (used for fuse blowing)

Definition at line 662 of file LowLevelFunc430X.c.

Here is the call graph for this function:

void TEST_dir ( word  dir)

Set the direction for the TEST pin.

Parameters
dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 530 of file LowLevelFunc430X.c.

void TMS_dir ( word  dir)

Set the direction for the TMS pin.

Parameters
dir(0 = IN - from target to REP430F, !0 = OUT)

Definition at line 547 of file LowLevelFunc430X.c.

void usDelay ( word  microseconds)

Delay function (resolution is ~1 us)

Parameters
[in]microseconds(number of ms, max number is 0xFFFF)

Definition at line 731 of file LowLevelFunc430X.c.

Variable Documentation

byte TCLK_saved = SBWDATO

Holds the last value of TCLK before entering a JTAG sequence.

Definition at line 77 of file LowLevelFunc430X.c.

byte tdo_bit

Holds the value of TDO-bit.

Definition at line 75 of file LowLevelFunc430X.c.


Copyright 2016, Texas Instruments Incorporated