This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

EMCDynamicCfg0 gets overwritten?

Hallo

Im using the LPC2478 with 8 MB external memory. Im setting up the SDRAM from within the LPC2400.s file.

Everything is OK, until a NORMAL command is issued to the SDRAM (Right after dummy read)

LDR R4, =NORMAL_CMD ; Write NORMAL Command
STR R4, [R0, #EMC_DYN_CTRL_OFS]

The last code line, overwrittes the EMCDynamicCfg0 register with a value resulting in selection of a wrong SDRAM type.
Before the call the EMCDynamicConfig0 is 0x00001280
After the line its 0x07664448 ???

The values in R4, R0 and #EMC_DYN_CTRL_OFS are just fine.

Why does that code write to my EMCDynamicConfig0 register? It schould write to the EMCDynamicControl register instead. But it writes to both with a corrupted value?

/Thomas

Parents
  • Embedded forums everywhere constantly warns about dumb for loops for delay - they regularly hurts.

    You realize that an empty for loop can be totally omitted, so you can't even be sure that it is enough to increase the stop criteria.

    Another thing - why don't you post code as code? It is way easier to read if you do, since all line breaks in the source will survive.

Reply
  • Embedded forums everywhere constantly warns about dumb for loops for delay - they regularly hurts.

    You realize that an empty for loop can be totally omitted, so you can't even be sure that it is enough to increase the stop criteria.

    Another thing - why don't you post code as code? It is way easier to read if you do, since all line breaks in the source will survive.

Children