Wireless GK Project

Version 3

Copyright (©) Harald Milz 2001
Put under the GNU General Public License (GPL)
See www.gnu.org.

This project starts to become more and more concrete. If I haven't made any drastic thinking errors the basic concept should be all right, and there is nothing in it which makes it physically or economically impossible. I am still looking for serious fellow developers... :-)

Damn - the beast starts needing a name.

For all those poor AOL 4.0 users who can't save HTML without crashing their machine: Here is a ZIP archive of the whole folder.

Commercial disclaimer: I have no commercial interest in this project, and do not plan to market it. I would gladfully cooperate with any capable firm to produce this unit, though, be it a small startup or be it Roland if they ask me kindly :-) Before you start to produce and market these things be sure to read the GNU General Public License, though. It requires you to put all derived work under the GPL as well.

A Different, Simpler Approach

Contents

Basics

The Roland GR synthesizer and its VG-8 companion are incredible instruments. The dumbness of the 13-pin Atari monitor plug is incredible too. Either you inadvertently rip out your cable from the GK controller, or the cable wraps itself around a foot pedal, or it starts to twist all along. It's high time for a wireless GK cable. This is what this proposal is about.

The 7 audio signals (guitar, GK string 1-6) are ADC converted using low-power audio ADCs. The ADC outputs are read by a microcontroller. Synth Vol is voltage-to-duty-cycle converted read once per frame, as well as S1/S2. The data is FM or MFM modulated and sent via a wireless video link. The receiver decodes the data and feeds the audio data stream into 4 audio DACs. Synth Vol is restored, as are S1 and S2.

The DIY project stops at the video signal output and input, respectively. The DIY'er has to provide his or her own video transmitter link i.a.w. national regulations, as well as the power source.

Expected performance:

The video link will perform best in an environment without much noise (what else is new?). Everyone transmits on 2.4 GHz now. Diversity receiver preferred, possibly in the 5.8 GHz ISM band. Extremely expensive, it seems.

This is just a broad concept. Feel free to comment, rip apart, rewrite, make up new ideas, etc.

Transmitter

Block diagram see here. The transmitter consists of

Synth Vol: we convert the 0..5V voltage to a 200-odd Hz PWM signal with a duty cycle of 0..100%, and read the single bit once per frame (sample rate ~ 17 kHz). The generator consists of the usual integrator/schmitt-trigger triangle/squarewave generator and a comparator which compares the triangle wave with the synth vol voltage. 3/4 of a LM324or TL074, that is. The comparator output is read by the PIC once every frame, i.e. the sample rate is about 17361 Hz. That gives us an effective resolution of ld(17361/200) or 6.4 bits.

S1/S2 are read by the PIC directly, and inserted in the bit stream.

CPU and software

PIC 18F232:

DC Free RF Encoding

To keep SDO busy all the time we need to write to Port B after exactly 16 CPU clock cycles. According to the PIC data sheet, writes to SSPBUF during an active write are ignored. This could be solved by using an external parallel-to-serial shift register (74HC165) and writing to Port B whenever we are done, or by counting clock pulses very closely. /PL at the falling edge of SCLK, shift with 5 MHz.

Output Stage

We'll add a 75 Ohm amplifier stage (e.g. LT1217)and a BNC connector. The signal is attenuated to 2Vpp. If the video link breaks for some reason we can use a cheap 75 Ohms RG-59B BNC-to-BNC cable.

Power Supply

Estimated power requirement:
master clock 25 mW
4 * CS53L32A 40 mW
PIC 50 mW
several 74HC @ up to 40 MHz 20 mW
Sum: ~ 150 mW

Mechanical Construction

It would be nice if all fit in a small case with a 4 AA cell battery compartment.

