New baud rate via custom clock

620 views
Skip to first unread message

Mild Lee Interested

unread,
Dec 1, 2016, 7:11:07 AM12/1/16
to RC2014-Z80

My understanding of the RC2014 serial IO is that the baud rate is set by the clock speed: the 7.3728 Mhz crystal gives a baud rate for serial communication of 115200bps.
I am interfacing an old "video terminal" with a max baud rate of 19200.  I figure I can achieve this baud rate by "under clocking" the machine to 1/6 speed with a 1.2288 MHz clock (With, of course, the added effect that the whole machine will now run  v   e   r   y     s l o  o  o  o  o  w l y....)
I've got some scattered experience with digital logic but I'm a novice at clock circuits, so I started looking for a 1.2288 MHz crystal and quickly found that such a thing is not exactly common.  Instead, I'm building a divide-by-6 frequency divider with 74HCT74 flip flops.  My design uses 3 flip flops as a Johnson counter to divide by 3 and then one addition flip flop to divide by 2.  The standard RC2014 clock module will provide the input clock signal.
The simulations look fine, but I was wondering if anybody else has implimented something similar and could suggest any pitfalls with this design.
Here is an image of the circuit
My final goal will be to have a "clock modifier" PCB of chained filp-flops where different divisions can be selected by jumper or DIP switch.

Spencer Owen

unread,
Dec 1, 2016, 7:38:24 AM12/1/16
to rc201...@googlegroups.com
Hi Mild Lee,

Yes, you're right that underclocking the RC2014 will give you a lower baud rate.  

I've used a 74HCT393 (dual 4-bit counter) to give a divide by 2, 4, 8, 16 etc - although that doesn't give overly useful baud rates.  But if your terminal can run at 14,400, that's quite a neat easy way to do it.  Of course, the RC2014 will be running even slower... but don't assume it's zippy fast to start with!

The circuit you've got there to divide by 6 looks like it'll work fine.  Give it a go :-)

At some point I'm hoping to develop a variable rate clock module with various 'fast' frequencies, as well as a slow clock, of maybe a few hz so you can 'see' the data and address lines, and even a manual clock too.

Cheers

Spencer



--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/c795636b-0fbc-40bb-a885-e4372e3d98b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Lawrence

unread,
Dec 1, 2016, 9:55:30 AM12/1/16
to rc201...@googlegroups.com
I was looking into this a little while ago;

It was my understanding that the ACIA doesn't need to run from the same clock as the Z80.  I was going to halve the clock for it to get it down to 57,600... but as mentioned earlier, no other halv-ings are useful with respect to standard baud rates.

Or am I misunderstanding the ACIA?

-s


For more options, visit https://groups.google.com/d/optout.



--
Scott Lawrence
yor...@gmail.com

Mild Lee Interested

unread,
Dec 2, 2016, 5:24:02 AM12/2/16
to RC2014-Z80
Hi Scott. As far as I can tell, you are correct.  If I break out pin 4 on the 6850 (Tx clock) and supply this with the output of my frequency divider, that should (?) reduce the transmission baud rate to the correct value.  I'm assuming the MCU won't try to pass new data to the 6850 until it gets an interupt request? 
In any case, the terminal I'm trying to interface must have hardware flow control to receive for anything over 1200 baud, so I am also planning to to break out pin 24 (Clear To Send) and put this through the spare channel on the MAX232 to be driven low by the "Clear To Receive" signal from the terminal.
All this falls in a heap if the MCU just ignores the interupt request and simply puts new data on the data bus at regular intervals, assuming that the transmission is complete.  Can't be that dumb, right? I don't know anything about how the serial communicatin is implimented, so just hoping this aspect works how I think it does...

Regarding Spencers post about a slow clock, I'm with you there!  My planned "under clocking" board will have selectable frequency dividers, but also something for stepping through operations at 1Hz or less. A simple 555 circuit would do the job, I think? 

Mild Lee Interested

