gnupic: Busy Loop Position & Exposure to 16F877 EEPROM Read Bug
Subject:
Busy Loop Position & Exposure to 16F877 EEPROM Read Bug
From:
"Tom Alldread, VA7TA" ####@####.####
Date:
18 Oct 2002 01:04:25 -0000
Message-Id: <5.1.0.14.2.20021017180022.00a133d0@mail.island.net>
Hi Josef:
Wow! This is a good point to mention - thanks!
I am going to place a busy wait loop into my DataRead subroutine just to
make sure I don't encounter this one. Not having ICE capabilities it would
have been a difficult bug for me to find as it wouldn't show up in the
simulators I have used as they drop the WR bit and then I presume forget
about the 'write' operation after 16 or less instruction cycles. I guess
this consideration provides a good reason for putting the wait loop at the
end of the 'write' subroutine. Alternatively one could always put a busy
wait loop in the 'read' routine which is what I think I will do for my
current project as there is lots of memory available and a few extra uS of
delay in the 'read' routine doesn't matter.
Thanks Again!
Tom
Tom's conclusion is correct, just a side note - if the EEPROM is busy
writing data (WR bit set), you don't have read access neither to the EEPROM
nor the program memory (of course it doesn't affect program execution, only
reading data from program memory). Once I got bitten by this when I stored
some strings in program memory and occasionaly got strange characters on
the display.
Josef
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 02/07/15