English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Asm / Hardware (http://eab.abime.net/forumdisplay.php?f=112)
-   -   Accessing the Amiga CD32 NVRAM directly (http://eab.abime.net/showthread.php?t=101312)

modrobert 20 September 2021 04:47

Quote:

Originally Posted by saimo (Post 1507536)
For the details, check out the meticulous comments in the code itself.
And, yes, my routines are used exclusively when the OS is off (that's the whole point: I need the routines precisely because the OS is off/trashed) ;)

Yes, I did check your code, looks professional, easy to follow. I have worked with code to access I2C before, both in hardware (VHDL) and software.

My point was more about the reason C= turns off interrupts completely with Disable() before accessing NVRAM, perhaps there is some conflict which is happening when you run with interrupts enabled?

So far these functions I checked in the library call Disable() in the beginning and Enable() towards the end:

GetCopyNV()
StoreNV()
DeleteNV()
GetNVList()

When you use the term "OS off/trashed" I assume you mean Forbid(), which is not the same as turning off all interrupts, it only disables multitasking.

saimo 20 September 2021 14:21

Quote:

Originally Posted by modrobert (Post 1507594)
I have worked with code to access I2C before, both in hardware (VHDL) and software.

That's a great help. This is the first time for me, instead.

Quote:

My point was more about the reason C= turns off interrupts completely with Disable() before accessing NVRAM, perhaps there is some conflict which is happening when you run with interrupts enabled?
The first thing that comes to mind is ensuring that timings don't get disrupted, but in the datasheet there's nothing that suggests that operations should be obligatorily done in a certain amount of time (i.e. stretching the clock isn't an issue, while shortening it is) - so, I'd exclude this.
Maybe it's related to Akiko (seems unlikely to me, though)?
Or it could be just a safety measure to prevent corruption due to misbehaving tasks or even parallel attempts at accessing the NVRAM.

Quote:

When you use the term "OS off/trashed" I assume you mean Forbid(), which is not the same as turning off all interrupts, it only disables multitasking.
Nope, I mean Disable(), no interrupt enabled afterwards and possibly completely trashed OS (due to need of RAM). The only thing my code doesn't do (yet) is executing the routines in supervisor / level 7 interrupts mode to exclude also interference by NMIs potentially generated by add-on hardware.

modrobert 20 September 2021 15:34

Quote:

Originally Posted by saimo (Post 1507641)
Nope, I mean Disable(), no interrupt enabled afterwards and possibly completely trashed OS (due to need of RAM). The only thing my code doesn't do (yet) is executing the routines in supervisor / level 7 interrupts mode to exclude also interference by NMIs potentially generated by add-on hardware.

Aha, OK, my mistake. I thought you used the CIA timer, but noticed now you only read the address to cause a predictable delay.

saimo 20 September 2021 19:54

No problem!

saimo 23 September 2021 18:28

I have updated the test archive: the executable in this one executes the routines in level 7 interrupt mode, so that nothing could ever interfere - but, honestly, I don't think this changes anything...


All times are GMT +2. The time now is 05:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.

Page generated in 0.05351 seconds with 11 queries