Page 2 of 2
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 8:41 am
by JenniferDigital
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?
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 10:14 am
by GARTHWILSON
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.
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 12:36 pm
by JenniferDigital
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.
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 3:13 pm
by 8BIT
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
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 3:44 pm
by JenniferDigital
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.
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 7:40 pm
by BigDumbDinosaur
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.
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 10:25 pm
by GARTHWILSON
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.
Re: Meet and Greets, or Hulloo!
Posted: Sun May 31, 2015 11:10 pm
by JenniferDigital
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.