From: travisutk Date: Tue, 19 Jan 2010 03:33:50 +0000 (+0000) Subject: More glitching improvements. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=b197a5b786af9a49508435b9da27459b8f85ba18;hp=ccbb5f9f7ae6fee33ba360030ecdaa76e7967024 More glitching improvements. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@268 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/apps/avr/avr.c b/firmware/apps/avr/avr.c index 577d878..1cb67e9 100644 --- a/firmware/apps/avr/avr.c +++ b/firmware/apps/avr/avr.c @@ -29,17 +29,17 @@ void avrconnect(){ SETSS; CLRCLK; - delay(10); + //delay(5); CLRSS; - delay(10); + //delay(5); //Enable programming avr_prgen(); } //! Read and write an SPI byte with delays. -unsigned char avrtrans8(unsigned char byte){ - register unsigned int bit; +u8 avrtrans8(u8 byte){ + register u16 bit; //This function came from the SPI Wikipedia article. //Minor alterations. diff --git a/firmware/apps/glitch/glitch.c b/firmware/apps/glitch/glitch.c index 9077245..59896c7 100644 --- a/firmware/apps/glitch/glitch.c +++ b/firmware/apps/glitch/glitch.c @@ -64,19 +64,10 @@ void glitchsetupdac(){ interrupt(TIMERA0_VECTOR) Timer_A (void) { #ifdef DAC12IR - debugstr("Glitching."); + //debugstr("Glitching."); DAC12_0DAT = 0;//glitchL; - asm("nop");/* asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop");*/ - //DAC12_0DAT = glitchH; + DAC12_0DAT = glitchH; //DAC12_0DAT = glitchL; /* switch(glitchstate){ @@ -117,6 +108,7 @@ void glitchvoltages(u16 low, u16 high){ glitchH=high; glitchL=low; + //debugstr("Set glitching voltages."); #ifdef DAC12IR ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on diff --git a/firmware/goodfet.c b/firmware/goodfet.c index aa3a3f5..2702fdd 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -28,6 +28,11 @@ void init(){ msp430_init_dco(); msp430_init_uart(); + //DAC should be at full voltage if it exists. + #ifdef DAC12IR + glitchvoltages(0xfff,0xfff); + #endif + //Enable Interrupts. //eint(); }