Electronic Circuits and Tutorials
Tutorials
Dictionaries
Projects
Facebook
Discover
Electronic Teaching and Professional Projects

Let's GO PIC - Micro-mini GT

Author: Prof. Dr. Marco Gottardo
Email:  ad.noctis@gmail.com

Prof. Dr. Marco Gottardo

At one year after the creation of the Micro-GT Versatile PIC IDE decided to launch the successor to the hobby and educational system known as development of nearly two hundred copies were distributed. The main philosophy of the changes going "all in one" that everyone on board to a distributed, multi-media that will be called mini shield. The strong point is the extreme cost of the system, however, combined to great versatility and interfacing.

Differences with the top model GT-PIC Micro versatile IDE

The Micro is a mini-GT development system exactly like the previous version but the support is much more compact PCB measuring just 62x55mm 164x155mm against her older sister. The main limitation lies in the obvious constraint to use only small 28-pin pin-equivalent to 16F876A, even series 18 and in the absence of the hoof TEXTOOL, however, rendered useless by programming philosophy "incircuit" which will be the dominant theme of this and the next episodes of the tutorial "Let's GO PIC". In practice, when inserted into the PIC in this tiny card will no longer have to remove it even if you wanted to reprogram.

There are two ways of programming the PIC:

  • via ICSP.
  • preloaded with a serial bootloader.

Programming via ICSP

A greater advantage over the model is the presence, on the left side, the 6-pin ICSP connector that allows direct compatibility with the official products of home and MicroChip PICKIT2 pickit3 of which we see in the images and their pinouts.

PICKit 3 connector PINOUT

As we can see the configurations of the connectors of the two models are identical and therefore PICKIT compatible, so you need to put this tool into the ICSP connector for the Micro-Mini GT program the PIC inserted into the socket.

Caution: Pins 2 and 6 are connected to the ICSP connector pads and LSP3 LSP4 visible in the photo immediately below the connector, this in order to give maximum interfacing. Usually the pin 6 is also disconnected in PICkit, while the pin 2 corresponds to the supply voltage Vdd of +5 V on the card. in case it was for, which is not always true, We weld them at the other end a thread that can be closed in the terminal X2 terminal 1, which corresponds to the fourth pole from the high side (the one of the leds)

Point of great pride is the large screen-printed written MADE IN ITALY and I urge all colleagues to never forget to imprint it in their achievements

Compared to the top there is the need to use colored pentafilare ICSP cable that is supplied.

Programming via bootloader.

A bootloader is a kind of "operating system" written especially for the PIC whose function is to allow programming LVP (low voltage programming) of the device also using its own serial port.

The system is divided into two programs, one the bootloader itself and the second is the downloader. There are also multiple versions of both open and customizable surce accordance with their licenses are issued.

In this updated the downloader link tested and working UserFiles / ad.noctis / downloader (2). rar

From subsequent two links you can download the bootloader for specific communication speed and frequency of the crystal indicated:
UserFiles / ad.noctis / 16F876A bootloader 4Mhz 9600.rar

UserFiles / ad.noctis / 20Mhz 16F876A bootloader 38400.rar

Operationally, proceed as follows:

  1. Load the bootloader into the PIC that specific use will be considered in its Micro-Mini GT, this choice will be subject to the type of use and programming that will be "average" play. Important is to mount the crystal and set the corresponding serial port "also converted virtual USB as you would normally do in laptops, the speed indicated. In numerous tests over the two bootloader provided behaved magnificently. Obviously, the bootloader is loaded using a programmer such as Micro-GT Versatile PIC IDE, but in the absence of such a tool you can request your copy of Micro-GT mini preloaded with a bootloader.
  2. unzip the "downloader" on the desktop of your computer. Personally I used a 64-bit win7. This is an exe file and does not involve a real installation. Once launched, open the. Hex obtained as source compiled by the methods explained in the previous episodes of "Let's go pic!" or any other method. Remember that the setting of the cast is not performed by this downloader, then must be implemented within the source code "C". To be clear, in the first small programs such as the classic supercar used as a functional test of the PORTB and its connection to the 8 LEDs onboard, disable the watchdog, and every other cast except the LVP and the write enable.
  3. When you cast the writing on the PIC, the downloader responds with "searching for bootloader" to hook the communication must act quickly on the reset button of the Micro-Mini GT. You will see the progress bar move with astonishing speed, especially if you used the bootloader to 38400 (one to 20MHz), and of course you have set the port speed to that value on your operating system.
  4. Of course, if you have a notebook or netbook, you are connected via a common and cheap USB-> RS232. We have tried several and they all worked.

