Chris Eddy wrote:
{Quote hidden}>
> Fellow Picsters;
> I have two learning experiences that I want to share, in the hope that you
> won't learn my hard lesson.
>
> The first lesson relates to the 93LC46 SPI bus EEPROM. I had used the chip
> without incident two times, and implemented it in a third PIC project. In
> all three projects, I rolled my own SPI bus, and was using some pieces of
> code over. I got the darned thing up and running, and the EEPROM absolutely
> refused to work! I extended the serial train to get that status indication
> that indicates when the write begins and ends, and lo and behold it never
> wrote. To skip the saga of the long hours invested late at night, I found
> that at a clock rate of 200Hz, the chip fails to function. If you peruse the
> databook, it indicates only a max limit at 2MHz. It says nothing about a
> minimum. Sure enough, my other two projects were running faster, and an
> interrupt routine shuffle on the third project solved the problem. The moral
> of the story is do not run EEPROMS too slow.
>
> The second lesson relates to the analog input on the '73. I have a nice big
> piece of code that reads analogs, then can run one of two pieces of code,
> based on a button press. The first is a run time value display routine and
> the second is a config menu. I found that when I pressed the button and ran
> the second protion of code, my analog input value for channel two fell to
> zero. I anguished for days, and finally found that the second piece of code,
> upon entering, disables interrupts briefly. This disable occured in the
> timeline precisely where the interrupt for the analog result would arrive.
> The chip would presumably just hold the value and interrupt when GIE is set
> again, but I observed that it corrupted the analog input value. My solution
> was to put a simple looping delay to kill time just after setting the analog
> convert bit. The interrupt occured during this fudge time. Works fine!
Thanks! I'm saving it.
--
Friendly Regards
Tjaart van der Walt
______________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|WASP International GSM vehicle tracking and datacomm solutions|
| +27-(0)11-622-8686 | http://wasp.co.za |
|______________________________________________________________|