![]() |
![]() |
Low Level Functions regarding user's Hardware.
Definition in file LowLevelFunc430Xv2.c.
#include "LowLevelFunc430Xv2.h"
Go to the source code of this file.
Functions | |
void | TMSL_TDIL (void) |
void | TMSH_TDIL (void) |
void | TMSL_TDIH (void) |
void | TMSH_TDIH (void) |
void | TMSL_TDIH_TDOrd (void) |
void | TMSL_TDIL_TDOrd (void) |
void | TMSH_TDIH_TDOrd (void) |
void | TMSH_TDIL_TDOrd (void) |
void | ClrTCLK_sbw (void) |
Clear TCLK in Spy-Bi-Wire mode. More... | |
void | SetTCLK_sbw (void) |
Set TCLK in Spy-Bi-Wire mode. More... | |
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... | |
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).
Format | (number of bits shifted, 8 (F_BYTE), 16 (F_WORD), 20 (F_ADDR) or 32 (F_LONG)) |
Data | (data to be shifted into TDI) |
Definition at line 173 of file LowLevelFunc430Xv2.c.
void ClrTCLK_sbw | ( | void | ) |
Clear TCLK in Spy-Bi-Wire mode.
enters with TCLK_saved and exits with TCLK = 0
Definition at line 129 of file LowLevelFunc430Xv2.c.
void configure_IO_JTAG | ( | void | ) |
Set JTAG pins to output direction - from REP430F to target.
Definition at line 593 of file LowLevelFunc430Xv2.c.
void configure_IO_SBW | ( | void | ) |
Set SBW pins to output direction - from REP430F to target.
Definition at line 604 of file LowLevelFunc430Xv2.c.
void Disable_Vpp | ( | void | ) |
Disable fuse blow voltage Vpp.
Definition at line 585 of file LowLevelFunc430Xv2.c.
void DrvSignals | ( | void | ) |
Set up I/O pins for JTAG communication.
Definition at line 632 of file LowLevelFunc430Xv2.c.
void Enable_Vpp | ( | void | ) |
Enable fuse blow voltage Vpp.
Definition at line 576 of file LowLevelFunc430Xv2.c.
word Get_Ext_Vcc | ( | void | ) |
Determine external VCC.
Definition at line 423 of file LowLevelFunc430Xv2.c.
word Get_target_Vcc | ( | void | ) |
Determine target VCC.
Definition at line 415 of file LowLevelFunc430Xv2.c.
word Get_Vx | ( | word | index | ) |
Measure different voltages via ADC12.
Definition at line 431 of file LowLevelFunc430Xv2.c.
void InitController | ( | void | ) |
Initialization of the Controller Board.
Definition at line 289 of file LowLevelFunc430Xv2.c.
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 660 of file LowLevelFunc430Xv2.c.
void IO_3state | ( | void | ) |
Set all JTAG pins to input direction - from target to REP430F.
Definition at line 612 of file LowLevelFunc430Xv2.c.
void MsDelay | ( | word | milliseconds | ) |
Delay function (resolution is 1 ms)
milliseconds | (number of ms, max number is 0xFFFF) |
Definition at line 677 of file LowLevelFunc430Xv2.c.
void ReleaseTarget | ( | void | ) |
Release Target Board (switch voltages off, JTAG pins are HI-Z)
Definition at line 668 of file LowLevelFunc430Xv2.c.
void RlsSignals | ( | void | ) |
Release I/O pins.
Definition at line 648 of file LowLevelFunc430Xv2.c.
void RST_dir | ( | word | dir | ) |
Set the direction for the RST pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 529 of file LowLevelFunc430Xv2.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
level | (requested VCC in V * 10) |
Definition at line 395 of file LowLevelFunc430Xv2.c.
void SetTCLK_sbw | ( | void | ) |
Set TCLK in Spy-Bi-Wire mode.
enters with TCLK_saved and exits with TCLK = 1
Definition at line 149 of file LowLevelFunc430Xv2.c.
void SetVCoreUp | ( | word | level | ) |
Function to set a specific voltage level via the PMM.
level |
Definition at line 367 of file LowLevelFunc430Xv2.c.
void SetVpp | ( | word | source | ) |
function to set the fuse blow voltage Vpp
source | (Select the pin to which Vpp is applied according to chosen interface) |
Definition at line 557 of file LowLevelFunc430Xv2.c.
void ShowStatus | ( | word | status, |
word | index | ||
) |
This function controls the status LEDs depending on the status argument. It stops program in error case.
status | (4 stati - can be extended to 8 - possible for 3 LEDs - Yellow,Green,Red) |
index | (additional number for detailed diagnostics or watch variable during debugging phase) |
Definition at line 775 of file LowLevelFunc430Xv2.c.
void TCK_dir | ( | word | dir | ) |
Set the direction for the TCK pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 546 of file LowLevelFunc430Xv2.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
Amount | (number of strobes to be generated) |
Definition at line 723 of file LowLevelFunc430Xv2.c.
void TDI_dir | ( | word | dir | ) |
Set the direction for the TDI pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 471 of file LowLevelFunc430Xv2.c.
void TDOI_dir | ( | word | dir | ) |
Set the direction for the TDO pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 483 of file LowLevelFunc430Xv2.c.
void TDOisInput | ( | void | ) |
This function switches TDO to Input (used for fuse blowing)
Definition at line 624 of file LowLevelFunc430Xv2.c.
void TEST_dir | ( | word | dir | ) |
Set the direction for the TEST pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 495 of file LowLevelFunc430Xv2.c.
void TMS_dir | ( | word | dir | ) |
Set the direction for the TMS pin.
dir | (0 = IN - from target to REP430F, !0 = OUT) |
Definition at line 512 of file LowLevelFunc430Xv2.c.
void usDelay | ( | word | microseconds | ) |
Delay function (resolution is ~1 us)
microseconds | (number of ms, max number is 0xFFFF) |
Definition at line 692 of file LowLevelFunc430Xv2.c.
byte TCLK_saved = SBWDATO |
Holds the last value of TCLK before entering a JTAG sequence.
Definition at line 77 of file LowLevelFunc430Xv2.c.
byte tdo_bit |
Holds the value of TDO-bit.
Definition at line 75 of file LowLevelFunc430Xv2.c.