Skip to content

Instantly share code, notes, and snippets.

@maciek134
Created March 31, 2015 18:56
Show Gist options
  • Save maciek134/ff13cd8adffd3e3c1fce to your computer and use it in GitHub Desktop.
Save maciek134/ff13cd8adffd3e3c1fce to your computer and use it in GitHub Desktop.
test
EEPROM_write:
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_write
; Set Programming mode
ldi r16, (0<<EEPM1)|(0<<EEPM0)
out EECR, r16
; Set up address (r17) in address register
out EEARL, r17
; Write data (r16) to data register
out EEDR,r16
; Write logical one to EEMPE
sbi EECR,EEMPE
; Start eeprom write by setting EEPE
sbi EECR,EEPE
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment