6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 12:47 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Mon Nov 08, 2004 6:25 am 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Okay, this ISN'T an exact match of forum, but it DOES involve the task of interfacing something to a 6502 based system.

Basically, I'm trying to hook a 6551 to my 128's expansion port. Got a little breadboard going, and I have the following results.

With a CMD G65SC51P-1, the address lines behave unreliably. Reading the same location over and over again will pretty much read all the registers at some point, tho RS1 seems flakier than RS0. Both of these chips I have do the same thing.

With the SY6551A I have, the registers work fine, and when I first reset, the status register is 16, mean TX buffer empty. I write something to it, but the TX buffer never clears. I have set a baud rate, and both the control and command registers look good to me. It cannot receive anything, on any loopback mode or otherwise.

I am aware that the 65SC51 is a 1Mhz part, but the C128 PRG says that the S02 line is always clocked at 1Mhz. And anyway, I'm running the machine in 1MHz mode. So, it SHOULD work, no?

Any ideas on how to troubleshoot this? I can get access to an oscilloscope if I know what I'm looking for.

BTW, I'm using a quartz oscillator for clock source, feeding it in to XTALI.

Oh, and one more thing. I tried DESTERM 128 on the SY6551A, and it locks up detecting it untill I plug the wire from I/O1 on the expansion port, then it says it found a serial port at $DE00

Thanx.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 6:46 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
The 6551, like the 6522, requires the address and R/W\ lines to be valid a certain amount of time before phase 2 goes up. For a 1MHz part, it may be as much as 160ns. I don't have C128 info in front of me, but I suspect the C128 is similar to the C64 in that it does not meet this requirement. You can delay the phase-2 signal delivered to the part in a way similar to how I did for a pair of 6522's on a C64 (see
www.6502.org/users/garth/projects.php?p ... hematic=26 ), but it may leave you with little enough phase-2-high time that you'll need a 2MHz part to make it all work.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 7:14 am 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
ARGH!

Okay, the thing about the softie with the soldering iron is all true. Ow. :)

If I understand what you're saying a 1Mhz 6522 (in your example), hooked directly to a 1Mhz 6502 would work fine. But, since the memory of the C64 and C128 is layered and banked, there is a significant delay between the processor setting the address and readwrite and the chip select going low, leaving the 6522 without enough time to interpret the address lines. And if the 64 is too slow, the 128 would be worse, as it has an MMU on TOP of the PLA.

If so, that explains why the 2MHz part works. The 128 is JUST too slow in it's memory decoding for a 1MHz part. Interesting.

It doesn't really explain why the 2MHz part fails, but I can then assume I got a bad chip. :)

And it brings up the question, if the 64 is too slow to use a 1MHz part, why are all the chips rated to 1MHz? Cause you had to design your little delay circuit, does every chip in the machine actually have one?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 6:25 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Ok, now that it's not late at night and I could get into the kids' room, I got the C64 manual back out and looked at the schematic. What I said wasn't quite right. It has been so long since I made that little interface board that I had forgotten why I needed the phase-2 rising-edge delay circuit. The issue was that I used the I/O1\ line for the CS\ for the 6522, and that line is not valid until after phase 2 goes up. Regardless of speed, that's the wrong order for the 6522 and 6551. The solution was to delay the phase-2 rising edge until after the I/O1\ line went down. Otherwise it wouldn't matter how fast your parts were.

Quote:
And it brings up the question, if the 64 is too slow to use a 1MHz part, why are all the chips rated to 1MHz? Cause you had to design your little delay circuit, does every chip in the machine actually have one?

The 6581 and 6526 don't need to have the chip-select signal valid before phase 2 goes up, and apparently the 6567 doesn't either (I can't put my hands on the data sheet right now), so they don't need such a circuit. If they did, I expect they would have designed the address decoding differently.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 6:34 pm 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Yeah, I looked through my PRG more carefully. Seems, and I shouldn't have been surprised, that even when the 128 is in 1MHz mode, it still generates 2MHz timings around the rising and falling S02 clock. Just less frequently.

The address hold time is a max of 40ns on the 128, with the 1MHz part wanting 120ns. The 2 MHz parts are a lot closer. It's still a bit tight, but that side of the chip still seems to work.

I'll take another look on the CS vs. S02 signals and see if I need to fix that up as well.

Thank you for your input!

Now if I can only figure out why the serial port doesn't actually transmit the character in it's output buffer. I suspect either my clock is bad (unlikely as the DC voltage is half the input voltage to the oscillator, but possible), or that I blew out the CTS line in a couple of very impressive displays a few years back. If the CTS line is stuck 'high', the transmitter is disabled, but there is no status bit to check. According to the data sheet, one determines if the CTS line is high by noticing that the transmitter is not working when it should. :P


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 8:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
See my "Tip of the Day" at www.6502.org/forum/viewtopic.php?t=342 , specifically Tips #10-14. If the 6551's 1.8432MHz input clock signal is not clean, the baud rate generator may not work at all. You can see what I had to do on my workbench computer to make the ACIA work at www.6502.org/users/garth/projects.php?p ... chematic=4 .


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 08, 2004 9:00 pm 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Hmmm, okay. I'm using a oscillator rather than just a crystal, so I'd assumed the caps were not needed. However, I'll try that tonight!

Not, of course, that any of this is in the schematics floating around the net for building this. :P No caps or anything. :P


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 09, 2004 5:13 am 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Hmm, I put a 33pf cap on (all I had), and now I can poke ONE byte (dunno if it goes out) before it gives up and stops emptying the transmit buffer.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 09, 2004 5:40 am 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Actually, seems as if i can transmit 1 byte no matter what I do now. :P
Caps or no. :P


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 09, 2004 7:17 am 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
And I slowly learn more and more.
I found the logic probe my dad gave me a couple of years back. Darn thing works, I think.

It shows a square wave being input into XTALI, and something stuck at HIGH on RxC after I store a 0x18 into 0xDE03 (Control Register)

Prior to this, RxC has nothing on it at all.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 10, 2004 5:45 pm 
Offline

Joined: Sat Aug 31, 2002 12:33 pm
Posts: 64
Location: USA
Hi Everyone,

Never underestimate the power of a logic probe......

Cheers,

Paul


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 11, 2004 1:54 pm 
Offline

Joined: Tue Mar 09, 2004 3:43 pm
Posts: 44
Location: Bristol, UK
"Bring out the logic probe!"

Now, can anyone name the film?


Top
 Profile  
Reply with quote  
 Post subject: Easy
PostPosted: Thu Nov 11, 2004 3:29 pm 
Offline

Joined: Wed Sep 04, 2002 4:08 pm
Posts: 57
Location: Iowa
It's TRON.

-Scott


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 11, 2004 5:57 pm 
Offline

Joined: Sat Sep 11, 2004 1:04 am
Posts: 19
Ahh, yes, I forgot about that!

I forgot to look for all the little people running in terror from it.

Tho....I WAS poking it into the I/O Tower! :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: pdragon and 9 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: