home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
PROGRAMS
/
CLOCKK
/
MDCLCK13.LBR
/
MDCLOCK.WZ
/
MDCLOCK.WS
Wrap
Text File
|
2000-06-30
|
11KB
|
237 lines
M─-CLOCK
or
┴ chea≡ clocδ fo≥ thσ rev« ▓ MDs
by
Mikσ Allen
400╩ Summe≥ WinΣ Way
Gleε Burnie¼ M─ 21061
(301⌐ 76╕-1721
Fo≥ ß lonτ timσ ╔ haΣ beeε wonderinτ t∩ wha⌠ gooΣ ì
usσ ╔ coulΣ pu⌠ thσ I/╧ expansioε heade≥ (tha⌠ strangσ ì
lookinτ ▓ row≤ oµ 2░ pin≤ each⌐ iε m∙ rev« ▓ MD3« Theε ì
iε thσ MarcΦ 198╢ issuσ oµ BYTE¼ Ciarcia'≤ Circui⌠ ì
Cellarô tooδ ß looδ a⌠ rea∞-timσ clocks.
"Aha,ó se· I¼ "jus⌠ wha⌠ ╔ need.ó S∩ ╔ tooδ ß ì
looδ a⌠ thσ schematiπ fo≥ thσ clocδ tha⌠ useΣ ß 825╡ ì
Programmablσ Periphera∞ Interfacσ anΣ thσ MSM583▓ ì
clock« I⌠ lookeΣ t∩ mσ tha⌠ al∞ ╔ haΣ t∩ d∩ t∩ makσ i⌠ ì
worδ witΦ thσ I/╧ expansioε connecto≥ wa≤ t∩ inver⌠ thσ ì
RESE╘¡ (rese⌠ not⌐ signal.
S∩ ofµ ╔ raε t∩ m∙ junquσ bo° (╔ havσ higΦ clas≤ ì
junk!⌐ anΣ m∙ catalog≤ t∩ seσ wherσ ╔ coulΣ ge⌠ wha⌠ ì
thσ cheapest« I⌠ seemeΣ tha⌠ JD╥ Microdevice≤ (122┤ S« ì
Bascoφ Ave.¼ Saε Jose¼ C┴ 95128⌐ haΣ thσ bes⌠ price≤ oε ì
al∞ thσ critica∞ parts« Ofµ wen⌠ aε orde≥ t∩ them« ì
HaΣ ╔ purchaseΣ thσ part≤ tha⌠ ╔ duτ ou⌠ oµ m∙ junδ bo° ì
froφ loca∞ source≤ ╔ woulΣ havσ spen⌠ ß tota∞ oµ ì
$18.69« ╔ spen⌠ ß littlσ less.
Thσ circui⌠ i≤ baseΣ oε thσ MSM583▓ clocδ chi≡ ì
froφ OKI« Thσ thinτ i≤ ß ver∙ olΣ chi≡ anΣ i≤ ver∙ ì
slo≈ bu⌠ ha≤ thσ advantagσ oµ beinτ cheap« I⌠ wil∞ ruε ì
oε a≤ littlσ a≤ 2.▓ volt≤ anΣ draw≤ ver∙ littlσ powe≥ ì
iε thσ standb∙ mode« Idea∞ fo≥ batter∙ bacδ-up.
Thσ MSM583▓ i≤ organizeΣ abou⌠ ß ┤ bi⌠ bu≤ ì
structure« (Remembe≥ thσ 4004?⌐ I⌠ ha≤ ┤ addres≤ anΣ ì
┤ datß lines« Therσ arσ als∩ READ¼ WRITE¼ HOL─ anΣ ì
Chi≡ Selec⌠ lines« Thσ function≤ oµ READ¼ WRIT┼ anΣ ì
Chi≡ Selec⌠ arσ obvious« Thσ HOL─ linσ i≤ ß littlσ ì
strange« I⌠ stop≤ thσ clockí ╔ supposσ therσ arσ use≤ ì
fo≥ i⌠ wheε reading¼ bu⌠ ╔ couldn'⌠ finΣ any« Whilσ ì
settinτ thσ clock¼ i⌠ i≤ useΣ t∩ sto≡ thσ clocδ unti∞ ì
yo⌡ wan⌠ i⌠ t∩ start« That'≤ useful.
Thσ addresse≤ t∩ thσ MSM583▓ froφ 00╚ througΦ 0C╚ ì
arσ useΣ t∩ addres≤ 1│ fou≥ bi⌠ register≤ withiε thσ ì
MSM5832« Thesσ register≤ havσ ┤ bi⌠ value≤ a≤ follows:
(NOTE║ Thesσ diffe≥ froφ thσ tablσ iε Ciarcia'≤ ì
article« ThrougΦ harΣ experiencσ ╔ havσ founΣ tha⌠ hσ ì
i≤ wronτ anΣ thesσ arσ correct.)
èADDRESSô FUNCTIONô RANGE
0░ 1≤ oµ second≤ ░->9
0▒ 10≤ oµ second≤ ░->5
0▓ 1≤ oµ minute≤ ░->9
0│ 10≤ oµ minute≤ ░->5
0┤ 1≤ oµ hour≤ ░->9
05
bit≤ 0,▒ 10≤ oµ hour≤ ░->2
bi⌠ ▓ AM(0)/PM(1⌐ ░->1
bi⌠ │ 12(0)/024(1⌐ h≥ forma⌠ ░->1
0╢ Da∙ oµ thσ weeδ ░->6
0╖ 1≤ oµ da∙ oµ montΦ ░->9
08
bit≤ 0,▒ 10≤ oµ da∙ oµ montΦ ░->3
bi⌠ ▓ regular(0)/leap(1⌐ yea≥ ░->1
0╣ 1≤ oµ month≤ ░->9
0┴ 10≤ oµ month≤ ░->1
0┬ 1≤ oµ year≤ ░->9
0├ 10≤ oµ year≤ ░->9
T∩ reaΣ thσ MSM583▓ yo⌡ se⌠ thσ REA─ linσ higΦ anΣ ì
senΣ ou⌠ aε address« Theε yo⌡ wai⌠ ╢ useπ anΣ reaΣ thσ ì
data« Writinτ i≤ ß littlσ morσ difficult« Yo⌡ senΣ ì
ou⌠ thσ HOL─ line¼ wai⌠ 15░ useπ theε senΣ ou⌠ thσ ì
address« Wai⌠ ╢ useπ anΣ theε senΣ ou⌠ thσ data« Se⌠ ì
thσ writσ linσ higΦ fo≥ ▒ useπ anΣ theε bacδ low« Dro≡ ì
thσ holΣ linσ wheε yo⌡ wan⌠ thσ clocδ t∩ start.
Sincσ i⌠ i≤ s∩ slow¼ i⌠ canno⌠ interfacσ directl∙ ì
witΦ thσ Z8░ bus« T∩ givσ yo⌡ aε example¼ i⌠ take≤ ╢ ì
usec« fo≥ thσ datß t∩ bσ read∙ afte≥ thσ addres≤ i≤ ì
sent« Thi≤ i≤ mucΦ to∩ slo≈ fo≥ thσ bu≤ tha⌠ i≤ ì
availablσ iε thσ MD« Thσ workarounΣ i≤ t∩ usσ ß 825╡ ì
t∩ buffe≥ thσ address¼ datß anΣ contro∞ lines« ╔ stolσ ì
thσ circui⌠ directl∙ froφ thσ Ciarciß article¼ usinτ ì
thσ bottoφ ┤ line≤ oµ thσ 825╡ ┴ por⌠ a≤ bΘ-directiona∞ ì
datß line≤ t∩ thσ MSM5832¼ thσ bottoφ ┤ line≤ oµ thσ ┬ ì
por⌠ a≤ thσ addres≤ line≤ t∩ thσ MSM583▓ anΣ thσ to≡ ┤ ì
line≤ oµ thσ ├ por⌠ a≤ thσ contro∞ line≤ t∩ thσ ì
MSM5832« Thi≤ wa∙ al∞ thσ timinτ caε bσ establisheΣ iε ì
software« Fo≥ instance¼ ╔ caε senΣ ou⌠ thσ addres≤ oε ì
thσ ┬ port¼ wastσ ß littlσ timσ anΣ theε reaΣ thσ ì
resul⌠ oε thσ ┴ port« Inefficien⌠ usσ oµ thσ 8255¼ bu⌠ ì
wh∩ cares« ╔ decideΣ t∩ usσ thσ IO3░¡ signa∞ fo≥ thσ ì
825╡ chi≡ select« Thi≤ mean≤ tha⌠ por⌠ ┴ i≤ a⌠ I/╧ ì
locatioε 30H¼ por⌠ ┬ a⌠ 31H¼ por⌠ ├ a⌠ 32╚ anΣ thσ ì
contro∞ fo≥ thσ 825╡ a⌠ 33H.
Thσ onl∙ critica∞ par⌠ iε thσ circui⌠ i≤ thσ 1N34┴ ì
diode« Iµ yo⌡ mus⌠ substitute¼ makσ surσ yo⌡ usσ ß ì
germaniuφ diodσ witΦ ß forwarΣ voltagσ dro≡ oµ 0.╡ ì
volt≤ o≥ less« ╔ useΣ ß piecσ oµ perµ boarΣ tha⌠ ╔ haΣ ì
lyinτ arounΣ t∩ builΣ thσ clock« Thσ 3x╡ perµ boarΣ ì
tha⌠ ╔ cal∞ ou⌠ iε thσ part≤ lis⌠ i≤ ß littlσ large¼ ìèbu⌠ i⌠ caε bσ cu⌠ down« ╔ useΣ ß littlσ ╡ minutσ epox∙ ì
t∩ gluσ dowε thσ socket≤ anΣ thσ batter∙ holder« ╔ ì
stuffeΣ thσ variou≤ component≤ wherσ i⌠ lookeΣ likσ ì
the∙ fi⌠ thσ bes⌠ anΣ theε poin⌠-t∩-poin⌠ wireΣ ì
everythinτ usinτ #2╢ soliΣ wire« I⌠ go⌠ ß littlσ ì
tedious¼ especiall∙ solderinτ thσ 4░ conducto≥ ribboε ì
cablσ t∩ thσ board« Theε ╔ installeΣ thσ 4░ piε ì
connecto≥ oε thσ enΣ oµ thσ ribboε cable« ╔ founΣ thσ ì
bes⌠ wa∙ t∩ d∩ thi≤ wa≤ t∩ pu⌠ ß couplσ block≤ oµ wooΣ ì
iε ß visσ anΣ theε squeezσ thσ connecto≥ ont∩ thσ cablσ ì
usinτ thσ vise« Thσ wooΣ help≤ t∩ distributσ thσ forcσ ì
evenl∙ acros≤ thσ connecto≥ anΣ als∩ protect≤ thσ ì
connecto≥ itself« Probabl∙ thσ easies⌠ wa∙ t∩ moun⌠ ì
thσ boarΣ i≤ witΦ somσ foaφ tapσ tha⌠ i≤ sticδ oε botΦ ì
sides« Radi∩ Contro∞ modeler≤ usσ i⌠ alot« It'≤ ì
calleΣ 'serv∩ tapeº anΣ caε bσ founΣ a⌠ mos⌠ an∙ hobb∙ ì
shop.
Well¼ afte≥ ß couplσ oµ day≤ oµ tryinτ t∩ inducσ ì
blindnes≤ iε m∙ alread∙ weaδ eyes¼ i⌠ wa≤ timσ t∩ tr∙ ì
it« ╔ pluggeΣ i⌠ in¼ beinτ ver∙ carefu∞ t∩ makσ surσ ì
tha⌠ ╔ haΣ thσ connecto≥ orienteΣ correctly¼ anΣ ì
starteΣ checkinτ voltages« Beinτ ß chickeε a⌠ hear⌠ ╔ ì
haΣ no⌠ installeΣ thσ chip≤ iε thσ boarΣ yet« ì
Everythinτ seemeΣ likσ i⌠ wa≤ wha⌠ i⌠ shoulΣ be¼ s∩ ╔ ì
turneΣ ofµ thσ MD¼ pluggeΣ iε thσ chip≤ anΣ turneΣ thσ ì
powe≥ bacδ on.
Therσ i⌠ sat« Thσ M─ workeΣ fine¼ bu⌠ ╔ wasn'⌠ ì
surσ wha⌠ o≥ iµ thσ clocδ wa≤ doing« Bacδ t∩ Ciarcia'≤ ì
article« Hσ haΣ ß BASI├ prograφ tha⌠ wa≤ supposeΣ t∩ ì
allo≈ yo⌡ t∩ reaΣ anΣ se⌠ thσ clock« ╔ pulleΣ ou⌠ m∙ ì
pristinσ BASI├ disδ (╔ prograφ mostl∙ iε 'Cº o≥ Pascal⌐ ì
anΣ entereΣ thσ program« Well¼ thing≤ lookeΣ ok« ╔ ì
coulΣ se⌠ anΣ reaΣ thσ clock¼ althougΦ iε ß rathe≥ ì
unusefu∞ format« Theε ╔ noticeΣ tha⌠ thσ second≤ ì
weren'⌠ settinτ properly« Well¼ reall∙ thσ were« Wha⌠ ì
Ciarciß didn'⌠ tel∞ u≤ i≤ tha⌠ yo⌡ can'⌠ se⌠ thσ ì
secondsí Writinτ t∩ thσ second≤ anΣ 10≤ oµ second≤ ì
register≤ reset≤ theφ t∩ zero« OK¼ no≈ ╔ understooΣ ì
that« Thσ nex⌠ thinτ ╔ noticeΣ wa≤ that¼ accordinτ t∩ ì
Ciarcia¼ thσ day≤ oµ thσ weeδ werσ supposeΣ t∩ bσ ß ì
numbe≥ betweeε ▒ anΣ 7« ╔ wa≤ checkinτ ou⌠ thing≤ likσ ì
lea≡-year≤ anΣ 1▓ anΣ 2┤ hou≥ timσ format≤ anΣ ╔ haΣ ì
se⌠ thσ da∙-oµ-thσ-weeδ t∩ 7« I⌠ tickeΣ ove≥ anΣ wen⌠ ì
t∩ 0í Checkinτ somσ othe≥ article≤ tha⌠ ╔ havσ oε thσ ì
MSM583▓ clocδ ╔ founΣ ou⌠ tha⌠ thσ da∙-oµ-thσ-weeδ ì
reall∙ goe≤ betweeε ░ anΣ 6.
So¼ ╔ starteΣ writinτ program≤ t∩ makσ nicσ prett∙ ì
timσ anΣ datσ display≤ oε m∙ MDT60« Thing≤ werσ goinτ ì
swimmingl∙ unti∞ ╔ noticeΣ tha⌠ ever∙ timσ ╔ presseΣ ì
thσ rese⌠ button¼ ╔ los⌠ abou⌠ 3░ seconds« ì
Investigatinτ furthe≥ ╔ founΣ ou⌠ tha⌠ ╔ wa≤ losinτ thσ ì
timσ froφ wheε ╔ presseΣ thσ rese⌠ buttoε anΣ wheε ╔ ìècalleΣ u≡ thσ prograφ t∩ reaΣ thσ time« Lookinτ a⌠ thσ ì
schematiπ ß littlσ harde≥ anΣ witΦ m∙ trust∙ Inte∞ datß ì
booδ a⌠ m∙ sidσ ╔ discovereΣ tha⌠ wheε thσ 825╡ wa≤ ì
rese⌠ al∞ thσ I/╧ line≤ g∩ t∩ thσ inpu⌠ mode« Thi≤ ì
mean⌠ tha⌠ thσ holΣ linσ whicΦ i≤ normall∙ aε outpu⌠ ì
froφ thσ 825╡ t∩ thσ MSM583▓ wa≤ beinτ pulleΣ higΦ anΣ ì
wa≤ stayinτ higΦ unti∞ thσ 825╡ wa≤ programmeΣ b∙ thσ ì
reaΣ timσ program« I⌠ madσ mσ wonde≥ iµ Ciarciß haΣ ì
eve≥ eveε buil⌠ thσ circuit.
Afte≥ mucΦ heaΣ-scratchinτ ╔ decideΣ tha⌠ thσ ì
easies⌠ approacΦ wa≤ t∩ forcσ thσ Chi≡ Selec⌠ t∩ thσ ì
MSM583▓ t∩ bσ lo≈ unti∞ thσ 825╡ coulΣ bσ programmed« ì
Thi≤ wa≤ donσ b∙ usinτ anothe≥ par⌠ oµ thσ 74LS0┤ tha⌠ ì
╔ wa≤ usinτ t∩ inver⌠ thσ RESE╘¡ signal« ╔ useΣ i⌠ t∩ ì
inver⌠ anothe≥ I/╧ linσ froφ thσ 8255« Thi≤ linσ woulΣ ì
bσ pulleΣ higΦ (anΣ inverteΣ lo≈ t∩ thσ MSM5832⌐ unti∞ ì
thσ 825╡ coulΣ bσ programmeΣ anΣ tha⌠ particula≥ linσ ì
commandeΣ low« A≤ lonτ a≤ thσ MSM583▓ i≤ no⌠ selected¼ ì
i⌠ keep≤ oε keepinτ timσ bu⌠ ignore≤ al∞ thσ commanΣ ì
lines« Jus⌠ wha⌠ ╔ needed« Thσ clocδ ignore≤ al∞ ì
command≤ unti∞ thσ 825╡ i≤ programmeΣ properly!
Aligninτ thσ clocδ i≤ eas∙ anΣ tedious« Jus⌠ seσ ì
ho≈ mucΦ yo⌡ arσ ofµ iε ß giveε perioΣ oµ timσ (sa∙ ß ì
day⌐ anΣ theε adjus⌠ thσ trimme≥ capacito≥ slightly╗ ì
les≤ capacit∙ iµ yo⌡ arσ runninτ slow¼ morσ i⌠ yo⌡ arσ ì
fast« Iµ yo⌡ havσ acces≤ t∩ ß frequenc∙ counte≥ therσ ì
i≤ ß faste≥ way« SenΣ thσ clocδ aε addres≤ oµ 0FH« ì
Connec⌠ thσ counte≥ t∩ piε ╣ oµ thσ MSM583▓ anΣ adjus⌠ ì
thσ capacito≥ unti∞ yo⌡ reaΣ exactl∙ 102┤ hz.
A≤ aε exercise¼ ╔ decideΣ t∩ seσ iµ ╔ coulΣ writσ ì
program≤ iε al∞ thσ differen⌠ language≤ tha⌠ ╔ haΣ t∩ ì
reaΣ anΣ se⌠ thσ clock« ╔ wa≤ ablσ t∩ reaΣ anΣ se⌠ thσ ì
clocδ iε 808░ assembl∙ language¼ MicroSof⌠ BASIC¼ MI╪ ì
'Cº anΣ Turb∩ Pasca∞ 3.0« ╔ wa≤ unablσ t∩ writσ ì
routine≤ iε PILO╘ sincσ ╔ coulΣ finΣ n∩ instructioε t∩ ì
reaΣ aε I/╧ por⌠ althougΦ therσ i≤ onσ t∩ outpu⌠ t∩ aε ì
I/╧ port« Thσ program≤ arσ rathe≥ brutσ force¼ bu⌠ ì
the∙ work« ╔ als∩ wrotσ aε inser⌠ fo≥ usσ witΦ BYE5.
Abou⌠ thi≤ timσ ß budd∙ oµ minσ witΦ ß Radi∩ Shacδ ì
Colo≥ Compute≥ (a⌠ whicΦ ╔ haΣ beeε scoffinτ greatly⌐ ì
showeΣ mσ ß publiπ domaiε schematiπ drawinτ prograφ ì
tha⌠ hσ had« I⌠ wa≤ reall∙ ß nicσ effor⌠ anΣ workeΣ ì
well¼ iµ ß littlσ slowl∙ a⌠ times« I⌠ endeΣ u≡ ì
creatinτ ╣ disδ file≤ whicΦ werσ screeε dump≤ oµ ì
differen⌠ part≤ oµ thσ schematic« Wσ tooδ ß looδ a⌠ ì
thσ prograφ tha⌠ tooδ thosσ file≤ anΣ sen⌠ theφ t∩ thσ ì
printe≥ anΣ decideΣ tha⌠ i⌠ woulΣ bσ eas∙ t∩ writσ aε ì
808░ prograφ t∩ d∩ thσ samσ thing« So¼ ╔ sa⌠ dowε iε ì
fron⌠ oµ thσ CoC∩ anΣ dre≈ thσ schematic« Wσ theε ì
transferreΣ thσ file≤ t∩ m∙ M─ b∙ modeφ anΣ ╔ sa⌠ dowε ì
t∩ writσ thσ CADPRIN╘ program« Man∙ hour≤ oµ confusioε ìèlater¼ ╔ haΣ ß prograφ tha⌠ coulΣ takσ thσ screeε dump≤ ì
generateΣ b∙ COCOCA─ oε ß CoC∩ anΣ dum≡ theφ t∩ m∙ ì
Epsoε M╪-8░ t∩ prin⌠ thσ schematic.
Thσ bottoφ linσ i≤ tha⌠ ╔ ho≈ havσ ß filσ calleΣ ì
MDCLCK12.LB╥ tha⌠ contain≤ al∞ thσ program≤ ╔ havσ ì
writteε fo≥ usinτ thσ clock¼ ß part≤ list¼ thi≤ articlσ ì
anΣ thσ CADPRIN╘ prograφ fo≥ aε EPSO╬ o≥ OK╔ ML92/9│ ì
printe≥ anΣ thσ ╣ file≤ tha⌠ contaiε thσ schematic« ì
Therσ arσ als∩ ß couplσ oµ nea⌠ program≤ t∩ se⌠ anΣ ì
reaΣ thσ clocδ b∙ Johε Osne≤ wh∩ als∩ madσ thσ mod≤ t∩ ì
CADPRIN╘ fo≥ thσ OKIs« Hopefull∙ somσ peoplσ ou⌠ therσ ì
wil∞ looδ a⌠ thσ CADPRIN╘ prograφ anΣ makσ ì
modification≤ s∩ tha⌠ i⌠ caε bσ useΣ witΦ othe≥ ì
printers« ╔ d∩ hopσ thi≤ happens¼ 'causσ ╔ plaε oε ì
usinτ CADPRIN╘ witΦ othe≥ hardwarσ article≤ iε thσ ì
future« MDCLCK12.LB╥ i≤ availablσ oε thσ MO╥ BB╙ o≥ oε ì
ß FLOB.
-30-