• AVR Freaks

Where to report bugs of Microchip AppNotes?

Author
Chris@IBS
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2009/05/28 01:55:34
  • Location: 0
  • Status: offline
2009/05/28 02:27:45 (permalink)
0

Where to report bugs of Microchip AppNotes?

Hi all!

I'm new in this Forum here, but I thougt, it would be important to report a bug, I found in DEE Emulation 16-bit.c of the Appnote AN1095.

Version and Coder found in the comments of the source File DEE Emulation 16-bit.c

* D. Otten 2007/05/01 Version 1.0.0 - Initial Release
* D. Otten 2007/05/15 Version 1.0.1 - First publication release
* Pradeep Budagutta 2008/04/02 Version 1.1.0 - Multi EEPROM banks included
* Pradeep Budagutta 2008/05/05 Version 1.1.1 - TBLPAG page boundary problem solved

As far as I could trace down the bug, the problem is as follows:

DataEEInit and everything done properly.

First attempt to write Adress1 with the value 0xFFFF
DataEEWrite(0xFFFF,Address1)


then later read Adress1 with
DataEERead(Address1)
and then the error GetaddrNotFound() appears.

What happend?

DataEEWrite() has the optimization to first test with a call of DataEERead(), if there was already a Value in Address1.
Then, if the Value in Address1 is the same as the Value that should be written, nothing is done.
If DataEERead() doesn't find the Value because Address1 was never written before, it returns 0xFFFF and dataEEFlags.addrNotFound is set.
herein lies the problem

codesegment of DataEEWrite():
    //Do not write data if it did not change
if(DataEERead(addr) == data)
{
TBLPAG = savedTBLPAG;
dataEEFlags.val = dataEEFlags_sh;
return(0);
}

This is faulty because no test of error dataEEFlags.addrNotFound with GetaddrNotFound(). If DataEEWrite() tries to test with 0xFFFF it is the same as the error return value of DataEERead, and so DataEEWrite returns with success, but no real write has taken place.

My solution to this:
    //Do not write data if it did not change
if(DataEERead(addr) == data)
{
if (!GetaddrNotFound()) //Now testing if the read was successful
{
TBLPAG = savedTBLPAG;
dataEEFlags.val = dataEEFlags_sh;
return(0);
}
}


If someone could move this to the right subforum if I'm wrong, or tell me how to inform the coder at Microchip for an update?
Thanks!
#1

1 Reply Related Threads

    atferrari
    Super Member
    • Total Posts : 1380
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    RE: Where to report bugs of Microchip AppNotes? 2009/05/28 02:49:44 (permalink)

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5