Page 1 of 1

Hours of debugging later...

Posted: Mon Aug 03, 2020 9:29 pm
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: :)

Re: Hours of debugging later...

Posted: Mon Aug 03, 2020 9:44 pm
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.

Re: Hours of debugging later...

Posted: Mon Aug 03, 2020 9:59 pm
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.

Re: Hours of debugging later...

Posted: Tue Aug 04, 2020 7:00 am
by BigEd
Welcome Erik! Nice little puzzle to solve.