6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 8:52 pm

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun May 31, 2015 8:41 am 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
Well, My hardware works but I used the W65C51 and wish I'd used something else. The damn things as buggy as a jungle. Any suggestions?


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 10:14 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Transmit register empty bit stuck, eh? (I think that's the only bug in WDC's '51.) You just have to give it enough time to make sure the byte is out before giving it the next. Unfortunately that's one that WDC introduced! It did not exist before. AFAIK, there are no bugs in any other brand of 65c51, and I have not had any trouble with them, although I do wish they had separated out the controls for a couple of things rather than merging them.

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 12:36 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
That's the one that bit me. I believe there's something else going on too but I can't remember what. I did a little code just to try my hardware and it didn't work until I twigged. I ended up going through every part of my serial card twice before I noticed a few lines of text in the datasheet admitting to the bug.

Next job is to get putc and getc working with it in cc65 though I've little idea yet as to how I get cc65 using my little assembly code routines for those.

Are there any guides? A little research is required methinks.

Anyway, I've ordered some rockwell ones off fleaBay.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 3:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I wrote a CC65 target for the Kowalski Simulator. You could use that as a starting point. CC65 is not easy to get configured, but it can be done.

Check out this thread - viewtopic.php?f=2&t=2196

4 posts down on the second page is a link to the source files I created. Also, read the entire thread if you can - there's a lot of helpful information.

Daryl

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


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 3:44 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
Thankyou. I'll go look at the code and there should be a bunch of clues there. I think what's making it difficult is the lack of a standard template for re-targeting putc and getc. It was simple and easy for the STM32 with Crossworks but that's another story.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 7:40 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
DigitalDunc wrote:
Well, My hardware works but I used the W65C51 and wish I'd used something else. The damn things as buggy as a jungle. Any suggestions?

As Garth noted, the TxD status bit is stuck, which means interrupt-driven transmission is going to be a problem. There is discussion around here on workarounds involving delay loops in the transmit code. As far as is known, the stuck TxD status bit errata is unique to the WDC version of the 65C51. The older Rockwell 65C51, which can be gotten through eBay and other sources, works as advertised but is constrained to a relatively low Ø2 clock rate. That, of course, shouldn't be an issue for you at this stage of your project.

Something for future thought is that there is a wide variety of UARTs that can be interfaced to the 65xx bus. I and several others have used the NXP UARTs, such as the 26C92 and 28L92, both dual channel units. Another member, André Fachat, has used the 16C550, which is the UART often found in PC hardware. Maxim makes a number of UARTs as well. So your options are not limited by any means, and these non-65xx UARTs are known to be bug-free and generally perform better than the 65C51.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 10:25 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
If you have enough VIAs, you could use a timer on one as the interrupt telling when the W65c61's transmit register is empty. The software overhead would be minimal compared to using a delay loop to make the processor twiddle its thumbs while waiting, unable to do anything at all during that time. There's usually more than one way to skin a cat.

For a different type of UART (as BDD mentioned), a Maxim part I've exercised is the 14-pin SPI-interfaced MAX3100 which is also IrDA-ready. It does not have DSR, DTR, DCD, or RI, but in most ways it's better than the '51. (It does have CTS and RTS. If you absolutely had to have the other bits, you could implement them in the VIA.) I say "I've exercised it" because although I've made it work just to experiment, I have not actually put it into service.

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Sun May 31, 2015 11:10 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
I was shooting for RTS/CTS handshaking. My goal was simple. Make a serial port I could plug into my PC, BBCs, and assorted other bits and pieces. No modems. I have the option to add more VIAS and I considered a PIC with PSP too (Smaller IO footprint). I liked the simplicity of the 6551 but of course the 16550 I have would perform better. These are all interesting ideas. I don't yet have I2C or SPI implemented yet but that will come somewhere down the line.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 78 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: