More glitching improvements.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 19 Jan 2010 03:33:50 +0000 (03:33 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 19 Jan 2010 03:33:50 +0000 (03:33 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@268 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/avr/avr.c
firmware/apps/glitch/glitch.c
firmware/goodfet.c

index 577d878..1cb67e9 100644 (file)
@@ -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.
   
index 9077245..59896c7 100644 (file)
@@ -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
index aa3a3f5..2702fdd 100644 (file)
@@ -28,6 +28,11 @@ void init(){
   msp430_init_dco();\r
   msp430_init_uart();\r
   \r
+  //DAC should be at full voltage if it exists.\r
+  #ifdef DAC12IR\r
+  glitchvoltages(0xfff,0xfff);\r
+  #endif\r
+  \r
   //Enable Interrupts.\r
   //eint();\r
 }\r