MagIO2
03-18-2012, 08:44 PM
As some might know I like to store PASM drivers in upper part of EEPROM. Now that I have a QS and a Spinneret it is time to store some drivers in their EEPROM as well. But the code I have running since I do this kind of stuff did not work!
In my older setups, a breadboard and a GG board, I used FRAM instead of the EEPROM. It turned out that the FRAMs behave differently.
To read the same location I do the following:
i2c.ReadPage(i2c#BootPin, $a2, $7e00, buf, 512) for the FRAM
i2c.ReadPage(i2c#BootPin, $a0, $fe00, buf, 512) for the EEPROM
I changed my code that's used to handle all the driver stuff. Now it has to be told during initialization which device is attached! But then I need a version of the program per device.
Another possibility would be to loop over all different kind of devices, trying with $a0/$fe00 first and then $a2/$7e00. And here is the question: What can go wrong if I simply try out the devices? What can go wrong then in future with other devices attached? Is there maybe a better way to find out which device is attached?
In my older setups, a breadboard and a GG board, I used FRAM instead of the EEPROM. It turned out that the FRAMs behave differently.
To read the same location I do the following:
i2c.ReadPage(i2c#BootPin, $a2, $7e00, buf, 512) for the FRAM
i2c.ReadPage(i2c#BootPin, $a0, $fe00, buf, 512) for the EEPROM
I changed my code that's used to handle all the driver stuff. Now it has to be told during initialization which device is attached! But then I need a version of the program per device.
Another possibility would be to loop over all different kind of devices, trying with $a0/$fe00 first and then $a2/$7e00. And here is the question: What can go wrong if I simply try out the devices? What can go wrong then in future with other devices attached? Is there maybe a better way to find out which device is attached?