nkeck72 wrote:
About the NVRAM and FRAM... to protect from malicious users (just to be safe) is there usually a write protect feature?
Edit: being the bonehead I can be sometimes, write protect comes in handy, especially when I mean to program $E000 (I/O) and actually type $F000 (ROM)
With NVRAM you can simply tie the R/W pin to +5V using a 3K3 resistor. Or (if you want to be able to write, but protect the contents against accidental erasure) you could possibly tie the R/W pin to, say, a latch or even a VIA pin (probably best to also have a 10K pull up resistor to deal with tri state before the VIA is programmed).
Something like this:
Attachment:
nvram_write_prot_circuit.png [ 27.87 KiB | Viewed 319 times ]
The only thing I'm not sure of is the need for the pullup resistor on the VIA_PIN line (R1). I've put it in so that you hopefully the NVRAM write pin will never enable writing (logic 0) spuriously (during boot/reset, VIA setup, etc.). As I say, it might not be needed, but its inclusion shouldn't cause any problems and it's best to be safe
. The use of HC or AC logic is recommended for the OR gate IC as you don't want to ahve to wait CPU cycles for the state of the VIA_PIN to affect the WE pin of the NVRAM when you decide to change it. Also, having the OR gate introduces a propogation delay which can possibly affect the maximum speed of your design. Fast=Good.