Skip to content

Instantly share code, notes, and snippets.

// Pseudo-code. May not compile or work
for (;;)
{
// Check for host data
uint16_t byteCount = CDC_Device_BytesReceived(&EETool_CDC_Interface);
byteCount = MIN(byteCount,BUFF_SIZE-1);
if (byteCount>BUFF_SIZE)
{
FatalError();
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include <string.h>
#include <stdio.h>
#include <LUFA/Drivers/USB/USB.h>
#include "Descriptors.h"
#include "Macros.h"
#!/usr/bin/python
import sys, getopt, serial, binascii
class Mode:
NONE = 0
DUMP = 1
BURN = 2
CHECK = 3
// Pseudo-code. May not compile or work
for (;;)
{
// Check for host data
uint16_t byteCount = CDC_Device_BytesReceived(&EETool_CDC_Interface);
byteCount = MIN(byteCount,BUFF_SIZE-1);
if (byteCount>BUFF_SIZE)
{
FatalError();
// Pseudo-code. May not compile or work
for (;;)
{
// Check for host data
uint16_t byteCount = CDC_Device_BytesReceived(&EETool_CDC_Interface);
byteCount = MIN(byteCount,BUFF_SIZE-1);
if (byteCount>BUFF_SIZE)
{
FatalError();
@blondie7575
blondie7575 / AVRInterrupt.asm
Created August 19, 2012 23:49
AVR interrupt setup
// Configure INT2 (interrupt 2, on line PB2) to be a rising
// edge interrupt that we'll get from the CPU
// See ATmega324PA datasheet p68
cbi EIMSK,INT2_BIT
ldi accum,EICRA
ori accum,_BV(ISC20) | _BV(ISC21)
sts EICRA,accum
cbi EIFR,INTF2
sbi EIMSK,INT2_BIT
INT2_vect:
// Get ourselves completely off the bus
clr accum
out PORTD,accum
out DDRD,accum
out DDRC,accum
out DDRA,accum
sbi PORTB,vramWrite
$C784: STA $C028
RTS
FCA8: 38 SEC ; 2
FCA9: 48 PHA ; 3
FCAA: E9 01 SBC #$01 ; 2
D0 FC BNE -4 ($FCAA) ; 3 (-1)
68 PLA ; 4
E9 01 SBC #$01 ; 2
D0 F6 BNE $FCA9 ; 3 (-1)
60 RTS ; 6
BCA8: sta $C028 ; 4
nop ; 2 -
nop ; 2 -
nop ; 2 -
nop ; 2 -
rts ; 6 -
FCA8: nop ; 2 -
nop ; 2 -
nop ; 2 -