Download You can - Ning.com
Transcript
standard. To do so, we have selected the Control transfer mode in order to exchange data between the computer and the microcontroller. Obviously, considering that the USB bus was not designed for that use, we had to write a special driver for this Microsoft Windows® application. The firmware source code for the microcontroller is available from our website at www.elektor-electronics.co.uk (file # 060129-11.zip). Unfortunately, the copyrights for the driver source code rest with the author, hence this file cannot be made freely available. The pre-programmed PIC (order code 060129-41) is however available from the Elektor SHOP (on the web or in this magazine) 13 Program Memory 9/2006 - elektor electronics RAM Addr (1) PORTB 9 Addr MUX Instruction reg 7 Direct Addr 8 RB0/INT Indirect Addr RB<7:1> FSR reg STATUS reg 8 PORTC 3 Powe r-up Timer OSC1/ CLKIN OSC2/ CLKOUT Instruction Decode & Control Oscillator Start-up Timer Timing Generation x4 PLL Watchdog Timer Brown-out Reset RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC6/TX/CK RC7/RX/DT MUX ALU Powe r-on Reset 8 PORTD W reg RD3:0/PSP3:0 (2) RD4/PSP4(2) RD5/PSP5(2) RD6/PSP6(2) RD7/PSP7(2) Parallel Slave Port (2) VDD, V SS MCLR Timer0 Timer1 CCP2 CCP1 PORTE Timer2 RE0/AN5/RD (2) RE1/AN6/WR (2) RE2/AN7/CS (2) 8-bit A/D Dual Port RAM 64 x 8 USART USB VUSB DD+ XCVR Note 1: Higher order bits are from the STATUS register. 2: Not available on PIC16C745. Circuit diagram A quick look at the diagram in Figure 2 allows you to better understand why the circuit can be so compact: it has only two active components! The PIC16C745 (IC2) in its 28-pin SMD SOIC version is clocked at 6 MHz by X1, a miniature resonator with integrated capacitors. The internal microcontroller frequency is set to 24 MHz, thanks to its integrated PLL, thus lowering any risk of stray radiation which might occur when using a resonator at this frequency. The PIC generates the 3.3 V voltage necessary on 1.5 kW SMD resistor R1 connected to the D– line of the USB cable. A 220-nF SMD capacitor, C2, smoothes this voltage supplied directly by the microcontroller pin. Pins D+ and D– of the PIC are directly connected to the USB bus. The second capacitor, C1, is included to suppress fluctuations in the 5-volt supply voltage caused by PIC switching. The last electronic component in the circuit, IC1, is an RS485 bus driver for which we use the SMD SO8 package version. It is connected to the USART ((Universal Synchronous & Asynchronous Receiver Transmitter ) of the 16C745 enabling it to be used bi- 14 RA0/AN0 RA1/AN1 RA2/AN2 RA3/AN3/VREF RA4/T0CKI RA5/AN4 RAM File Registers 256 x 8 8 Level Stack (13 bit) 8K x 14 Program Bus PORTA 8 Data Bus Program Counter EPROM 060012 - 12 Figure 1. PIC16C745 architecture. +5V IC1 C1 8 150n 1 20 1 1 2 3 4 RC7 MCLR +5V RC6 D– 15 D+ 16 GND D– IC2 D+ RB7 R1 RB6 1k5 nverter Housed inside an XLR connector! RB5 RB4 14 13 12 C2 11 220n VUSB RB3 RC2 RB2 RC1 RB1 RC0 RB0 PIC16C745SO RA5 RA4 9 X1 RA3 OSC1 RA2 RA1 10 RA0 OSC2 8 18 2 17 3 28 4 R 6 DO 7 DO 25 7 D 5 27 26 6 GND_DMX 5 DS75176BM 24 23 22 21 7 6 5 4 3 2 19 060012 - 11 Figure 2. The circuit diagram of our converter is limited, in fact, to a PIC micro and an RS485 bus driver. 71