Hours of debugging later...

Building your first 6502-based project? We'll help you get started here.
Post Reply
Risc
Posts: 4
Joined: 28 Jul 2020

Hours of debugging later...

Post by Risc »

Hi! I just wanted to drop in and say hello! I'm Erik, a software guy by trade but with a soft passion for hobby hardware and in particular the 6502!

Also wanted to share a brainfart that caused me hours of debugging with the oscilloscope. I have a small breadboard computer going with a R65C02, ROM, RAM and a R65C51. For starters I figured I would write a very small program to output "Hello world" to the ACIA. First, I managed to transmit one single character. Since I wanted to transmit more, I programmed the command register to fire an interrupt when the transmission was complete. No matter what I tried that interrupt didn't acknowledge. I probed the entire board, checked the schematic, checked the code, checked the datasheets. The IRQ line stayed low.

Well after pulling my beard out, I took a look at the vectors at the top of ROM. Well guess what, I had NMI and IRQ in the wrong order! :oops: :)
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Hours of debugging later...

Post by BigDumbDinosaur »

Risc wrote:
Since I wanted to transmit more, I programmed the command register to fire an interrupt when the transmission was complete. No matter what I tried that interrupt didn't acknowledge. I probed the entire board, checked the schematic, checked the code, checked the datasheets. The IRQ line stayed low.

Well after pulling my beard out, I took a look at the vectors at the top of ROM. Well guess what, I had NMI and IRQ in the wrong order! :oops: :)
Welcome to the club. It's all part of the learning process.

BTW, for future reference, the WDC version of the 65C51 is defective. The transmitter bit is stuck, which means it and the TxD IRQ cannot be used. There are numerous posts around here about it.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8774
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Hours of debugging later...

Post by GARTHWILSON »

Welcome, Risc.
BigDumbDinosaur wrote:
BTW, for future reference, the WDC version of the 65C51 is defective. The transmitter bit is stuck, which means it and the TxD IRQ cannot be used. There are numerous posts around here about it.
I think 6502.org forum member GaBuZoMeu has the best solution yet: Use the 51's pin 5 (if in DIP), the x16 clock, as an output to drive a VIA's PB6 for its T2 to count pulses and generate an interrupt. The T2 latch value does not need to change with Φ2 rate nor with baud rate.
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?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Hours of debugging later...

Post by BigEd »

Welcome Erik! Nice little puzzle to solve.
Post Reply