eeprom_write break my connection...

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Kenglow

eeprom_write break my connection...

Post by Kenglow » Wed Dec 30, 2009 3:31 pm

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 :)

qdot
Posts: 4
Joined: Wed Dec 30, 2009 2:37 am

Re: eeprom_write break my connection...

Post by qdot » Fri Jan 01, 2010 10:36 pm

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.

Alan Chatham
Rank 1
Rank 1
Posts: 28
Joined: Wed Sep 30, 2009 3:36 am
Location: Osaka, Japan
Contact:

Re: eeprom_write break my connection...

Post by Alan Chatham » Wed Jan 06, 2010 8:53 am

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!

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: eeprom_write break my connection...

Post by christian » Thu Jan 07, 2010 12:27 pm

EEPROM writes may take quite a while (milliseconds!). Make sure that you don't wait for the write to complete while interrupts are disabled.

Post Reply