Most components should be SMD. Everything should fit on a 80x100mm PCB (half Euro card, that's what the freeware Eagle layouter can provide), maybe a sandwiched 80x70mm daughter card will be needed. Since the 13-pin PCB connector is 22 mm high including leads the case should be 24-25 mm high internally at least anyway. An alternative would be to use no 13-pin PCB connector (who makes the 30cm 13-pin stub cable?) but permanently attach the cable to the PCB. The PCB needs to provide a 14-pin in-line plug too.

Using SMD components is a challenge for soldering... The CS53L32A's pin pitch is 0.65mm max. ...

If you prefer to stick the battery case in your trouser pocket you can use a smaller case without batt compartment (sounds like 110x90x30 mm). In this case a lockable power connector is a must!

Receiver

Block diagram see here.

RF Signal Restoration

The Input Stage will have 75 Ohm impedance. Input = BNC connector. Use a fast comparator, like LM311, and a low pass to create a floating reference. Positive feedback to get a small hysteresis. Done.

Decoder / Data Separator

CPU

Same as above. The algo needs to separate the digital audio data and feed it to the DACs (2 LSB == 0). Frame sync word -> LRCK. S1/S2 output to 2 port bits.

Clock

VCXO controlled by a PLL which pulls the clock i.a.w. the received signal. This should produce a very low jitter clock signal for the DACs. The restored MFM or FM clock is 5 MHz so we need to divide the VCXO frequency by 8. For MCLK, SCLK and LRCK clock ratios see above.

DA Converters

Synth Vol

PCM, recovered by 1 Hz / 12dB/Oct low pass.

S1/S2

Output direct.

Power Supply

KISS: all linear. Everything is at +5V. -> 7805 / LM340 (75 µV noise) or low noise replacement (e.g. National LP2989IMM-5.0 w/ 10 nF film cap as bypass, and 4.7 µF ceramic output cap -> 18 µV output noise). Separate regulators for analog and digital. Keep magnetic hum away: use separate wall mart. This also helps avoid ground loops. The PCB will only contain the rectifiers, capacitors and regulators.

We'll take ±7V for some OPs from a connected GK device.

Outputs

3 GK outs w/ selector switch, and Guitar out

Case

Not rackmount. We want to place the beast near the GK footboxes (I wish Roland built rackmount VG8 and GR-3X versions).

Data Stream protocol

Transmitter

Since we need to read serial data streams from all 4 ADCs in parallel, and have hardly any time to write the data to a indirectly addressed buffer (18C242 manual pp. 50), we need to send the bits via SSP immediately. Hence, the ADC-to-serial protocol is very primitive. If anyone has a better idea, ...

Frame sync: LRCK is read to determine the frame sync. We produce a biphase-mark code violation, and send 10 00 10 00 as the last byte of a frame. There is no FM code which can produce this pattern (FM has always the first half == 1). The sequence is DC neutral too (even number of level transitions, and equal distances between transitions). The receiver will start a new frame with the next received byte.

ADC4 has the guitar signal which is transferred with full 18 bits (we could even use both ADC channels for the guitar signal in parallel, and do some checking in the receiver to reduce errors). GK signals (ADC1-3) are handled with 16-17 bits "only".

S1/S2: are sent in bits 0 and 2 in cycle #18. We do nothing special to the LSB and LSB-1 of ADC3, and LSB-1 of ADC1 and ADC2 so effectively we transmit the left phases with 17 and 18 bits, respectively. Which strings should be have a better resolution? The high ones or the low ones? We've got 17, 17, 16, 16, 16, 16

Synth Vol: sent in bit 4 in cycle #18. Bit errors are equalled by the low pass.

The transmitter routine has 3 special cycles: #18, #35, and #36. These have to be checked in each cycle. If we combine #35 and #36, and use registers for the literals 18 and 35, we can save some cycles.

We thus have 144 bits per frame. Frame rate = sample rate = 17361 Hz.

Error recognition

Checksum: the nibbles from cycles #1-34 are XOR'ed against a RAM cell which was nulled on the last frame sync. This RAM cell thus accumulates an XOR parity. In cycle #35, the parity is sent. This simple scheme will detect all odd number bit errors in each of the 4 parallel bit streams. It will not correct anything so we just discard false messages, and repeat the previous one.

Since we can't correct any errors as of yet, this is rather error recognition than error correction. I'd like to be able to correct at least single bit errors. We could use Hamming code which makes 7 bits from 4 bits but then we'd have to generate the MFM encoding externally. Hamming code is simple to generate (table lookup) but not so easy to decode with a few CPU cycles.

Links:

Any more tips & tricks appreciated. Maybe someone can write a Reed-Solomon Decoder that uses only 3 PIC instruction cycles or so :-)

Receiver

The 18C PICs have 3 indirect adressing pointers so we can

Raw program logic:

read consecutive data bytes and wait for frame sync. In the meanwhile, restore start values for the variables above.

Many conditionals... 16 clock cycles must be sufficient for that. The Scenix SX CPUs have only one (!) INDF and FSR register each, and hence we cannot use 2 buffers as shown above. Argh.

Logistics

How do people get preprogrammed PICs and GALs? Not everyone will be able to program the 2 PICs and the GAL.

True Diversity Receiver Idea

Someone suggested to do diversity on the demodulated end of the receiver(s) (a.k.a. "True Diversity"). This is independant of the other stuff and can be built in addition to the single receiver. More design ideas are here. This would require

Or does someone have a working application for the Analog Devices AD6600?

http://www.dynapix.com/supertriad.htm ?

A very interesting system is S-515P on http://www.cocom.com/acatalog/Online_Catalog_CVT_500_29.html. A bit expensive for hobbyists maybe.

Field Upgrade

In order for the user to be able to upgrade the devices' firmware without special tools (ICSP capable programmer), we need to use the USART port and write some code to do the programming.

Sample code is contained in Microchip's Application Note TB025 "Downloading HEX Files to PIC16F87X PICmicro ® Microcontrollers". The code is specific for the PIC 16F87X types but can be ported to using the TABLE instructions of the 18F quite easily.