To operate the system requires a serial cable to connect the output portion of the USB to RS232 converter with pin-points in the figure:

Warning: Do not look at the internal numbers of the connectors on the front but the rear ones on the solder side or you could build a cable is not working.

If you do not have a 9-conductor cable you can use a cable with 4 or more than sock screen. work in exactly the same way. in this case the connections are essential:

The final aspect of the cable is made ​​known to all, but for the less experienced, we must remember that you will see a male connector connected to the Micro-GT and a female that will be connected to the USB-> RS232 or COM port of your PC desktop (when provided with this port).

The multiplication table summarizing the 5-conductor cable, solder side, is:

female   male
5 > 1
2 > 4
3 > 3
8 > 7
7 > 8

As another reminder assignments also carry standard DB9 connectors Cannon.

In some sites, such as a site of Danish Robotics, Micro-GT mini is distributed as a "complete package" so the cable is already included as also being used on CD rom, a servomotor, a PIC with bootloader preloaded and some demonstration programs that cover around all the skills required of the programmer PIC including management of analog signals, the serial interfaces to a PC for control of 14 servo, stepper motors, LCD displays, etc.. The same package also provides some basic use of mini shield.

Another difference with the older sister is that it is not mounted onboard a button to the simulation inputs, in fact the only one, and also essential for using the bootloader, is the reset button. If the product has a positive response from the public will be made ​​to serve as a mini shield panel. The accessibility of I / O is still very full and clear as the strip line follow with good approximation the pinout of the PIC on the PCB layout.

The strength of this card is higher than the model directly interfacing with 14 servo motors for which the connectors streep line and three-position screw terminals for separate power supply units are designed.

download high resolution image -> UserFiles / ad.noctis / Mini microGT_con_8_servo.jpg

In the picture are represented only 8 of the 14 possible servomotors connected, in order not to have too many leads in the image that would have made ​​it unclear image, however, is easily understood that all of the strip line to the right of the PIC can accommodate a servo motor according to the standard three-pin wire to +5 V Vcc (separate from the logic) in the center, closest to the pin pico, usually white or orange Blue yellow according to the manufacturer corresponds to the signal monostable reiterated that position in a corner the actuator, while the remaining pins of the three, ie the one on the side of the communication port is the mass of the motors in common with the mass of the card. This type of connection creates a sort of intrinsic protection of the servo from inversions accidental engagement of the connector since the power pin is located at the center and then in a symmetric position. It continues to have the correct voltage but the engine will not move because the pin to which it is intended the signal will be found to ground.

The quartz may be interchangeable mounting it instead of welded on base simply molded tulip as well as the two ceramic capacitors with the known equivalence:

  • Quartz 4Mhz -> 22pF capacitors
  • 20Mhz crystal. -> 18pF capacitors

The photo shows clearly the solution to make interchangeable quartz when the card is USAT as a system development and testing in the laboratory.

In order to ensure good electrical contact between the leads of capacitors and thin quartz with their hooves incurvarli you recommend some 'and make sure that their natural opening to keep them pressed to the metal strip inside the female line which has built pinout. those who feel too uncertain to lose this solution and leave balances directly from 4 MHz crystal on the printed circuit taking into account that in the final design execution speed will be unpacked using the old delay, but likely will be using the new delay net update. (Remember to change the # define of quartz in the first row header define. H.

Wiring diagram.

The circuit diagram is very basic and essential, there are mysterious things or much detail except maybe the solution resistance and double 1N4148 diode to pin MCLR.

Click on the image above for better view

List of components:

Between 220 and R1 = 1K (well 560)

R2 = 10k pull up to the reset command

R3 = 1K allows application of programming voltage without short-circuit

RN1 = resistor network with common on pin 1 and 8 ports, alternatively 8 resistance value between 220 and 1K.

D1 = 1N4148 prevents the programming voltage to flow saddles feeds damage PIC and regulator.

P1 = reset button, normally open for print (typically omron)

