Forum Discussion
Altera_Forum
Honored Contributor
16 years agoOkay I understand where you are at now. I have written the controller that you are trying to write.
1 - Basically you need "erase" and "program". You will also need to poll status. You can either do this by reading the status register (recommended) or at minimum you can use the status pin from the flash. At minimum, you need to be able to determine when an erase/program cycle has completed. Beyond that, you may want to read the status register to know if the command succeeded. Are you also going to implement read? 2 - If memory serves, you can use either 0x10 or 0x40. I think either work fine at this point. At some point in history, it seems like you had to use one or the other depending on whether you were in x16 or x8 mode but I don't think that's the case anymore. 3 - The state machine isn't really complicated but there are kind of a lot of states. I don't think I have a copy of the one I wrote anymore because years ago I replaced it with a NIOS. When I get home tonight, I'll see if I can find the one I wrote years ago but I doubt it. You may actually want to consider doing this in a NIOS. It may actually take a comparable amount of logic resources and the code is very simple. I've attached the c code that I currently use to interface to an Intel J3 v. D NOR flash. 4 - As you start writing the machine, you'll notice there is a lot of redundancy in the states So you'll likely want to break the state machine up into two or three layered state machines. Jake