unread,
Jan 21, 2017, 11:22:48 AM1/21/17
to RC2014-Z80
Update on this project: RC2014 now talking to an old Cardinal/RCA VP3301 "color graphics terminal" at 19200 baud while still running at the standard 7.3728MHz.  I developed a multi frequency clock module that lets you select CPU clock and ACIA clock seperately using frequency division. The ACIA clock signal is broken out to any of the 4 "spare" rails on the back plane and connected to the Serial IO module clock pin by bending that pin straight and running a jumper wire to it from the selected spare rail. The master clock is Spencers design for the RC2014. 
Available Frequencies and baud rates:

7.3728MHz / 115200 baud

3.6864MHz / 57600 baud

1.2288MHz / 19200 baud

614.4KHz / 9600 baud

307.2KHz / 4800 baud

153.6KHz / 2400 baud

76.8KHz / 1200 baud

There is also a "slow clock" using a simple 555 circuit that gives a clock rate that can be varied between about 4.6kHz and around 1.25Hz (not a typo: Hz - not kHz) and a push button for single stepping.

This is all based on simply changing the clock speed.  I'm absolutely sure that there is a more "correct" way to achieve this, but my RC2014 works absolutely fine using this board at all available frequenies and baud rates. 
There are a couple of errors on the PCB pictured here that are fixed on the new version.  I've also removed the RC2014 lable on the screen print on the new version as per Spencers standing request.

I'm writing up the project now and will add some links when it's complete.

Daniel Quadros

unread,
Jan 21, 2017, 11:44:47 AM1/21/17
to RC2014-Z80
If I read the 68B50 datasheet correctly, it can internally divide the clock by 1, 16 and 64. This is not very useful with the standard clock, as we have to divide by 64 to get 115200bps, but can be used with this other clock values. For example, with 153.6KHz you can change between 2400 and 9600 bps by software.

DQ

Spencer Owen

unread,
Jan 21, 2017, 1:05:27 PM1/21/17
to rc201...@googlegroups.com
That's excellent :)

I'm looking forward to reading a full write up of it.  Will you be making the boards (or full kits) available? I'm sure there are people in the community that would want to get their hands on one.

Cheers

Spencer 

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+unsubscribe@googlegroups.com.
To post to this group, send email to rc201...@googlegroups.com.

Scott Lawrence

unread,
Jan 21, 2017, 1:39:02 PM1/21/17
to rc201...@googlegroups.com
Excellent!   I love how this project starts with an easily expandable/modifiable, totally usable as-is skeleton of a computer, and everyone is getting to do all of the mods they want to it.  Cheers to y'all

now tell me more about that terminal!  It looks awesome!


-s


For more options, visit https://groups.google.com/d/optout.



--
Scott Lawrence
yor...@gmail.com

Mild Lee Interested

unread,
Jan 21, 2017, 8:24:24 PM1/21/17
to RC2014-Z80
Hi Daniel.  I did consider this, but didn't choose this path for a few reasons. 
The first is that I'm just a beginner with the software side and don't know where to start! 
The second is that I wanted to retain the standard RC2014 clock because I admire the efficency of  design. Maybe it's common practice but choosing a master clock speed specifically to provide a standard baud rate without having to include a second clock struck me as pretty clever. 
Third is that I didn't want to be limited to a slow master clock speed.

Mild Lee Interested

unread,
Jan 21, 2017, 8:41:35 PM1/21/17
to RC2014-Z80
Thanks Spencer.  I'll be making the design files and gerber's available on GitHub.  Write up will be on HackdayIO but it will take me some time yet to make it pretty looking enough to post.
Once I've received the corrected version of the PCB and tested it, I'll make it available for order from DirtyPCBs. They are cheap and the quality is good (despide the name) but have a minimum order of 10 boards so that won't suit everybody.
I'll be happy to pass on a few of my 8 surplus boards at cost when they arrive and I'll set something up off this forum to do that.
As for making kits, I'd really like to do that but not sure I have the time to set it up and administer it.  The parts are all cheap and readily available so if there is a demand, I'll probably sell the bare boards only - but packaged with instructions and a parts list.