C1 = C2 = 18pF ceramic capacitors if 20MHz quartz, quartz 22pF if 4Mhz

C3 = C4 = C5 = C6 = 10uF 35VL electrolytic for level shifter MAX232

C7 = 100 nF polyester (power filter on the PIC)

LD1 - LD8 = 3 mm red LED diodes (cathodes to mount with the PIC, then down)

power = 3 mm green LED diode (mounted with the cathode towards the PIC, then up)

Sockets 2 from 7 +7 pin or 1 28-pin for the microcontroller

8 +8 pin socket for the level shifter.

X1 = X2 = X4 = two-way screw terminals for mounting on printed

X3 = Cannon DB9 female connector for mounting on printed at 90 degrees.

= LM7805 voltage regulator for positive power TTL of the card

= MAX232 level shifter for adapting the dual voltages + / - 12VDC to TTL UART serial transmission of the PIC

= PIC16F876 28-pin PIC microcontroller or equivalent such as pin to pin 16F873 or 18F2520

SV1 = male strip line 6 way better if long and 90 degrees to connect PICkit 2 or PICkit 3 step integrated

Analog / digital = male strip line 6 way pitch standard integrated

SV9 = male strip line integrated Step 8 pin pitch

SV3-SV4-SV5-SV6, SV8-SV7-strip line = males integrated three-way pitch

SV10-SV11-SV12-SV13-SV14-SV15-SV16-SV17 STRI line male three-way step integrated

a strip line female 40 ways to build the flat cables and sockets of the crystal / capacitors removable

flat black red to power the device

Provide a supply voltage terminal X1 between 7 and 18 volts (it supports the 24) X1-1 positive, X1-2 gnd

 

Also very useful is keeping tabs on the pinout of the 28-pin PIC microcontroller for which the card was developed.

Weather permitting will be made ​​a shield that implements the right of cross pin so you can install an Atmel microcontroller. for the moment is not fully compatible so do not try entering.

The realization of a compact card then you should not leave it in the hands of an instrument to FidoCad but a little 'more powerful as Eagle. It 'was in fact made ​​of dual-layer laminate FR4.

After the routing automatically executed with the command-Routing (see my previous tutorial "exercises Eagle") is obtained as we see below:

The three two-way screw terminals have the following meanings, listing the top:

  • X1-2 -> mass of the external
  • X1-2 -> positive voltage supply at least 7Volt
  • X2-2 -> mass inside of the card to power the shield
  • X2-1 -> positive supply to 5 volts to power the logic of the shield (if allowed)
  • X4-2 -> mass of the actuators or reference to the external loads.
  • X4-1 -> Separate power supply of servo motors, they use only a couple of small power can and jumper X2 with X4-1-1 leading to serve the same supply voltage of the logic board. Note that although the 7805 series controllers can provide 1 amp, it is safest not to exceed half of this value to not annoy the logic of the microcontroller and the execution of the program during the input peaks due alal torque must overcome each actuator.

 

The next phase of work is the implementation of the CAM (see the tutorial exercises Eagle Cad that I published on grix). The use of CAM tools built on Eagle produce the gerber files named.

The gerber represent the control directives that the numerical control machines are waiting for the physical realization of the PCB, for example the fil. Drd obtained by the passage of CAM with the activation of the macro excellion.cam returns coordinates and diameters of all holes present in the support, like the file. GKO returns the profiles of the milling machine which is equipped with cutting tools, it would be very contours and profiles of the PCB.

The end result is this:

Micro mini GT-side components. (62mm x 55mm)

The assembly phase does not hide any difficulty and can be made ​​by an expert in about half an hour. A little 'longer the welding phase of the servo pin, which I highly recommend welding of three vertical stripes (as shown in the screen printing) obtaining a useful reminder that these connectors are specifically designed for servomotors. Do so even if you can do, to settle the row of strip line males, eight for PORTB (the group most at right) and 6 for the three horizontal lines of PORTC. Missing two points to PORTC I / O because they are committed by the serial communication port, it is preferred rather than sacrifice greatly complicate the layout of the PCB.

Remember that the serial port bipolar signals arrive at +12 and -12 volts, then the capacitors connected to the MAX232 level shifter can also have a voltage rating of only 35VL thus being very compact. During assembly keep all the positive (rheophores longer) oriented towards the voltage regulator as clearly indicated in the screen printing.

