6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 12:18 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Jan 04, 2003 2:45 pm 
Offline

Joined: Sat Jan 04, 2003 2:29 pm
Posts: 1
Location: Utah
I want to build a Midi interface to attach to a SBC2 65c02 computer...I am looking to build a 65c02 and program it. I program Machine Language, but I don't know hardware as well, so I am puzzled at how to build a Midi interface. I know the midi spec inside and out I know logically how to program for the interface...I know it's like 32k bps or so, but I need hardware guidance.

_________________
----------------------
www.insanityvoid.com (My Music Recordings)
www.lenkel.com/stickers (My Bumper Stickers)


Top
 Profile  
Reply with quote  
 Post subject: Midi
PostPosted: Sat Jan 04, 2003 4:26 pm 
Offline

Joined: Sat Aug 31, 2002 12:33 pm
Posts: 64
Location: USA
Hi Ivlenk,

Here is a web-site with some midi stuff.

http://home.concepts-ict.nl/~nctnico/index.htm

Also visit this general engineering site that is very very good.
It has a midi section!

http://www.epanorama.net/index.php


Cheers,

Paul


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 04, 2003 9:15 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
This is tip #11 from my "Tip of the Day" posts on the older Delphi 6502 forum (which is still there so you can refer back to older 6502 discussions):
----------------------------
The MIDI (musical instrument digital interface) bit rate is 31,250bps, which is not a standard rate option for the 6551 ACIA with a 1.8432 MHz crystal. To get it, set the 6551 for one-sixteenth of the XTAL clock input rate, and then feed it with 500kHz instead of 1.8432MHz. Get the 500kHz off of a 6522's PB7 from its free-running T1. If you have a 6522 put out a steady square wave on PB7 from T1, the frequency is: f=Ph2/(2(n+2)), where Ph2 is the phase-2 system clock frequency, and n is the T1 latch value.
----------------------------
So if you have a 6551 ACIA and a 6522 VIA and use those:

Set VIA_DDRB<7> to make PB7 an output bit.
Set VIA_ACR<6,7> for free-running T1 output on PB7, no IRQ.
Store 3 in VIA_T1CL for 500kHz PB7 output if ph2 is 5MHz
(Store 0 if ph2 is 2MHz. Equation is above.)
Store 0 in VIA_T1CH (do this _after_ writing to T1CL above)

Feed the 500kHz from VIA PB7 into ACIA XTAL 1 input (DIP pin 6).
(Don't use a crystal with this ACIA.)
Don't connect ACIA RxC (DIP pin 5).

Store 0 in ACIA_STAT_REG for software reset.
Store 1011B in ACIA_COM_REG for no parity or echo, TX & RX enabled, no IRQ.
Store 10010000B in ACIA_CTRL_REG for 2 stop bits, 8 data, RX clock=TX clock,
and TX clock=1/16 of XTAL input freq.

Of course if you receive MIDI info too and not just transmit, you will definitely want interrupts; but when I fooled around with it, I only transmitted, which is one reason ACIA interrupts are shown disabled above. Since I only transmitted, I didn't have to put any optoisolators on the home-made computer side. I used only two wires, one from ACIA TxD through a 220-ohm resistor to pin 5 of a male 5-pin DIN connector, and another wire from +5V through a 220-ohm resistor to pin 4 of the same DIN. The DIN connector pins are numbered in a way you might not expect. As you look into the end of the male connector with the middle pin at the top, you have starting at 9 o'clock pin 3, going clockwise to 5, 2 (at 12 o'clock), 4, and finally pin 1 at 3 o'clock.

Garth
engr@drecomm.com


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 17, 2004 9:45 pm 
Offline

Joined: Mon May 17, 2004 9:41 pm
Posts: 2
Location: San Diego
I remember building a MIDI interface for my VIC-20 back in the mid 80's. To keep the part count down, I used a 6551 with a 3Mhz crystal to get the 31,250 Hz needed.

Ray


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 17, 2004 10:08 pm 
Offline

Joined: Mon May 17, 2004 9:41 pm
Posts: 2
Location: San Diego
Here is the math:

1843200 Crystal Hz / 19200 (baud setting 1111) = 96 (6551 internal divider)


31250 MIDI * 96 (6551 internal divider) = 3000000 Crystal Hz

Ray


Top
 Profile  
Reply with quote  
 Post subject: Delphi Forum Archive
PostPosted: Tue May 18, 2004 3:10 am 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 281
Location: Northern California
GARTHWILSON wrote:
This is tip #11 from my "Tip of the Day" posts on the older Delphi 6502 forum (which is still there so you can refer back to older 6502 discussions)

Hi,

You can view all of the "Tip of the Day" posts in the Delphi archive:

http://www.6502.org/forum/topic/342

Regards,
Mike

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

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