Forum Discussion
Altera_Forum
Honored Contributor
8 years agoI haven't looked through the code in detail but it strikes me as a little too simple to do what you're hoping. I suggest you look at writing your code as a 'case' statement - it lends itself to that. If/else statements can be made to work. However, the resulting code is (arguably) less readable.
I can't see anything in the code that's generating the serial access protocol to the memory. I'm not really sure what I'm looking at... I can see 'data_out_reg' being given a value but is then never used. You mention enabling 4-byte addressing. However, I can't see that in your code. Are you issuing a 'write enable' command to your EPCQ? You need to precede any write/erase command with a write enable (command 0x06). Are you simulating this? Some of the coding issues will present themselves in doing so. Cheers, Alex