- issue a half-dozen clocks
- press and hold the Reset button (which should force low the CPU /RESET on pin 40)
- issue a few more clocks -- at least two
- release the Reset button
- issue two more clocks
- stepping onward, and monitoring the RAM /CS input, you should see a dummy stack access lasting three cycles
- stepping onward, and monitoring the ROM /CS input, you should see the vector fetch lasting two cycles (for the low byte then high byte)
Debugging my first SBC
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Help using cc65
Dr Jefyll wrote:
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Help using cc65
Dr Jefyll wrote:
- release the Reset button
BigDumbDinosaur wrote:
if your 65C02 is a WDC part you can monitor the vector pull output (VPB, pin 1 on the PDIP package or pin 2 on the PLCC44 package) for when the 'C02 fetches the reset vector. VPB will go low when the least significant byte is fetched, which occurs during Ø2 high, return high during Ø2 low and then go low when fetching the most significant byte, again during Ø2 high.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Help using cc65
Dr Jefyll wrote:
BigDumbDinosaur wrote:
if your 65C02 is a WDC part you can monitor the vector pull output...return high during Ø2 low...
As you noted, the very brief change of VPB would be of no consequence for troubleshooting purposes.
Unfortunately, my vision problems occasionally cause me to not notice E&O in my writings. More unfortunately, it's getting worse...
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Help using cc65
BigDumbDinosaur wrote:
That should have said "...briefly return high during Ø2 low..."
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Help using cc65
Ok, so I ran the test you suggested.
When I first did the test, it did not look like I was getting the right data, or even adresses.
Instead of fetching the high and low byte from FFFC and FFFD, the processor was looking at FFFE and FFFF.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
The processor was accesing the right adresses, and I was seeing the correct data on these adresses.
Could this be because my single stepping method is causing trouble for the ACIA ?
Oh, and I'm using a different reset circuit, the one I'm using is found here:
http://www.grappendorf.net/projects/650 ... rcuit.html
PS, I was thinking I should maybe make a new post, because the title does'nt really reflect the contents that well anymore
What do you guys think ?
When I first did the test, it did not look like I was getting the right data, or even adresses.
Instead of fetching the high and low byte from FFFC and FFFD, the processor was looking at FFFE and FFFF.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
The processor was accesing the right adresses, and I was seeing the correct data on these adresses.
Could this be because my single stepping method is causing trouble for the ACIA ?
Oh, and I'm using a different reset circuit, the one I'm using is found here:
http://www.grappendorf.net/projects/650 ... rcuit.html
PS, I was thinking I should maybe make a new post, because the title does'nt really reflect the contents that well anymore
What do you guys think ?
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Help using cc65
sepseel wrote:
Ok, so I ran the test you suggested.
When I first did the test, it did not look like I was getting the right data, or even adresses.
Instead of fetching the high and low byte from FFFC and FFFD, the processor was looking at FFFE and FFFF.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
The processor was accesing the right adresses, and I was seeing the correct data on these adresses.
When I first did the test, it did not look like I was getting the right data, or even adresses.
Instead of fetching the high and low byte from FFFC and FFFD, the processor was looking at FFFE and FFFF.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
The processor was accesing the right adresses, and I was seeing the correct data on these adresses.
Quote:
Could this be because my single stepping method is causing trouble for the ACIA ?
Quote:
Oh, and I'm using a different reset circuit, the one I'm using is found here:
http://www.grappendorf.net/projects/650 ... rcuit.html
http://www.grappendorf.net/projects/650 ... rcuit.html
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Help using cc65
So normally my clock runs at 1 MHz, and I have a 1,8432 MHz crystal for the acia.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
As for the single-stepping method, I just step the clock. Would using RDY be better or easier ?
Haha, that might be easier.. but i had those components lying around, so.. 
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
As for the single-stepping method, I just step the clock. Would using RDY be better or easier ?
Quote:
That's essentially the reset circuit found in the Commodore eight bit computers. It should be okay, although it's using a lot of hardware to do what a Maxim DS1813 does in a TO92 package with no other components. Sometimes going retro can be overdone. 
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Help using cc65
sepseel wrote:
So normally my clock runs at 1 MHz, and I have a 1,8432 MHz crystal for the acia.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Help using cc65
sepseel wrote:
Instead of fetching the high and low byte from FFFC and FFFD, the processor was looking at FFFE and FFFF.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
But then I removed the ACIA (I am using the R6551AP) and everything worked just fine.
As I hope you know, address line A1 is what differentiates FFFC from FFFE --- and FFFD from FFFF. If A1 is stuck high then the CPU is incapable of expressing any addresses where A1 is supposed to be low. There are thousands of such addresses, and FFFC and FFFD are among them.
One thing you could try is reinstalling the ACIA then rebooting, halting during the vector fetch. Then verify the voltage on the CPU's A1 pin. Also see if there's a change on that pin if you connect and disconnect the wire that brings A1 to the ACIA. (There shouldn't be, but... )
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Help using cc65
sepseel wrote:
So normally my clock runs at 1 MHz, and I have a 1,8432 MHz crystal for the acia.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
Quote:
As for the single-stepping method, I just step the clock. Would using RDY be better or easier ?
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Help using cc65
sepseel wrote:
PS, I was thinking I should maybe make a new post, because the title does'nt really reflect the contents that well anymore :D
What do you guys think ?
What do you guys think ?
Re: Help using cc65
sepseel wrote:
So normally my clock runs at 1 MHz, and I have a 1,8432 MHz crystal for the acia.
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
As for the single-stepping method, I just step the clock. Would using RDY be better or easier ?
I suspect however that the acia crystal is not operating as it should, this may also be the cause for my problems I think.
As for the single-stepping method, I just step the clock. Would using RDY be better or easier ?
I hope you won't mind if I remind you your first goal should be ensuring the Reset vector gets fetched properly. Problems, if any, with the ACIA's 1,8432 MHz crystal won't affect vector fetching, so the crystal isn't something you should allow to distract you. Better to look into what the A1 signal is doing, as explained in my last post.
After the vector is getting fetched properly then you'll be able single-step (or go full speed!) into the actual program. But right now the race is stalled at the starting line.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Debugging my first SBC
Update:
I have replaced the 1,8432 crystal with an oscillator module, so that works now...
I also managed to find an error in the adress decoding logic going to the 6551, which I have now fixed, so it is'nt being accesed at the same time as the rom anymore.
Fixing this mistake made it so now every time after a reset the vector is getting fetched correctly, and as far as I can tell, the code executes as expected.
However, when I run the clock att full speed I would expect to get some kind of output out of the serial port right ?
well I dont get any..
I have an adafruit FTDI friend to communicate with my computer, this has lights connected to tx and rx, but these dont light up when connected to the 6551.
Also for a serial monitor I use the one included with the arduino IDE, this should work, right ?
Is it possible I broke my 6551 ?
what tests can I do to debug this issue ?
I have replaced the 1,8432 crystal with an oscillator module, so that works now...
I also managed to find an error in the adress decoding logic going to the 6551, which I have now fixed, so it is'nt being accesed at the same time as the rom anymore.
Fixing this mistake made it so now every time after a reset the vector is getting fetched correctly, and as far as I can tell, the code executes as expected.
However, when I run the clock att full speed I would expect to get some kind of output out of the serial port right ?
well I dont get any..
I have an adafruit FTDI friend to communicate with my computer, this has lights connected to tx and rx, but these dont light up when connected to the 6551.
Also for a serial monitor I use the one included with the arduino IDE, this should work, right ?
Is it possible I broke my 6551 ?
what tests can I do to debug this issue ?
Re: Debugging my first SBC
Dr Jefyll wrote:
Restart the 6502 and quickly step through until the UART chip-select goes active (which, depending on the software, will probably take a few dozen cycles). Now, with the 6502 still paused, you can verify that the address and data buses contain the expected data. I haven't looked at the program you're using, but I assume the first access to the UART will be a write cycle.
Even this simple first test reveals a lot! And it'll suggest what direction further tests should take.
Even this simple first test reveals a lot! And it'll suggest what direction further tests should take.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Debugging my first SBC
Oops, sorry for missing that.
So the first time the acia is selected, is on adress $8801, the data lines then read: $00
A couple cycles later it is accesed again, this time on $8802, and on the data lines: $0B
Then a few cycles later it is accesed again, this time on $8803, giving me $1E on the data lines.
According to my memory map the starting adress of the acia is $8800
So the first time the acia is selected, is on adress $8801, the data lines then read: $00
A couple cycles later it is accesed again, this time on $8802, and on the data lines: $0B
Then a few cycles later it is accesed again, this time on $8803, giving me $1E on the data lines.
According to my memory map the starting adress of the acia is $8800