Here's an example of the Micro-Mini GT assembled:

Resistance network components are now very common and cheap, but it can happen that some small shop does not have in stock, in this case do not hesitate to mount eight resistors 1/4w value between 220 ohms and 1K, upright , bearing in mind that the leftmost will have the rheophore top uncut but simply bent towards the other resistances in the rientarre then printed in the pin 1 of the resistive network (common terminal) We weld all the leads to remain free to this vertical transverse before cutting to size.

We built our network manually resistive.

As we know compatibility issues with certain files. Hex that we can find on the internet it is good that our IDE (development system or the Micro-Mini GT) can work at different speeds, which is why in the picture, and as already explained above , the capacitors have leads, so strangely long. in fact, are not welded, as well as quartz. Obviously this solution is good only in the laboratory and under development. If the card had a final destination as the control of anything, then quartz and ceramic capacitors must be well soldered to the PCB.
 

Muniamo now our implementation of several useful accessories, the first is a flat 8-conductor cable that is designed to combine the srip line of LED with the PORT we want to see the status.

A second cable, which is similar but only 6 wires must be constructed to be inserted into the connector labeled analog / digital, having precisely the purpose of allowing the connection of the PORT TTL signals coming from the outside or with analog signals. The simulation of these signals analog can take place for example by connecting up to 6 potentiometers 10K ohms having the cursor connected to one of these pins, while the two side to the terminals X2-1 (or +5 V) and the other to X2- 2, ie to the circuit ground.

Some test programs.

This tenth episode of Let's GO PICE 'the first platform based on reduced micro-mini GT and opens a new avenue of programming examples and methodologies particularly suited to educational environments, hobby or for self learning. As with previous episodes of the chapters will be presented for specific topics, then as now presents itself, and 'should only be considered an appendix to the launch of the new G-Tronic Hardware Robotics. Basically will put here compilanti regardless of the stage of creation at all since this is the source of or already 'gained from reading the previous chapters, or will be' presented and detailed in later chapters.

What matters now and 'test the hardware well.

Example 1: Bar graph of the analog signal.

You want to turn on the LEDs connected to PORTB as a function of the analog value present in the first channel of the PORT of PIC 16F876A. The range 0 -> 5V is then divided into 8 levels and the analog signal that simulates for example the volume of a liquid inside a tank or a luminosity 'or even an environmental temperature, and' simulated through the manual action on a potentiometer .

Download the hex file -> ADCsoglia.zip

download the downloader -> downloader.zip


The photo shows the correct connection of the tab for the operation of this test program. the potentiometer 10K has the cursor (white wire central) connected by a strip line, to a position, the connector ANALOG / DIGITAL in the first pin from the terminal side, will be connected to RA0 which is the first analog channel. The red and blacks side potentiometer wires are connected according to the colors to 5VDC adapter (terminal X2-1) and mass of the card (terminal X2-2). Rotating the slider of the potentiometer is simulated by an analog signal between 0 and 5V.

A series of comparators software illuminate the LEDs connected to PORTB, such as a ramp.

CAUTION: In some cases it may be that the LED 4 (the first off the picture) does not light. Tratat not a hardware problem but software is not to be found in "C" source but rather used in the specific bootloader that could take RB3 of 16F876A as this, as you can see by looking at the pinout shown above, and is coupled to signal PGM programming. Loading the same program on a PIC without using the bootloader PICKIT or Micro-GT pic versatile IDE, the problem disappears.

Example 2: Control of a servo signal to analog.

The second example is proposed the control of a servomotor by modeling. As in the previous example we will dive into the source, as it will be the subject of an episode of the tutorial "Let's GO PIC" and right now we need only demonstrate the capabilities of the new platform, Micro-mini Gt.

A servo motor connected to RB0 must be controlled by the position set by an analog potentiometer of 10 k is connected to RA0.

download the file. hex that manages the actuator -> mini1servo.zip

the correct assembly is visible in the picture below:

Anyone interested in having the Micro-Mini GT, only the printed circuit board or already assembled and tested with bootloaders can contact on email address ad.noctis @ gmail.com


Note: To report broken links or to submit your projects, tutorials please email to Webmaster