Hello,
i use tiny85 and 12Mhz crystal... i need to read and write internal eeprom via usb... read is OK... but then i start to write ... it break my connection... i can write about 1-5 byte's before device disconnected... i try to write only one byte.... then wait about 1 sec before next write... but it is not make success... i think eeprom_write is take much time... hm... very strange... maybe anyone already solve this problem ?
p.s: sorry for bad english
eeprom_write break my connection...
Re: eeprom_write break my connection...
I'm using attiny84, PCINT for interrupt handling, and a 16MHz crystal (while powered off 3.3V bus, I know, out of spec ), but I have no problem reading and writing the eeprom.
Try modifying and building a hid-data example code, it does reads and writes off the eeprom.
Try modifying and building a hid-data example code, it does reads and writes off the eeprom.
-
- Rank 1
- Posts: 28
- Joined: Wed Sep 30, 2009 3:36 am
- Location: Osaka, Japan
- Contact:
Re: eeprom_write break my connection...
Hello there,
I wound up having a similar issue. In my case, I was doing an EEPROM read before USB even started up, and it was causing super-big connection issues. The strange part was that it all took place before (well, before in the code) the USB communication started...
In my case, I wound up just removing that EEPROM call (not very useful advice, probably...). Still, one thing I noticed was that the AVR was actually doing a semi-reset, and that was messing things up. This condition is mostly resultant from EMI, or at least, was the case in my circuit. So you might want to add in a few more decoupling capacitors here and there, and whatever other EMI-reduction methods you can. I guess it depends if you're working on a proto board, since there's not a huge amount of things you can do to cut EMI in that environment...
Hope it helps!
I wound up having a similar issue. In my case, I was doing an EEPROM read before USB even started up, and it was causing super-big connection issues. The strange part was that it all took place before (well, before in the code) the USB communication started...
In my case, I wound up just removing that EEPROM call (not very useful advice, probably...). Still, one thing I noticed was that the AVR was actually doing a semi-reset, and that was messing things up. This condition is mostly resultant from EMI, or at least, was the case in my circuit. So you might want to add in a few more decoupling capacitors here and there, and whatever other EMI-reduction methods you can. I guess it depends if you're working on a proto board, since there's not a huge amount of things you can do to cut EMI in that environment...
Hope it helps!
Re: eeprom_write break my connection...
EEPROM writes may take quite a while (milliseconds!). Make sure that you don't wait for the write to complete while interrupts are disabled.