Cleaning up the glitching scripts.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 7 Mar 2010 19:10:52 +0000 (19:10 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 7 Mar 2010 19:10:52 +0000 (19:10 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@393 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETAVR.py
firmware/apps/avr/avr.c
firmware/apps/glitch/glitch.c

index f8189bf..30354cd 100644 (file)
@@ -116,7 +116,8 @@ class GoodFETAVR(GoodFET):
         """Read the target's lockbits."""
         self.writecmd(self.AVRAPP,0x92,1,[bits]);
         return self.lockbits();
         """Read the target's lockbits."""
         self.writecmd(self.AVRAPP,0x92,1,[bits]);
         return self.lockbits();
-    
+    def lock(self):
+        self.setlockbits(0xFC);
     def eeprompeek(self, adr):
         """Read a byte of the target's EEPROM."""
         self.writecmd(self.AVRAPP,0x81 ,2,
     def eeprompeek(self, adr):
         """Read a byte of the target's EEPROM."""
         self.writecmd(self.AVRAPP,0x81 ,2,
index 53d9f30..9531563 100644 (file)
@@ -24,18 +24,18 @@ void avrconnect(){
   avrsetup(); //Cut this?
   
   SETSS;
   avrsetup(); //Cut this?
   
   SETSS;
-  delay(50);
+  //delay(50);
   
   //Pulse !RST (SS) at least twice while CLK is low.
   CLRCLK;
   CLRSS;
   
   //Pulse !RST (SS) at least twice while CLK is low.
   CLRCLK;
   CLRSS;
-  delay(5);
+  //delay(5);
 
   SETSS;
   CLRCLK;
 
   SETSS;
   CLRCLK;
-  delay(5);
+  //delay(5);
   CLRSS;
   CLRSS;
-  delay(5);
+  //delay(5);
   
   //Enable programming
   avr_prgen();
   
   //Enable programming
   avr_prgen();
index 1962190..8b43594 100644 (file)
@@ -56,7 +56,7 @@ interrupt(TIMERA0_VECTOR) Timer_A (void){
   P5OUT^=BIT7;//Normal
   
   //This oughtn't be necessary, but glitches repeat without it.
   P5OUT^=BIT7;//Normal
   
   //This oughtn't be necessary, but glitches repeat without it.
-  //TACTL=0; //disable counter.
+  TACTL=0; //disable counter.
   
   //P5OUT^=BIT7;//Normal
   return;
   
   //P5OUT^=BIT7;//Normal
   return;
@@ -138,13 +138,14 @@ void glitchhandle(unsigned char app,
     break;
   case START:
     //Testing mode, for looking at the glitch waveform.
     break;
   case START:
     //Testing mode, for looking at the glitch waveform.
-    glitchvoltages(0xFFF,0);//Inverted VCC and GND.
+    glitchvoltages(0,0xFFF);//Minimum glitch, for noise test.
+    //glitchvoltages(0,0);//Drop VCC
+    //glitchvoltages(0xFFF,0xFFF);//Raise Ground
     P5OUT|=BIT7;//Normal
     P5DIR|=BIT7;
     while(1){
       P5OUT&=~BIT7;//Glitch
     P5OUT|=BIT7;//Normal
     P5DIR|=BIT7;
     while(1){
       P5OUT&=~BIT7;//Glitch
-      //asm("nop");//asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
-      //asm("nop"); //Not necessary.
+      //asm("nop"); //Not Necessary
       P5OUT|=BIT7;//Normal
       asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
       asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
       P5OUT|=BIT7;//Normal
       asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
       asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");