Mild Lee Interested

unread,
Jan 21, 2017, 9:20:55 PM1/21/17
to RC2014-Z80
Well the backplane model is just made for hacking - how could you not?!

The terminal is 80's vintage and until about 3 years ago it was the main HMI interface on operational production equipment (a coil steel cut-to-length line). I maintained the machine and salvaged the terminal and documentation when the machine was decommissioned.

I bought my RC2014 specifically to get it operational again.


There is almost no information about the VP3301 on line. I have included a crappy .pdf scan of the user manual in my Github repository for this project. I've seen them on ebay now and then at stupid prices.


The terminal features an early membrane keyboard, 8 bit sound and a composite video output in NTSC format. Interfacing is RS232 or 4-20mA.  Maximum baud rate is 19200 and it needs hardware flow control for anything over 1200 baud, so I had to do some additional hacking to the Serial IO board to break out the CTS signal on the ACIA through the MAX232.  This will be included in the write up. 


Unfortunately, its hardwired 7 data bits, not 8. I've got around this by setting the parity bit to space (7S1) which seems to pad it out enough to do the trick for plain text with the RC2014 (8N1) but I suspect will limit or prevent the use of control characters.  I've not tried yet. 

Paul Land

unread,
May 31, 2018, 1:26:22 PM5/31/18
to RC2014-Z80
I have just gotten around to building this board. I am a little confused about the top left corner.near the pot. It is not on the schematic. It does not have the same square silkscreen as the jumper headers. The only thing I see additionally is a mention of a  M-F jumper wire in the BOM. 


Anyone have any ideas or even Mild Lee if you are still about?!

Cheers, Paul
(Picture attached)
20180531_181944.jpg
Message has been deleted

Paul Land

unread,
May 31, 2018, 1:29:45 PM5/31/18
to RC2014-Z80
Picture needs rotating 180 degrees!

Steve Cousins

unread,
May 31, 2018, 1:57:37 PM5/31/18
to RC2014-Z80
Following the tracks on the board as illustrated at DirtyPCBs.com it appears the pair of holes in question are connected to the push button switch.

Best guess is they are there to allow an external push button to be connected in parallel with the on-board push button.

Steve 


On Thursday, 31 May 2018 18:26:22 UTC+1, Paul Land wrote:

Paul Land

unread,
May 31, 2018, 2:19:00 PM5/31/18
to RC2014-Z80
Thanks a lot for your help. I have put a right angled header there in case I wish to use it later :)

Mild Lee Interested

unread,
Jun 3, 2018, 2:55:56 AM6/3/18
to RC2014-Z80
Hi Paul,

Thankyou for trying out my board! Sorry it's taken a while for me to reply.
Steve is correct.  These holes are just a breakout in case you want to put an external pushbutton somewhere - for instance if your RC2014 is in a case.
Please let us know how it goes...

Also, not sure where to put this information but the PCB is available at my store on DirtyPCB.  https://dirtypcbs.com/store/designer/browse/6706. Full disclosure: If you buy from this store, I make 10% on the transaction as in-store credit toward getting my own desings made.

Cheers
Doug

Paul Land

unread,
Jun 3, 2018, 3:29:24 AM6/3/18
to RC2014-Z80
Thanks for the info. I finally got my RC2014 working again after being non working for over a year so I am looking forward to playing with your board :)

Mild Lee Interested

unread,
Jun 3, 2018, 3:42:45 AM6/3/18
to RC2014-Z80
Then I REALLY hope my board doesn't kill it again!
The CLOCK output goes to the clock rail on the backplane, but what might not be clear is that the BAUD output needs to be jumpered onto one of the spare lines on the back plane.  To get the BAUD clock signal to the SerialIO card, you then need to bend the clock pin on that card out 90 degrees and use a M-F dupont type jumper wire to connect it to the spare rail carrying the alternate clock signal. 
You can jumper it direct without using the backplane too, of course.
Does that make sense?
Reply all
Reply to author
Forward
0 new messages