Altera_Forum
Honored Contributor
12 years agoNIOS II memory writes failing - values being input at wrong addresses (I2C opencore)
Hi,
I'm trying to integrate an I2C core from opencores to my Cyclone IV device. Apparently the version I'm using should just drop into the SOPC and work after being wired to some outputs (alterawiki.com/wiki/I2C_(OpenCores)). The core compiles with no errors or warnings. My problem is with my NIOS II code. The I2C docs with the core show 6 relevant registers addressed one after another (PRERlo, PRERhi, CTR, TXR, RXR, CR, SR). However, when I attempt to write to these registers I am unable to write to some of them. The write is put into the wrong address whether from my code or manually in debug memory window. https://www.alteraforum.com/forum/attachment.php?attachmentid=7109 To investigate this I set the registers to initial values in VHDL to see the result in the debug window. This showed that the register addresses for TXR and CR are not what is suggested in the docs. Address 0 1 2 3 09866160 AA 00 00 00 -- PRERlo 09866164 00 00 00 00 -- PRERhi 09866168 BB 00 00 00 -- CTR 0986616C DD 00 00 00 -- RXR 09866170 FA 00 00 00 -- SR 09866174 CC 00 00 00 -- TX 09866174 EE 00 00 00 -- CR This would be fine, however, when I attempt to write to address 09866174 (TXR) the value is inserted at 09866164 (PRERhi). Similarly when I write to 09866178 (CR) the value is inserted into 09866168(CTR). This happens whether the write comes from the code or manually from the debug window. This is particularly confusing as writing to these registers works fine in VHDL. I have attempted to debug this from signal tap also. However, triggers on any of the registers are never implemented. I'd really appreciate if anyone can point me in the right direction here. Thanks!