#include <iomacros.h>
#include "avr.h"
#include <iomacros.h>
#include "avr.h"
//! Setup the AVR pins.
void avrsetup(){
//! Setup the AVR pins.
void avrsetup(){
void avrconnect(){
//set I/O pins
avrsetup(); //Cut this?
void avrconnect(){
//set I/O pins
avrsetup(); //Cut this?
//Pulse !RST (SS) at least twice while CLK is low.
CLRCLK;
CLRSS;
//Pulse !RST (SS) at least twice while CLK is low.
CLRCLK;
CLRSS;
//Enable programming
avr_prgen();
//Enable programming
avr_prgen();
void glitchprime(){
#ifdef DAC12IR
//Don't forget to call glitchvoltages().
void glitchprime(){
#ifdef DAC12IR
//Don't forget to call glitchvoltages().
//Reconfigure TACTL.
TACTL=0; //Clear dividers.
TACTL|=TACLR; //Clear TimerA Config
//Reconfigure TACTL.
TACTL=0; //Clear dividers.
TACTL|=TACLR; //Clear TimerA Config
CCR0 = glitchcount;
//Enable general interrupts, just in case.
CCR0 = glitchcount;
//Enable general interrupts, just in case.
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = glitchcount;
TACTL |= MC1; // Start Timer_A in continuous mode
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = glitchcount;
TACTL |= MC1; // Start Timer_A in continuous mode
+ //TACTL |= MC0; // Stop Timer_A;
_EINT(); // Enable interrupts
#endif
}
_EINT(); // Enable interrupts
#endif
}
// Timer A0 interrupt service routine
interrupt(TIMERA0_VECTOR) Timer_A (void)
{
// Timer A0 interrupt service routine
interrupt(TIMERA0_VECTOR) Timer_A (void)
{
P5OUT&=~BIT7;//Glitch
P5OUT|=BIT7;//Normal
P5OUT&=~BIT7;//Glitch
P5OUT|=BIT7;//Normal
TACTL |= MC0; // Stop Timer_A;
TACTL |= MC0; // Stop Timer_A;
doesn't clear P5OUT or P5DIR.\r
*/\r
P5DIR|=BIT7; P5OUT=BIT7; //Normal Supply\r
doesn't clear P5OUT or P5DIR.\r
*/\r
P5DIR|=BIT7; P5OUT=BIT7; //Normal Supply\r
- P5DIR&=~BIT7; //Glitch Supply\r
+ //P5DIR&=~BIT7; //Glitch Supply\r
\r
//Enable Interrupts.\r
//eint();\r
\r
//Enable Interrupts.\r
//eint();\r