Basically, we add a MAX233 (no external caps needed) to convert the USART port to a "real" RS-232 port because we cannot assume all serial ports work with unipolar +5V voltage levels. The MAX233 uses about 5mA without load, so we sort of switch its Vcc off if we don't need it. The same switch can inform the PIC that serial programming is now enabled.

Software: we enable the USART interrupt in the init routine, and set the corresponding IRQ vector to the serial programming routine. When data arrives, it will be accepted by the programming routine, and written to program memory using the TBLWT instruction. The code needs to make sure it isn't overwritten itself. It'll use software handshaking. To save power, we deactivate the USART as long as it isn't actually used (SPEN = 0).

Firmware upgrades will be available on the web in Intel HEX file (INHX8M) format. This is what MPASM and GPASM create and support. Everyone can download the code and simply send it to the device using a standard PC and serial port no matter what operating system is used. Data rate will be 19200 bps 8N1 - higher rates are not standardized, and 38400 is not available @ 40 MHz clock.

Thus, the devices need to have a 9-pin serial connector. Will be used with a normal serial cable, not a null modem cable.

This is only for the non-developers. People who build the devices themselves are supposed to have a ICSP capable PIC programmer.

Development

Hardware

I normally use the Eagle layout editor and autorouter for which there is a free demo version. It can only produce 80x100 mm PCBs though, as part of the shareware limit. The full license costs only $49, though. Layout files will be distributed as Eagle files (.sch and .brd).

Software

For those Linux users among you (like me), see Microchip's statement about Linux support. Basically, go to www.gnupic.org. I for one will be using GPASM on Linux. GPASM is rather comprehensive. It does not officially support the 18F232 yet but the 18C242. These two aren't much different as far as can be seen from the very brief 18F232 data sheet.

For other platforms than Linux you may need to get a copy of MPASM, or use GPASM with a Cygwin environment if you're a Windoze l00Z3R ;-)

During the development stage, the GNU PIC Simulator GPSIM may be extremely helpful. Supposedly, it doesn't fully support the 18Cxxx family yet but as far as I can see from the GPSIM source code all that we need should be there. GPSIM should save a lot of EEPROM/Flash burning cycles, and we can test the correct timing before touching the solder iron at all.

To program the initial stuff into the PIC (serial programming routine), one needs a ICSP capable programmer. The PCBs will contain a 5-pin ICSP header. See the Microchip ICSP Programming Guide

Debugging can be done by adding some code which writes to the serial port, and connecting a PC to the MAX233. If the PC has 2 serial COM ports we can supervise both Tx and Rx at the same time.

Parts & Sources

I'm listing only German sources here.

Video transmitters

You can use any commercially available video transmitter/receiver combo you like and you can afford, in whatever frequency range is appropriate (800 MHz, 2.4 GHz, 5.8 GHz, you name it). Use one with the highest RF output power you can get.

Over time, we will try to compile a list of appropriate video transmitters.

Hint: if your transmitter / receiver has a separate audio or even switch channel you can add a Reset button which resets both the transmitter's and the receiver's PIC! Just in case...

- Conrad pp. 519/882. 
- the Gigalink module offers 5 selectable channels. 
-> use alarm switch connector for S1/S2 ?
-> use microphone input for synth vol VCO signal
-> hence only 7 audio channels over video FM. 

ELV (www.elv.de): 4-Kanal-Sendesystem ALM 2442 399 DM (set!)
- transmitter uses 4.8..7.2V, i.e. Vbat directly. 
- has audio channel (reset)
- can use a case w/ 4 AA-cell battery compartment. 
- batt cptmt: Conrad 521868 or external battery
  pack w/ cable
- also nice: Bopla BOS 752 or 807
  (http://www.bopla.de/, w/ 4 AA-cell
  battery compartment) (Reichelt pg 179/80) 


https://spynet.xynx.com:
- auch 25 mW Minisender.  (auch Gigalink - 2004311, 390 DM)
- angeblich nur 120 mA 
- Mini TX II 10 oder 25 mW (?) 2200012  480 DM
- Empfänger 2048020 229 DM (COnrad 329 DM) 

-> non-diversity :-( 

http://www.securitec-gerlach.de/: very
  cheap. Quality? 

http://www.dynapix.com/oem.htm ? Only signel
  frequency, needs 500 mA!

Diversity: 
http://www.premierewirelessinc.com  5.8 GHz

I have got one hint saying the cheap X1 transceivers
work fine for SPDIF (http://www.x10.com/products/offer105.htm)

    

Open Questions

Proposal V2

I was asked why I dropped my old proposal which involved analog frequency modulation, companders etc. Well - too many knobs to tune, not really DIY safe.

Credits


To my other electronic projects


Harald Milz
Last modified: Thu May 31 20:54:15 CEST 2001