![]() |
Re: EEPROM Code
It risks getting caught in an infinite loop waiting for the queue and breaks the comm sync on the controller?
|
Re: EEPROM Code
Quote:
Code:
// wait, if necessary, for a free slot on the circular queue |
Re: EEPROM Code
Quote:
|
Re: EEPROM Code
Kevin,
I haven't tried this, but from the PIC documentation, it looks like you only have to disable the interrupts during the period that you call "pre-write sequence" and "execute the write" in the EEPROM_Write_Handler routine. You should be able to re-enable the interrupts after these 3 lines (from the 39609b Microchip document, section 7.4) rather than waiting until the 2ms write is complete. This may also eliminate the code error by allowing the high priority interrupts to mostly go on schedule. Mike |
Re: EEPROM Code
Quote:
-Kevin |
Re: EEPROM Code
Quote:
Quote:
-Kevin |
Re: EEPROM Code
On a slightly different topic, does the addressing go from 0 to 1023 or 1 to 1024?
i.e. can I write to 0? |
Re: EEPROM Code
Quote:
-Kevin |
Re: EEPROM Code
Thanks, this makes it perfect for recording tables
If you want (say) a table with the five attributes in each row 0, 5, 10, . . . = attribute a 1, 6, 11, . . . = attribute b 2, 7, 12, . . . = attribute c 3, 8, 13, . . . = attribute d 4, 9, 14, . . . = attribute e Then to find a specific row number, you would take the row number, multiply by 5 and subtract five, and then start reading values? |
Re: EEPROM Code
Quote:
|
Re: EEPROM Code
I have met one or two systems which did not, and not having a controller with me at the moment to test it out, I figured I might as well ask.
|
Re: EEPROM Code
I just wrote and tested some quick-n-dirty trig table code. Grab a copy of the EEPROM code here and add the code below. I only create a table covering zero to ninety degrees because sin(x) in the other three quadrants can be derived using sin(x) data in quadrant one (exercise left to the student). I'll release a more polished version at a later time.
This code creates the table: Code:
Code:
Code:
if(Sine_Table(0) == 1) |
Re: EEPROM Code
Quote:
I've got a question about EEPROM_Write(). Code:
unsigned char EEPROM_Write(unsigned int address, unsigned char data) |
Re: EEPROM Code
Quote:
-Kevin |
Re: EEPROM Code
Quote:
-Kevin |
| All times are GMT -5. The time now is 00:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi