UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 19th Nov 2021, 10:33 pm   #21
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,471
Default Re: MK14 examples sources

Loosely on topic, does anyone have a nice formula for the calculation of the values xx and yy for these two instructions in sequence when the clock frequency (f) is known and the desired time delay (t) is known?

LDI xx
DLY yy

(The exact delay is the result of the combination of the value in A when the DLY instruction is executed, and the value of the operand in the second byte of the DLY instruction).

The background to this is that I am trying to see if it is possible to run the SERIAL OUT code from the manual at a nonstandard baud rate (31250). With the SC/MP running at 4.00MHz or 4.43MHz. I'm not sure if it will be possible to adjust the timing values in fine enough steps to get near such a relatively high baud rate. Microprocessors with onboard UARTs often use a 12MHz clock which makes it easier to land on 31250.
SiriusHardware is online now  
Old 19th Nov 2021, 11:29 pm   #22
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,257
Default Re: MK14 examples sources

The formula for the number of microcycles is shown in the INS8060 data sheet, bottom right of page 10 and top left of page 11.

Don’t forget to divide clock frequency by 4 to get microcycle frequency.
Mark1960 is offline  
Old 19th Nov 2021, 11:30 pm   #23
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,063
Default Re: MK14 examples sources

Hi Sirius
This is from the Applications Manual, but at 32uS you're going to have to cycle-count every loop, probably using nops instead of DLY - will you be using SIO or a flag?
Attached Files
File Type: pdf scmp_delays.pdf (2.48 MB, 44 views)
Phil__G is online now  
Old 20th Nov 2021, 12:10 am   #24
Buzby123
Heptode
 
Buzby123's Avatar
 
Join Date: Oct 2011
Location: Culcheth, Cheshire, UK.
Posts: 637
Default Re: MK14 examples sources

What's cooking ?. A MIDI-enabled MK14 ?
Buzby123 is offline  
Old 20th Nov 2021, 12:26 am   #25
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,287
Default Re: MK14 examples sources

The data sheet specifies dly = 13 + 2*Acc + 514*disp microcycles, so if you want x microcycles then

disp=int((x-13)/514)
acc=int(((x-13)-disp*514)/2)
Slothie is offline  
Old 20th Nov 2021, 10:09 am   #26
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,471
Default Re: MK14 examples sources

Thanks for the flurry of useful replies.

Yes Buzby, I don't really have time to do any major projects at the moment - wish I could be as prolific as Phil - but - I thought I would have a go to convert 'Music Box' to output via MIDI since I have a few MIDI instruments lying around and the hardware interface (for output only) would be little more than a transistor and three or four resistors.

The plan is to use the bones of 'Music Box' and the 'Serial Out' subroutine from the manual as the basis - essentially to strip out the timed tone generation parts and replace them with Midi Note On / Note Off transmissions padded with appropriate delays to keep the relative note lengths / spacing correct.

Phil, since the 'Serial Out' routine is the basis for MIDI tx, it will use SIO for output. If the relatively low CPU clock speed makes it impossible to hit the correct baud rate I may instead use a 'simple' 6402 UART as the basis for a hardware MIDI interface - they can do 31250 from a 500KHz clock. If the host MK14 has a 4.00MHz clock that can be obtained by divide-by-four.

Last edited by SiriusHardware; 20th Nov 2021 at 10:21 am.
SiriusHardware is online now  
Old 20th Nov 2021, 4:31 pm   #27
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,063
Default Re: MK14 examples sources

Just my own thoughts, with a bit time of only 32uS theres no time for even a very tightly coded loop, the decrement-&-load of the bitcount alone is 22 cycles, followed by an 11 cycle jump back to the loop. And thats done after every bit. Forget 'DLY'
For speed, I'd do it inline, ie with the SIO code repeated 9 times inline, each padded to 32uS. Tricks will help: the SoC code that sets the stop bit is 23 cycles alone: LDE is 6, ORI is 10, & XAE is 7. So instead, hardwire a pull-up on SIN - this gives the same effect in zero cycles. SIO is 5 cycles so 8 databits in 32uS is feasible, the challenge is with timing the start bit. Unless you can manage with just midi data (7 bits), no commands? (8 data bits)
Cheers
Phil

Last edited by Phil__G; 20th Nov 2021 at 4:38 pm.
Phil__G is online now  
Old 20th Nov 2021, 5:54 pm   #28
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,471
Default Re: MK14 examples sources

Phil, thanks for the insight but I think you have just managed to convince me to use a hardware UART, as using code inline like that (to avoid the time overhead of a loop downcounter) will burn up an awful lot of memory - remember this is a standard MK14 I'm meaning to run this on, not one of your well appointed NIBL machines with a sensible amount of memory.

I had more or less resigned myself to this possibility so I have ordered a 6402 UART. What's good about that particular UART is that all the serial parameters (Number of bits, number of stop bits etc) can be hard programmed by tying the relevant control pins high or low so it isn't necessary for the MK14 to run one-off memory wasting code to set up those parameters in the control register, etc.

Having said that, if I have to take the hardware approach then I could also consider connecting a parallel D/A converter instead, as my oldest synth has a 'CV/Gate' interface rather than a MIDI interface.

It would also be a more appropriate synth to use as it is not far off the age of the MK14 - from 1982 or thereabouts, I think.
SiriusHardware is online now  
Old 20th Nov 2021, 8:46 pm   #29
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,063
Default Re: MK14 examples sources

Agree, hardware is probably the way to go, I remember the 6402 from the Nascom days It was also Babanis choice in the Midi Projects book:
https://archive.org/details/midi-pro...p?view=theater
This will be a fun project, you'll need to post a video of the results
Cheers
Phil
Phil__G is online now  
Old 20th Nov 2021, 9:21 pm   #30
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,471
Default Re: MK14 examples sources

I have that very book here - R.A. Penfold of course - also the follow-up volume. As you say, the 6402 features quite heavily.

As far as videos go, I'm not too sure about that as I only posted the last one about two years ago. (One every seven years is my average).
SiriusHardware is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 11:36 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.