Macros | Functions | Variables
LowLevelFunc430.h File Reference

Detailed Description

Low Level function prototypes, macros, and pin-to-signal assignments regarding to user's hardware.

Definition in file LowLevelFunc430.h.

#include "Config430.h"
#include <msp430x54x.h>
Include dependency graph for LowLevelFunc430.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define JTAG_IF   1
 JTAG interface. More...
 
#define SPYBIWIREJTAG_IF   2
 JTAG interface on a device that supports JTAG and SBW. More...
 
#define SPYBIWIRE_IF   3
 Spy-Bi-Wire interface. More...
 
#define SPYBIWIRE_MODE
 
#define __DATAFORMATS__
 
#define F_BYTE   8
 
#define F_WORD   16
 
#define F_ADDR   20
 
#define F_LONG   32
 
#define STATUS_ERROR   0
 return 0 = error More...
 
#define STATUS_OK   1
 return 1 = no error More...
 
#define STATUS_FUSEBLOWN   2
 GetDevice returns this if the security fuse is blown. More...
 
#define STATUS_ACTIVE   2
 Replicator is active. More...
 
#define STATUS_IDLE   3
 Replicator is idling. More...
 
#define TRSLDIR   P2OUT
 
#define TRSL_CDIR   P2DIR
 
#define BRX_DIR   0x01
 BSL RX Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define BTX_DIR   0x02
 BSL TX Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define TEST_DIR   0x04
 TEST Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define RST_DIR   0x08
 RESET Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define TCK_DIR   0x10
 TCK Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define TMS_DIR   0x20
 TMS Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define TDOI_DIR   0x40
 TDO/TDI Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define TDI_DIR   0x80
 TDI Translator direction 0 - output from REP430F, 1 - input to REP430F. More...
 
#define SW_OUT   P1OUT
 
#define SW_IN   P1IN
 
#define SW_DIR   P1DIR
 
#define SW_PULLUP   P1REN
 
#define LED_OUT   P1OUT
 LED output register. More...
 
#define LED_DIR   P1DIR
 LED direction register. More...
 
#define SW_MODE0   0x01
 Mode-0 switch. More...
 
#define SW_MODE1   0x02
 Mode-1 switch. More...
 
#define SW_VPPEN   0x04
 Switch-Vpp Enable - test and set/clr. More...
 
#define LED_YELLOW   0x08
 YELLOW LED. More...
 
#define LED_GREEN   0x10
 GREEN LED. More...
 
#define LED_RED   0x20
 RED LED. More...
 
#define SW_1   0x40
 SW-1 TEST. More...
 
#define TVCC_OUT   P6OUT
 VCC output register. More...
 
#define TVCC_DIR   P6DIR
 VCC direction register. More...
 
#define TVCC_MASK   0xF0
 Minimum VCC value. More...
 
#define TVCC_SHIFT   4
 Value to shift up voltage level. More...
 
#define TVCC_EN_DIR   P5DIR
 
#define TVCC_EN_OUT   P5OUT
 
#define TVCC_DIS_BIT   1
 
#define LED_yellow_on()    ( LED_OUT |= LED_YELLOW )
 Switch on yellow LED. More...
 
#define LED_yellow_off()    ( LED_OUT &= ~LED_YELLOW )
 Switch off yellow LED. More...
 
#define LED_red_on()    ( LED_OUT |= LED_RED )
 Switch on red LED. More...
 
#define LED_red_off()    ( LED_OUT &= ~LED_RED )
 Switch off red LED. More...
 
#define LED_green_on()    ( LED_OUT |= LED_GREEN )
 Switch on green LED. More...
 
#define LED_green_off()    ( LED_OUT &= ~LED_GREEN )
 Switch off green LED. More...
 
#define All_LEDs_off()    ( LED_OUT &= ~(LED_GREEN | LED_RED | LED_YELLOW ))
 Switch off all LEDs. More...
 
