Tips




General Tips (P12, P16, P18, P24)

Name Short description
MicroSD Card Proto BoardPinning new Pinning of the MikroElektronika MicroSD Card Proto board.
PicKit2 usage from within the compiler's IDE. new PicKit2 programmer (MicroChip) usage from within the mE compiler's IDE.
Janni's website. Replacement libraries, mP PRO quirks, Tips and Tricks and Assembly Syntax
Pitfalls in PIC usage and mikroPascal. List of pitfalls that can be encountered using PIC's and mP (list is not exhausting...).
SPI Modes and Timing Explanation about the SPI modes and defining the mode parameters for SPI.
Automated Compiling of libraries in mikroPascal. Compiling libraries with dummy projects in batch files.
Tips and Tricks (Microchip) Compiled Tips N Tricks Guide from Microchip.
Tips and tricks Low Power (MC) PIC Microcontroller Low Power Tips n Tricks frim Microchip.
Which is better: Triac or Relay? Discussions about using triacs versus relays for switching mains loads.
Trouble with minimising the IDE. In case one can not minimise the IDE, simply goto the mP icon on the taskbar and play a little but with "Restore" and "Minimize"to make minimisation of the IDE work again. Also editing the ShowCmd line in the settings.ini: set it to 1 instead of 2 may help.
Simple Touch Detector. Tip from joseLB: This small code snippet is detecting touches.
The circuit is just a PIC alone in EP3, pull ups off, and no matter board leds for port A are on or off.
Remote Control Repeater. Tip from joseLB: Here is a TV, video, etc. remote control repeater Pascal code. It just get the signal arrived from up to 4 sources (4 places where you can put a TSOP receiver).
USB Switch. Tip from joseLB: This is a very simple USB 2.0 switch. With it you can switch a USB device betwen 2 PC's. Tested with penDrives of 1,2,4,16Gb, Vista, XP, USB1.0, USB 2.0.
20KWatts AC swithing. Tip from joseLB: The need was needing to switch on/off trifasic power up to 30Amps/phase, 220V~ = ~11KVA. Switching should be done even when there is no power supplied....
5V Switched Mode Power Supply. In applications with e.g. a PIC, an SD/MMC card reader, an Ethernet interface based on the ENC28J60 and an RS232 interface based on the Max232, the current drawn from the 5V power stabiliser becomes rather high. A heat sink is required for the stabiliser IC (usually an 7805, fed from an transformer via a bridge rectifier and a buffer elco). Things get worse if more components are added to the circuit: the heatsink must become bigger and bigger. Of course one can take a number of mesures to make the input voltage of the 7805 as low as possible (but not too low: stabilisation must still be possible), but even then the dissipation problem persists.
This circuit poses a solution to that problem. Details.
SPI problem and MicroChip Do NOT try to use the "SS" pin (SPI Slave Select) as digital input or output while using the SPI master mode.
In the MSSP engine there is (at least in some PIC's like the P18F2620) a silicon problem, making an SS pin change destroy SPI data.
Solution: set the SS pin (RA5 in the P18F2620) to output and never change its value.
SD/MMC QuickFormat for more than 512 files How to format an SD/MMC card in FAT 16 for more than 512 root directory entries.
Since the mmc_Fat_... routines only make use of the root directory, all files must be in it. As the number of root directory entries in Fat16 is defined during formatting (and thus fixed during usage of the SD/MMC card) and set to 512 by "mmc_Fat_Quickformat", this can cause a problem.
This piece of code allows to to format the card to have more than 512 entries/files in the root directory.
DumpBuffer.mpas How to dump the content of a byte array to the Uart, both hex and Ascii. Output example
"One transistor" switch. A digital switch consisting of only one transistor and 2 resistors.
RS232 to PIC interface RS232 interface based on discrete components. Only 1 RX and 1 TX line (but can be extended of course).
The "positive" Rs232 voltage is only 5V, but for most PC's that is no problem.
Using Leds, Buttons and Relays Tips about Leds, buttons and relays.
Creating multiple "software" timers in your program. Sometimes a (high) number of different timed activities has to be performed, e.g. creation of timeouts for expected events.
Since the number of timers in a PIC is limited, the trick is to use one hardware timer and derive a number of SW timers from it.
Orher related items (more advanced) are : TimeBase, simple time measurement. and Cooperative Operating System.
Creating a "Timebase" in your program. All about handling activities based on a "Timebase".
Orher related items (more advanced) are : TimeBase, simple time measurement. and Cooperative Operating System.
I2c in mikroPascal Gives a short overview about I2c and how to use it in mP.
X24Cxx (External Eeprom) addressing Gives the device write/read adresses for X24C02 .. X24C16
Ethernet Tips. Information about accessing Ethernet from a PIC:
- hardware configurations
- Ethernet libraries
- general tips regarding PIC's and Ethernet
RTC_Board_Pinning Pinning of the MikroElektronika Real Time Clock board.
USB PCB Connector Pinning
and wire colors.
Pinning of USB A and B PCB connectors, copper side.
Clock settings for USB devices
How to set the configuration words etc.. to set the correct USB and CPU clock speeds. For the PIC18F2455/2550/4455/4550 family.
See also mE.
PIC USB related web sites (Microchip)
Links to PIC USB related websites on the Microchip forum.

Top

Tips Specific for PIC24

Name Short description
Pitfalls in PIC24 usage and "mikroPascal for dsPIC30/33 and PIC24" List of pitfalls that can be encountered using PIC24's and mP (list is not exhausting...).

Top

Tips Specific for mP for PIC32, MMB MX4 and VTFT

Name Short description
PIC32 Interrupts, articlenew Knowledge about interrupts in the PIC32.
Moving to the PIC32 familynew List of difficulties that can be encountered when moving to the PIC32 family from a lower PIC family (P18/P24/dsPIC/...).
Pitfalls and tricks in mP for PIC32, MMB MX4 and VTFT List of pitfalls and tricks that can be encountered using mp for PIC32, MMB MX4 and VTFT (list is not exhausting...). Author: piort.

Top

Guides, templates and examples for VTFT

Name Short description
VTFT Guides published by Megahurts

Visual TFT Event Counter Example Tutorial manual

Event Counter Tutorial manual

V-TFT Button State Management Tutorial new


About the Author Biography.
Templates
  • New2V-TFT Project Template for User Code Tutorial and example Event Counter.
    A project for new V-TFT users with tutorial manual and extensive code comments showing how the V-TFT project program template works. Get users safely placing code where it will work. V-TFT TIPS n TRICKS. Custom Digit display gadget. How to add 2 click safety 2 buttons. MORE. mBASIC code. PIC32/33EP MMB sources/HEX. PDF manual V2.2.2
    Libstock
    download for dsPIC
    download for PIC32

Projects
  • V-TFT + PIC32mmB + mmWorkStationV7 + Click-ADC Example Project.
    V-TFT and mmB PIC32 in mmWSv7 and a Click 4-ch ADC board plugged into socket-1. This V-TFT project gives you control over which channels are active and read and averaging of their inputs from ADC unit. The Basic code files have extended commenting. Blog has pdf tutorials for V-TFT beginners example project. Version is 2.2.2 11-12-2013
    Libstock
    download for PIC32

  • My Button-as-a-Label method Examples Demo.
    Demo V-TFT project for PIC32 MMB that shows code examples about using V-TFT Button objects instead of Label objects to display changing alpha-numeric data on a TFT display. Projects code files contain detailed comments for every code example and program operation so everyone (beginners +), can follow and understand what is being done and why.
    Libstock
    download for PIC32

  • PIC32 MMB TP Calibration Utility.
    A Visual-TFT project that helps you calibrate your MMB touch panels settings for finding the proper values for constants for your own projects. Includes detailed instructions in a Read-Me text file and pdf Users guide.
    Libstock
    download for PIC32

  • Random Draw Team Doubles.
    A MMB-PIC32 3 screen application to manage up to 16 player database for randomly creating 2 person teams for Sport or Game activities like FoosBall, Darts, BasketBall ect... Includes Visual-TFT and mBASIC for PIC32 source codes and Hex file to load on MMB. Detailed comments in main program module explains operation.
    Libstock
    download for PIC32

Top