2 \author Travis Goodspeed
3 \brief Glitching Support for GoodFET20
5 See the TI example MSP430x261x_dac12_01.c for usage of the DAC.
6 This module sends odd and insufficient voltages on P6.6/DAC0
7 in order to bypass security restrictions of target devices.
14 //! Disable glitch state at init.
17 //Set GSEL high to disable glitching.
29 //! Setup analog chain for glitching.
30 void glitchsetupdac(){
31 glitchvoltages(glitchL,glitchH);
35 u16 glitchH=0xfff, glitchL=0xfff,
36 glitchstate, glitchcount;
38 //! Glitch an application.
39 void glitchapp(u8 app){
40 debugstr("That app is not yet supported.");
42 //! Set glitching voltages.
43 void glitchvoltages(u16 low, u16 high){
50 ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on
51 // Delay here for reference to settle.
52 for(i=0;i!=0xFFFF;i++) asm("nop");
53 DAC12_0CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; // Int ref gain 1
54 // 1.0V 0x0666, 2.5V 0x0FFF
56 //DAC12_0DAT = 0x0880;
59 //! Set glitching rate.
60 void glitchrate(u16 rate){
65 //! Handles a monitor command.
66 void glitchhandle(unsigned char app,
71 glitchvoltages(cmddataword[0],
76 glitchrate(cmddataword[0]);
84 debugstr("Unknown glitching verb.");