HARDWARE

 ·    Home   ·   Firmware >>

Three versions are shown here, and each of them can be used with no software modifications. The first one, which contains resistors only, is good enough for experimenting, but the third one, with emitter-follower drivers, will give the best results. It is recommended to add some 5V HCT or LS buffers for horizontal and vertical sync (HC will not satisfy Vih level for 3.3V PIC MCU signals). If you use hardware version 2, with 74HCT32 drivers, note that it would not be possible to use neither 74HC32 (for the same reason), nor 74LS32, as it would not satisfy the output current characteristic for high logic level (Ioh).

The special care should be taken for the port pins selection. Colour signal outputs (RGB foreground and RGB background) can use the low portion of any output port, but the bit positions must remain the same as it is shown on the schematics diagrams: bit 0, 1, 2 for Red, Green and Blue foreground and 4, 5 and 6 for Red, Green and Blue background, respectively. Bits 3 and 7 of the same port byte should not be used as outputs, as the routine will reset them to low level during video signal generation, but may be used as general-purpose inputs, special-purpose outputs (e.g. OC or UART), or left unused. The high portion (bits 8-15) of the same port may be used with no restrictions, as video routine writes only to the low byte of that port.

At the beginning of the source file, there is the line which contains symbol named "rgb_port" and defines which port will be used for RGB outputs. For instance, if you wish to use the low portion of output port B, you should put:

                                                     
 .equiv rgb_port,LATB  ; define RGB output port here 
                                                     

The two following lines in the source file (video.s) define which port and which bit in that port will be used for vertical sync output, and the next three lines define the PS/2 keyboard inputs in the similar way. Be careful when deciding which input ports you shall use for those inputs, as they must be 5V tolerant. At the pinout drawings on the new versions of data sheets, Microchip marked those 5V tolerant pins as gray, which makes the selection easier. It is also recommended to select pins which have internal pull-ups and to activate those pull-ups. Find the line in the source file which contains symbol name "CNPU2", as this is the place in which you have to activate the pull-ups that you need. Another option is to use two external pull-up resistors, about 4K7-10K each.

The selection of horizontal sync output is a little more complicated. This signal is not generated by software, but by the Output Compare 1 register. Some PICs have the ability to select the output pin for that peripheral, but some do not. You have to check the Data Sheet Manual for your microcontroller and see if it has the Peripheral Pin Select (PPS) capability for output signals. There is a simple way to check this - just look at the pinout drawing and if you find the pin named OC1, that microcontroller can not redirect peripheral outputs to some other pin and you must use that (or some other OCx) pin for horizontal sync.

If your microcontroller has the Peripheral Pin Select option for outputs, you can open the source file in this project and find the line which contains register named "RPOR7" and to employ it with the correct setting for your PPS option.

Although it is possible to run the unit with the internal RC oscillator (FRC 7.37 MHz), it is strongly suggested to use external crystal or ceramic resonator. The unit was tested with internal FRC and it worked, but some TFT monitors could not keep good track with the signal and had a hardly noticeable jitter at some pixels (the program lines for FRC initialization in the source file are kept, but commented out). You can use any crystal or ceramic resonator between 3 and 10 MHz in XT mode, and adjust PLL to obtain full speed of 80 MHz (40 MIPS). Generally, all you have to do is to write the new value in PLLFBD, which you can calculate from the formula 320/Fq, where Fq is the crystal or ceramic resonator resonant frequency in MHz.. In the source file, it is adjusted for 4 MHZ oscillator (320/4=80).

Note 1: External components for oscillator are not shown on the simplified schematics diagrams.

Note 2: Vcc for all 24H PICs and dsPICs is +3.0 to +3.6V. The recommended way is to use some low-drop voltage regulator (BA033 or similar, with +3.3V output) and to supply the whole unit with +5V DC. Ceramic and tantalum capacitors for proper Vdd and Vddcore decoupling must also be used. This is not shown on the simplified schematics diagrams.

Version 1 - Resistors only

Version 2 - HCT drivers

Version 3 - NPN drivers

The next drawing represents the full schematics diagram (version with NPN drivers for R, G and B signals and with no sync drivers) for microcontroller  PIC24HJxxGPyyy  (where xx = 64 or 128, and  yyy = 202, 302 or 502). PIC24HJ32GPyyy can not be used in this project, as it has only 4K of Data RAM. Pin numbers are for 28-pin SDIP or SOIC package. PCB drawings for SDIP package and component layout are also listed at the bottom of this page. If you build the unit with these components, you can use the downloaded software with no modifications to program the MCU and everything should work fine. The only line in the source file that should be modified is the processor definition.

It is also possible to use dsPIC33FJxxGPyyy  (xx = 64 or 128, and  yyy = 202, 302 or 802), with no hardware and with minor software modifications (probably only the the processor definition). This was not tested, so it is possible that some more adjustments will be necessary, but there is no doubt that it shall work (the only processors from dsPIC family that it were tested with, were 64-pin dsPIC33FJ256GP506 and 100-pin dsPIC33FJ256GP710, and it worked fine in both cases). Note that dsPIC33 is very similar to PIC24H family, the only differences are that dsPIC33 has the digital signal processor, and that it supports DO instruction (the same difference applies to the families dsPIC30 and PIC24F, but they are not fast enough to run this project). Neither digital signal processor nor DO instruction are used in this project, so it does not matter whether you shall use dsPIC33 or PIC24H family.

NOTE: The following description applies to PIC24HJ64GP202. This is not tested yet, as I still do not have the microcontroller sample in 28-pin DIP case, and I shall remove this note when I get and test it. For the schematic diagram with 64-pin PIC33FJ256GP506, on which the prototype was based, click here.

PCB dimensions are 70 x 58 millimeters (2.75 x 2.27 inches). Unused port pins are connected directly to the 10-pin I/O connector, for UART expansion or as general purpose I/Os. Please note that there is no ESD protection on those terminals. Also, if you connect it to the 5V logic, take care about the signal voltages driven to the MCU, as RB9 is the only 5V-tolerant input, and the voltages on all other inputs must not exceed Vdd, which is 3.3V. If you do not use those terminals, make sure that they are defined as outputs in TRISA and TRISB SFRs, to avoid input floating, as there are no pull-ups on the PCB. The same applies to PGED2/RB10 and PGEC2/RB11.

Decoupling capacitors are ceramic (330nF-1uF) and tantalum (4.7-10uF and 22-47uF). Resistors R2, R3 and R4 define the voltages on Red, Green and Blue signal lines for VGA monitor, and R5, R6 and R7 are for impedance matching. R1, R8, R10 and R11 are for ESD protection, and R9 is the pull-up for Vpp/MCLR input.

There is the connector for ICD2 or ICD3 In-Circuit Debugger, but it is also possible to use any other PIC programmer, which supports PIC24H and dsPIC33 families.

Jumpers J1 and J2 are for supply voltage selection for the external board via I/O connector. If you select 3.3V, take care not to overheat the Low-drop regulator by the extra current which consumes the external board. If it appears to be necessary, use the heatsink.

Transistors are listed as BC547, but any other small-signal switching NPN transistors will work. The PCB project is based on transistors which have the base terminal in the middle.

Two-layer PCB is used. Red drawing is for top layer, and the green one is bottom. Note that bottom layer is mirrored here (top view), to simplify the orientation.

Resistors:

R1   100Ω     1/4W
R2   100Ω     1/4W
R3   100Ω     1/4W
R4   100Ω     1/4W
R5   75Ω      1/4W
R6   75Ω      1/4W
R7   75Ω      1/4W
R8   100Ω     1/4W
R9   4K7-10KΩ 1/4W
R10  100Ω     1/4W
R11  100Ω     1/4W

Capacitors:

C1   330nF-1μF 25V  ceramic
C2   22μF-47μF 16V  tantalum
C3   330nF-1μF 25V  ceramic
C4   330nF-1μF 25V  ceramic
C5   4μ7-10μF  16V  tantalum

Transistors:

T1-T6   BC547

ICs:

PIC24HJ64GP202  (SDIP)
BA033  Low-Drop regulator 3.3V

Miscellaneous:

3-pin Ceramic Resonator 4MHz

 

 ·    Home   ·   Firmware >>