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.
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){
glitchH=high;
glitchL=low;
+ //debugstr("Set glitching voltages.");
#ifdef DAC12IR
ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on
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