Dieter Profos
Dieter Profos

Reputation: 57

Might there be a bug at the EEPROM write simulator in ATMEL/Microchip Studio?

I'm currently writing an assembler program for the ATMEGA328P, using Microchip Studio (7.0.2594) and also a test suite in order to verify correct funtioning. While testing this program writing error log records to EEPROM I encountered a strange error. I'm using the standard ATMEL proposal to do so:

EEPROM_write:
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_write
; Set up address (r18:r17) in address register
out EEARH, r18
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

For the first few calls things go smoothly - but in the 9th call strange things happen:

Upvotes: 1

Views: 111

Answers (0)

Related Questions