#define JTAGOUT   P5OUT
 JTAG output register. More...
 
#define JTAGIN   P5IN
 JTAG input register. More...
 
#define JTAGDIR   P5DIR
 JTAG direction register. More...
 
#define JTAGSEL   P5SEL
 JTAG select register. More...
 
#define TMS   0x20
 P5.5 JTAG TMS input pin. More...
 
#define TDI   0x80
 P5.7 JTAG TDI input pin. More...
 
#define TDO   0x40
 P5.6 JTAG TDO output pin. More...
 
#define TCK   0x10
 P5.4 JTAG TCK input pin. More...
 
#define TEST   0x04
 P5.2 JTAG Test input pin. More...
 
#define RST   0x08
 P5.3 Hardware RESET input pin. More...
 
#define TCLK   TDI
 P5.7 TDI (former XOUT) receives TCLK. More...
 
#define BSLOUT   P3OUT
 BSL output register. More...
 
#define BSLIN   P3IN
 BSL input register. More...
 
#define BSLDIR   P3DIR
 BSL direction register. More...
 
#define BSLSEL   P3SEL
 BSL select register. More...
 
#define BSLTX   0x20
 P3.5 BSL-TX output pin. More...
 
#define BSLRX   0x10
 P3.4 BSL-RX input pin. More...
 
#define VPPOUT   P8OUT
 Fuse blow voltage (Vpp) output register. More...
 
#define VPPDIR   P8DIR
 Fuse blow voltage (Vpp) direction register. More...
 
#define VPPSEL   P8SEL
 Fuse blow voltage (Vpp) select register. More...
 
#define VPPONTEST   0x04
 P8.2 Fuse blow voltage switched to TEST. More...
 
#define VPPONTDI   0x02
 P8.1 Fuse blow voltage switched to TDI. More...
 
#define ONEMS   0x05DC
 CCR0 delay for 1ms with a 1.5 MHz TA clock. More...
 
#define ClrTMS()    ((JTAGOUT) &= (~TMS))
 JTAG macro: clear TMS signal. More...
 
#define SetTMS()    ((JTAGOUT) |= (TMS))
 JTAG macro: set TMS signal. More...
 
#define ClrTDI()    ((JTAGOUT) &= (~TDI))
 JTAG macro: clear TDI signal. More...
 
#define SetTDI()    ((JTAGOUT) |= (TDI))
 JTAG macro: set TDI signal. More...
 
#define ClrTCK()    ((JTAGOUT) &= (~TCK))
 JTAG macro: clear TCK signal. More...
 
#define SetTCK()    ((JTAGOUT) |= (TCK))
 JTAG macro: set TCK signal. More...
 
#define StoreTCLK()   ((JTAGOUT & TCLK))
 JTAG macro: return current TCLK signal (on TDI pin) More...
 
#define RestoreTCLK(x)   (x == 0 ? (JTAGOUT &= ~TCLK) : (JTAGOUT |= TCLK))
 JTAG macro: restore TCLK signal on TDI pin (based on input: x) More...
 
#define ScanTDO()    ((JTAGIN & TDO))
 JTAG macro: return TDO value (result 0 or TDO (0x40)) More...
 
#define VPPon(x)    (x == VPP_ON_TEST ? (SetVpp(VPPONTEST)) : (SetVpp(VPPONTDI)))
 Supply fuse blow voltage based on TEST or TDI pin (based on input: x(. More...
 
#define VPPoff()    (SetVpp(0))
 Switch off fuse blow voltage. More...
 
#define SetRST()    ((JTAGOUT) |= (RST))
 JTAG macro: set RST signal. More...
 
#define ClrRST()    ((JTAGOUT) &= (~RST))
 JTAG macro: clear RST signal. More...
 
#define ReleaseRST()   ( RST_dir( 0 ))
 JTAG macro: release RST pin. More...
 
#define SetTST()    ((JTAGOUT) |= (TEST))
 JTAG macro: set TST signal. More...
 
#define ClrTST()    ((JTAGOUT) &= (~TEST))
 JTAG macro: clear TST signal. More...
 
#define SBW_DELAY   { _NOP();_NOP();_NOP();_NOP();_NOP();}
 
#define SBWDATO   TDI
 JTAG data_out pin in SBW mode -separate pin in MSP430F5437 - common IO translator. More...
 
#define SBWDATI   TDO
 JTAG data in pin in SBW mode - separate pin in MSP430F5437 - common IO translator. More...
 
#define SBWCLK   TCK
 JTAG clock pin in SBW mode. More...
 
#define TMSH   JTAGOUT |= SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;
 SBW macro: set TMS signal. More...
 
#define TMSL   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;
 SBW macro: clear TMS signal. More...
 
#define TMSLDH   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWDATO; JTAGOUT |= SBWCLK;
 SBW macro: clear TMS signal and immediately set it high again in the SBWTCK low phase to enter the TDI slot with a high signal. More...
 
#define TDIH   JTAGOUT |= SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;
 SBW macro: Set TDI = 1. More...
 
#define TDIL   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;
 SBW macro: clear TDI signal. More...
 
#define TDOsbw   TRSLDIR |= TDOI_DIR; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK; TRSLDIR &= ~TDOI_DIR;
 SBW macro: TDO cycle without reading TDO. More...
 
#define TDO_RD   TRSLDIR |= TDOI_DIR; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; tdo_bit = JTAGIN; SBW_DELAY; JTAGOUT |= SBWCLK; TRSLDIR &= ~TDOI_DIR;
 SBW macro: TDO cycle with TDO read. More...
 
#define SetSBWTCK()    (JTAGOUT |= SBWCLK)
 SBW macro: set TCK signal. More...
 
#define ClrSBWTCK()    (JTAGOUT &= ~SBWCLK)
 SBW macro: clear TCK signal. More...
 
#define SetSBWTDIO()    (JTAGOUT |= SBWDATO)
 SBW macro: set TDIO signal. More...
 
#define ClrSBWTDIO()    (JTAGOUT &= ~SBWDATO)
 SBW macro: clear TDIO signal. More...
 
#define ClrTCLK()   ClrTCLK_sbw()
 SBW macro: clear TCLK signal. More...
 
#define SetTCLK()   SetTCLK_sbw()
 SBW macro: set TCLK signal. More...
 

Functions

void ClrTCLK_sbw (void)
 Clear TCLK in Spy-Bi-Wire mode. More...
 
void SetTCLK_sbw (void)
 Set TCLK in Spy-Bi-Wire mode. More...
 
void TMSL_TDIL (void)
 Combination of SBW macros: TMS low, TDI low, no TDO read. More...
 
void TMSH_TDIL (void)
 Combination of SBW macros: TMS high, TDI low, no TDO read. More...
 
void TMSL_TDIH (void)
 Combination of SBW macros: TMS low, TDI high, no TDO read. More...
 
void TMSH_TDIH (void)
 Combination of SBW macros: TMS high, TDI high, no TDO read. More...
 
void TMSL_TDIH_TDOrd (void)
 Combination of SBW macros: TMS low, TDI high, TDO read. More...
 
void TMSL_TDIL_TDOrd (void)
 Combination of SBW macros: TMS low, TDI low, TDO read. More...
 
void TMSH_TDIH_TDOrd (void)
 Combination of SBW macros: TMS high, TDI high, TDO read. More...
 
void TMSH_TDIL_TDOrd (void)
 Combination of SBW macros: TMS high, TDI low, TDO read. More...
 
void IR_Ex_Blow_SBW_Shift (void)
 Provide JTAG fuse blow instruction. More...
 
void MsDelay (word milliseconds)
 Delay function (resolution is 1 ms) More...
 
void usDelay (word microeconds)
 Delay function (resolution is ~1 us) More...
 
void InitController (void)
 Initialization of the Controller Board. 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...
 
word Shift (word Format, word Data)
 Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first). More...
 
void TDOisInput (void)
 This function switches TDO to Input (used for fuse blowing) More...
 
void TCLKstrobes (word Amount)
 
void ShowStatus (word Status, word Index)
 This function controls the status LEDs depending on the status argument. It stops program in error case. More...
 
void TriggerPulse (word Mode)
 
void DrvSignals (void)
 Set up I/O pins for JTAG communication. More...
 
void RlsSignals (void)
 Release I/O pins. 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...
 
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 SetVCoreUp (word level)
 Function to set a specific voltage level via the PMM. More...
 
word Get_Vx (word index)
 Measure different voltages via ADC12. 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_BSL (void)
 
void IO_3state (void)
 Set all JTAG pins to input direction - from target to REP430F. More...
 
void configure_IO_SBW (void)
 Set SBW pins to output direction - from REP430F to target. More...
 

Variables

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

Macro Definition Documentation

#define All_LEDs_off ( )    ( LED_OUT &= ~(LED_GREEN | LED_RED | LED_YELLOW ))

Switch off all LEDs.

Definition at line 195 of file LowLevelFunc430.h.

#define BRX_DIR   0x01

BSL RX Translator direction 0 - output from REP430F, 1 - input to REP430F.

Not used in this project

Definition at line 126 of file LowLevelFunc430.h.

#define BSLDIR   P3DIR

BSL direction register.

Not used in this project

Definition at line 229 of file LowLevelFunc430.h.

#define BSLIN   P3IN

BSL input register.

Not used in this project

Definition at line 226 of file LowLevelFunc430.h.

#define BSLOUT   P3OUT

BSL output register.

Not used in this project

Definition at line 223 of file LowLevelFunc430.h.

#define BSLRX   0x10

P3.4 BSL-RX input pin.

Not used in this project

Definition at line 238 of file LowLevelFunc430.h.

#define BSLSEL   P3SEL

BSL select register.

Not used in this project

Definition at line 232 of file LowLevelFunc430.h.

#define BSLTX   0x20

P3.5 BSL-TX output pin.

Not used in this project

Definition at line 235 of file LowLevelFunc430.h.

#define BTX_DIR   0x02

BSL TX Translator direction 0 - output from REP430F, 1 - input to REP430F.

Not used in this project

Definition at line 129 of file LowLevelFunc430.h.

#define ClrRST ( )    ((JTAGOUT) &= (~RST))

JTAG macro: clear RST signal.

Definition at line 286 of file LowLevelFunc430.h.

#define ClrSBWTCK ( )    (JTAGOUT &= ~SBWCLK)

SBW macro: clear TCK signal.

Definition at line 327 of file LowLevelFunc430.h.

#define ClrSBWTDIO ( )    (JTAGOUT &= ~SBWDATO)

SBW macro: clear TDIO signal.

Definition at line 331 of file LowLevelFunc430.h.

#define ClrTCK ( )    ((JTAGOUT) &= (~TCK))

JTAG macro: clear TCK signal.

Definition at line 270 of file LowLevelFunc430.h.

#define ClrTCLK ( )    ClrTCLK_sbw()

SBW macro: clear TCLK signal.

Definition at line 338 of file LowLevelFunc430.h.

#define ClrTDI ( )    ((JTAGOUT) &= (~TDI))

JTAG macro: clear TDI signal.

Definition at line 266 of file LowLevelFunc430.h.

#define ClrTMS ( )    ((JTAGOUT) &= (~TMS))

JTAG macro: clear TMS signal.

Definition at line 262 of file LowLevelFunc430.h.

#define ClrTST ( )    ((JTAGOUT) &= (~TEST))

JTAG macro: clear TST signal.

Definition at line 292 of file LowLevelFunc430.h.

#define JTAG_IF   1

JTAG interface.

Definition at line 76 of file LowLevelFunc430.h.

#define JTAGDIR   P5DIR

JTAG direction register.

Definition at line 203 of file LowLevelFunc430.h.

#define JTAGIN   P5IN

JTAG input register.

Definition at line 201 of file LowLevelFunc430.h.

#define JTAGOUT   P5OUT

JTAG output register.

Definition at line 199 of file LowLevelFunc430.h.

#define JTAGSEL   P5SEL

JTAG select register.

Definition at line 205 of file LowLevelFunc430.h.

#define LED_DIR   P1DIR

LED direction register.

Definition at line 150 of file LowLevelFunc430.h.

#define LED_GREEN   0x10

GREEN LED.

Definition at line 161 of file LowLevelFunc430.h.

#define LED_green_off ( )    ( LED_OUT &= ~LED_GREEN )

Switch off green LED.

Definition at line 193 of file LowLevelFunc430.h.

#define LED_green_on ( )    ( LED_OUT |= LED_GREEN )

Switch on green LED.

Definition at line 191 of file LowLevelFunc430.h.

#define LED_OUT   P1OUT

LED output register.

Definition at line 148 of file LowLevelFunc430.h.

#define LED_RED   0x20

RED LED.

Definition at line 163 of file LowLevelFunc430.h.

#define LED_red_off ( )    ( LED_OUT &= ~LED_RED )

Switch off red LED.

Definition at line 189 of file LowLevelFunc430.h.

#define LED_red_on ( )    ( LED_OUT |= LED_RED )

Switch on red LED.

Definition at line 187 of file LowLevelFunc430.h.

#define LED_YELLOW   0x08

YELLOW LED.

Definition at line 159 of file LowLevelFunc430.h.

#define LED_yellow_off ( )    ( LED_OUT &= ~LED_YELLOW )

Switch off yellow LED.

Definition at line 185 of file LowLevelFunc430.h.

#define LED_yellow_on ( )    ( LED_OUT |= LED_YELLOW )

Switch on yellow LED.

Definition at line 183 of file LowLevelFunc430.h.

#define ONEMS   0x05DC

CCR0 delay for 1ms with a 1.5 MHz TA clock.

Definition at line 255 of file LowLevelFunc430.h.

#define ReleaseRST ( )    ( RST_dir( 0 ))

JTAG macro: release RST pin.

Definition at line 288 of file LowLevelFunc430.h.

#define RestoreTCLK (   x)    (x == 0 ? (JTAGOUT &= ~TCLK) : (JTAGOUT |= TCLK))

JTAG macro: restore TCLK signal on TDI pin (based on input: x)

Definition at line 276 of file LowLevelFunc430.h.

#define RST   0x08

P5.3 Hardware RESET input pin.

Definition at line 217 of file LowLevelFunc430.h.

#define RST_DIR   0x08

RESET Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 133 of file LowLevelFunc430.h.

#define SBWCLK   TCK

JTAG clock pin in SBW mode.

Definition at line 304 of file LowLevelFunc430.h.

#define SBWDATI   TDO

JTAG data in pin in SBW mode - separate pin in MSP430F5437 - common IO translator.

Definition at line 302 of file LowLevelFunc430.h.

#define SBWDATO   TDI

JTAG data_out pin in SBW mode -separate pin in MSP430F5437 - common IO translator.

Definition at line 300 of file LowLevelFunc430.h.

#define ScanTDO ( )    ((JTAGIN & TDO))

JTAG macro: return TDO value (result 0 or TDO (0x40))

Definition at line 278 of file LowLevelFunc430.h.

#define SetRST ( )    ((JTAGOUT) |= (RST))

JTAG macro: set RST signal.

Definition at line 284 of file LowLevelFunc430.h.

#define SetSBWTCK ( )    (JTAGOUT |= SBWCLK)

SBW macro: set TCK signal.

Definition at line 325 of file LowLevelFunc430.h.

#define SetSBWTDIO ( )    (JTAGOUT |= SBWDATO)

SBW macro: set TDIO signal.

Definition at line 329 of file LowLevelFunc430.h.

#define SetTCK ( )    ((JTAGOUT) |= (TCK))

JTAG macro: set TCK signal.

Definition at line 272 of file LowLevelFunc430.h.

#define SetTCLK ( )    SetTCLK_sbw()

SBW macro: set TCLK signal.

Definition at line 340 of file LowLevelFunc430.h.

#define SetTDI ( )    ((JTAGOUT) |= (TDI))

JTAG macro: set TDI signal.

Definition at line 268 of file LowLevelFunc430.h.

#define SetTMS ( )    ((JTAGOUT) |= (TMS))

JTAG macro: set TMS signal.

Definition at line 264 of file LowLevelFunc430.h.

#define SetTST ( )    ((JTAGOUT) |= (TEST))

JTAG macro: set TST signal.

Definition at line 290 of file LowLevelFunc430.h.

#define SPYBIWIRE_IF   3

Spy-Bi-Wire interface.

Definition at line 80 of file LowLevelFunc430.h.

#define SPYBIWIREJTAG_IF   2

JTAG interface on a device that supports JTAG and SBW.

Definition at line 78 of file LowLevelFunc430.h.

#define STATUS_ACTIVE   2

Replicator is active.

Definition at line 103 of file LowLevelFunc430.h.

#define STATUS_ERROR   0

return 0 = error

Definition at line 96 of file LowLevelFunc430.h.

#define STATUS_FUSEBLOWN   2

GetDevice returns this if the security fuse is blown.

Definition at line 100 of file LowLevelFunc430.h.

#define STATUS_IDLE   3

Replicator is idling.

Definition at line 105 of file LowLevelFunc430.h.

#define STATUS_OK   1

return 1 = no error

Definition at line 98 of file LowLevelFunc430.h.

#define StoreTCLK ( )    ((JTAGOUT & TCLK))

JTAG macro: return current TCLK signal (on TDI pin)

Definition at line 274 of file LowLevelFunc430.h.

#define SW_1   0x40

SW-1 TEST.

Definition at line 165 of file LowLevelFunc430.h.

#define SW_MODE0   0x01

Mode-0 switch.

Definition at line 153 of file LowLevelFunc430.h.

#define SW_MODE1   0x02

Mode-1 switch.

Definition at line 155 of file LowLevelFunc430.h.

#define SW_VPPEN   0x04

Switch-Vpp Enable - test and set/clr.

Definition at line 157 of file LowLevelFunc430.h.

#define TCK   0x10

P5.4 JTAG TCK input pin.

Definition at line 213 of file LowLevelFunc430.h.

#define TCK_DIR   0x10

TCK Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 135 of file LowLevelFunc430.h.

#define TCLK   TDI

P5.7 TDI (former XOUT) receives TCLK.

Definition at line 219 of file LowLevelFunc430.h.

#define TDI   0x80

P5.7 JTAG TDI input pin.

Definition at line 209 of file LowLevelFunc430.h.

#define TDI_DIR   0x80

TDI Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 141 of file LowLevelFunc430.h.

#define TDIH   JTAGOUT |= SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;

SBW macro: Set TDI = 1.

Definition at line 316 of file LowLevelFunc430.h.

#define TDIL   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;

SBW macro: clear TDI signal.

Definition at line 318 of file LowLevelFunc430.h.

#define TDO   0x40

P5.6 JTAG TDO output pin.

Definition at line 211 of file LowLevelFunc430.h.

#define TDO_RD   TRSLDIR |= TDOI_DIR; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; tdo_bit = JTAGIN; SBW_DELAY; JTAGOUT |= SBWCLK; TRSLDIR &= ~TDOI_DIR;

SBW macro: TDO cycle with TDO read.

Definition at line 322 of file LowLevelFunc430.h.

#define TDOI_DIR   0x40

TDO/TDI Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 139 of file LowLevelFunc430.h.

#define TDOsbw   TRSLDIR |= TDOI_DIR; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK; TRSLDIR &= ~TDOI_DIR;

SBW macro: TDO cycle without reading TDO.

Definition at line 320 of file LowLevelFunc430.h.

#define TEST   0x04

P5.2 JTAG Test input pin.

Definition at line 215 of file LowLevelFunc430.h.

#define TEST_DIR   0x04

TEST Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 131 of file LowLevelFunc430.h.

#define TMS   0x20

P5.5 JTAG TMS input pin.

Definition at line 207 of file LowLevelFunc430.h.

#define TMS_DIR   0x20

TMS Translator direction 0 - output from REP430F, 1 - input to REP430F.

Definition at line 137 of file LowLevelFunc430.h.

#define TMSH   JTAGOUT |= SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;

SBW macro: set TMS signal.

Definition at line 307 of file LowLevelFunc430.h.

#define TMSL   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWCLK;

SBW macro: clear TMS signal.

Definition at line 309 of file LowLevelFunc430.h.

#define TMSLDH   JTAGOUT &= ~SBWDATO; SBW_DELAY; JTAGOUT &= ~SBWCLK; SBW_DELAY; JTAGOUT |= SBWDATO; JTAGOUT |= SBWCLK;

SBW macro: clear TMS signal and immediately set it high again in the SBWTCK low phase to enter the TDI slot with a high signal.

Only used to clock TCLK (=TDI for SBW) in Run-Test/IDLE mode of the JTAG FSM

Definition at line 314 of file LowLevelFunc430.h.

#define TVCC_DIR   P6DIR

VCC direction register.

Definition at line 172 of file LowLevelFunc430.h.

#define TVCC_MASK   0xF0

Minimum VCC value.

Definition at line 174 of file LowLevelFunc430.h.

#define TVCC_OUT   P6OUT

VCC output register.

Definition at line 170 of file LowLevelFunc430.h.

#define TVCC_SHIFT   4

Value to shift up voltage level.

Definition at line 176 of file LowLevelFunc430.h.

#define VPPDIR   P8DIR

Fuse blow voltage (Vpp) direction register.

Definition at line 244 of file LowLevelFunc430.h.

#define VPPoff ( )    (SetVpp(0))

Switch off fuse blow voltage.

Definition at line 282 of file LowLevelFunc430.h.

#define VPPon (   x)    (x == VPP_ON_TEST ? (SetVpp(VPPONTEST)) : (SetVpp(VPPONTDI)))

Supply fuse blow voltage based on TEST or TDI pin (based on input: x(.

Definition at line 280 of file LowLevelFunc430.h.

#define VPPONTDI   0x02

P8.1 Fuse blow voltage switched to TDI.

Definition at line 251 of file LowLevelFunc430.h.

#define VPPONTEST   0x04

P8.2 Fuse blow voltage switched to TEST.

Definition at line 249 of file LowLevelFunc430.h.

#define VPPOUT   P8OUT

Fuse blow voltage (Vpp) output register.

Definition at line 242 of file LowLevelFunc430.h.

#define VPPSEL   P8SEL

Fuse blow voltage (Vpp) select register.

Definition at line 246 of file LowLevelFunc430.h.

Function Documentation

void ClrTCLK_sbw ( void  )

Clear TCLK in Spy-Bi-Wire mode.

enters with TCLK_saved and exits with TCLK = 0

Definition at line 135 of file LowLevelFunc430.c.

void configure_IO_JTAG ( void  )

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

Definition at line 610 of file LowLevelFunc430.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 622 of file LowLevelFunc430.c.

Here is the call graph for this function:

void Disable_Vpp ( void  )

Disable fuse blow voltage Vpp.

Definition at line 603 of file LowLevelFunc430.c.

void DrvSignals ( void  )

Set up I/O pins for JTAG communication.

Definition at line 650 of file LowLevelFunc430.c.

Here is the call graph for this function:

void Enable_Vpp ( void  )

Enable fuse blow voltage Vpp.

Definition at line 594 of file LowLevelFunc430.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 445 of file LowLevelFunc430.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 437 of file LowLevelFunc430.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 453 of file LowLevelFunc430.c.

Here is the call graph for this function:

void InitController ( void  )

Initialization of the Controller Board.

Definition at line 302 of file LowLevelFunc430.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 680 of file LowLevelFunc430.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 630 of file LowLevelFunc430.c.

Here is the call graph for this function:

void IR_Ex_Blow_SBW_Shift ( void  )

Provide JTAG fuse blow instruction.

Definition at line 174 of file LowLevelFunc430.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 697 of file LowLevelFunc430.c.

void ReleaseTarget ( void  )

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

Definition at line 688 of file LowLevelFunc430.c.

Here is the call graph for this function:

void RlsSignals ( void  )

Release I/O pins.

Definition at line 668 of file LowLevelFunc430.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 548 of file LowLevelFunc430.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 417 of file LowLevelFunc430.c.

Here is the call graph for this function:

void SetTCLK_sbw ( void  )

Set TCLK in Spy-Bi-Wire mode.

enters with TCLK_saved and exits with TCLK = 1

Definition at line 155 of file LowLevelFunc430.c.

void SetVCoreUp ( word  level)

Function to set a specific voltage level via the PMM.

Parameters
[in]level

Definition at line 387 of file LowLevelFunc430.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 575 of file LowLevelFunc430.c.

Here is the call graph for this function:

word Shift ( word  Format,
word  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 218 of file LowLevelFunc430.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 861 of file LowLevelFunc430.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 564 of file LowLevelFunc430.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 494 of file LowLevelFunc430.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 505 of file LowLevelFunc430.c.

void TDOisInput ( void  )

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

Definition at line 642 of file LowLevelFunc430.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 516 of file LowLevelFunc430.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 532 of file LowLevelFunc430.c.

void TMSH_TDIH ( void  )

Combination of SBW macros: TMS high, TDI high, no TDO read.

Definition at line 103 of file LowLevelFunc430.c.

void TMSH_TDIH_TDOrd ( void  )

Combination of SBW macros: TMS high, TDI high, TDO read.

Definition at line 121 of file LowLevelFunc430.c.

void TMSH_TDIL ( void  )

Combination of SBW macros: TMS high, TDI low, no TDO read.

Definition at line 91 of file LowLevelFunc430.c.

void TMSH_TDIL_TDOrd ( void  )

Combination of SBW macros: TMS high, TDI low, TDO read.

Definition at line 127 of file LowLevelFunc430.c.

void TMSL_TDIH ( void  )

Combination of SBW macros: TMS low, TDI high, no TDO read.

Definition at line 97 of file LowLevelFunc430.c.

void TMSL_TDIH_TDOrd ( void  )

Combination of SBW macros: TMS low, TDI high, TDO read.

Definition at line 109 of file LowLevelFunc430.c.

void TMSL_TDIL ( void  )

Combination of SBW macros: TMS low, TDI low, no TDO read.

Definition at line 85 of file LowLevelFunc430.c.

void TMSL_TDIL_TDOrd ( void  )

Combination of SBW macros: TMS low, TDI low, TDO read.

Definition at line 115 of file LowLevelFunc430.c.

void usDelay ( word  microseconds)

Delay function (resolution is ~1 us)

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

Definition at line 712 of file LowLevelFunc430.c.

Variable Documentation

byte TCLK_saved

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

Definition at line 75 of file LowLevelFunc430.c.


Copyright 2016, Texas Instruments Incorporated