Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

TBLWT - Am I missing something

Status
Not open for further replies.

UTMonkey

Member
Dear All,

I have an array of bytes (defined by DB) which I can TBLRD absolutely fine, why can't I TBLWT back to them? is TBLWT purely an EEPROM tool? what would i use to write bytes to RAM?

Regards

Mark

p.s. sorry for the brief question, I can expand if required.
 
Last edited:
Isn't there a control register bit you need to set to allow table writes? This prevents the controller from accidentally overwriting its code if an electrical glitch sends the Program Counter into the wrong place, like constant data being stored in program space which would be interpreted as random commands such as TBLWT if the PC were to go there.
 
There is a required sequence that has to be followed to for it to be enabled.

It involves writing specific values to the EECON2 register and then setting the WR bit in EECON1 to ensure that program memory writes cannot be accidentally enabled.

The manual for an 18f2525/2620 chip (see section 7.5) explains it all and shows some example asm code.

Going back to you original question about writing to ram then the TBLWRT command is not going to be any use to you as it is only used for writing to EEPROM memory, not ram.
For writing to a block of ram, then you could use the LFSR command with FSR0 pointing to the start of the ram that you want to write to.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top