6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 5:41 am

All times are UTC




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Wed Mar 20, 2019 11:59 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
FYI, I'm coming in a little late, but I dug up my EEPROM unlock code and mine matches what you were doing.
Code:
 writeByte(0xAA,0x5555);
  writeByte(0x55,0x2AAA);
  writeByte(0x80,0x5555);
  writeByte(0xAA,0x5555);
  writeByte(0x55,0x2AAA);
  writeByte(0x20,0x5555);


One thing though, I recall you saying you were not using A14 and that you had tied it to Vcc. If that is the case, you unlock code was actually writing to 0x6AAA vs. 0x2AAA, and it would have not worked. New EEPROM's typically come unprotected. I had several EEPROMs that were pulled from an old Telephone PBX and those actually had the software protection enabled. I too pulled my hair out over why my writes were not working until I tried the unlock code. Worked fine after that.

I'm glad you have worked out the problem. Good luck with your projects!

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 2:35 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
8BIT wrote:
FYI, I'm coming in a little late, but I dug up my EEPROM unlock code and mine matches what you were doing.
Code:
 writeByte(0xAA,0x5555);
  writeByte(0x55,0x2AAA);
  writeByte(0x80,0x5555);
  writeByte(0xAA,0x5555);
  writeByte(0x55,0x2AAA);
  writeByte(0x20,0x5555);


One thing though, I recall you saying you were not using A14 and that you had tied it to Vcc. If that is the case, you unlock code was actually writing to 0x6AAA vs. 0x2AAA, and it would have not worked. New EEPROM's typically come unprotected. I had several EEPROMs that were pulled from an old Telephone PBX and those actually had the software protection enabled. I too pulled my hair out over why my writes were not working until I tried the unlock code. Worked fine after that.

I'm glad you have worked out the problem. Good luck with your projects!

Daryl


Thanks for confirming this. I actually tied A14 to the next free pin I had just so I could try the unlock sequence, if you look at the defined variables up top, you'll see A13 is pin 35 and then A14 is pin 47.

As it turns out it may have been *because* I was attempting to write this string of values to it as soon as I got the arduino up that caused me this trouble in the first place. I moved it below a bunch of reads and everything started working.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 3:31 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
It would actually seem I'm back to it not writing today, although at this point I'm pretty confident I can get it to write again, I'm just not sure what's causing the inconsistency....

When I figure out why it wrote last night but not today I'll report back here.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 4:07 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
Ok, this chip is definitely gaslighting me. It worked last night, the last thing I did was power cycle the arduino to check and make sure values were presisting, which they were. I then unplugged the arduino and went to bed, got up today, plugged it back in, have power cycled it a bunch of times since then, burned new code, done tons of stuff, but for some reason it refuses to write again.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 4:18 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
And it writes again!

So, I think I might know the issue now, or at least partially know it.

I got it to write again by unplugging the arduino, removing the chip from the breadboard, plugging the arduino back in, letting it do its bootup sequence, then dropping the chip on, calling my new "Read All" command, and then writing (without having to do SDP unlock).

This leads me to believe the arduino bootup sequence is sometimes putting the chip into some invalid state that is messing with the internal timers for writing. Bottom line, I need a ZIF socket and a PCB for this.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 4:22 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
Ok, now I think I've got a NOP generator tied on, it is effectively this:

EEPROM starts at 0xC000 on my machine

Startup vector: 0x00 0xC0

EEPROM addresses (so 0x00 == 0xC000 on my machine)
0x00: 0xEA (NOP)
0x01: 0x4C (JMP #add (absolute))
0x02: 0x00 (low byte of address)
0x03: 0xC0 (high byte of address)

Does this look good? If so, when I get the clock generation chip in today I'm plopping this bad boy on and taking it out for a spin.

EDIT: to clarify, I've written these addresses starting at 0x4000 on the EEPROM, since I'm only using half of it, and that's the upper half (my machine ties A14 high)


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 4:29 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
I can probably get the emulation mode LED to toggle if I put a bunch of NOP then invert the emulation bit, then loop back to the beginning too. This is the fun part I've been waiting for all this time! I should probably hop back on my original thread for talking about programming, or even start a new one though.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 5:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
New thread's a good idea.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 20, 2019 5:14 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
BigEd wrote:
New thread's a good idea.


New thread it is then.

EDIT: new thread is here


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: