Posts

Showing posts from September, 2013

USB HID host (USB keyboard interfacing) with PIC32 code and schematic

Image
This post will provide a tutorial of how to interface a USB keyboard with PIC32 microcontroller as USB HID host. I called this application as Mini Computer based on PIC32 (according to definition of computer). In this example I used PIC32 USB host application on my custom designed board. The key pressed in keyboard is shown on LCD 20x4. I implemented almost every key except the functions keys and document editing keys. You may download code and schematic from the download section at the bottom of this page. I am using custom designed PIC32 I/O board in this particular example for simulating code practically. The code is written in C language using XC32 compiler and MPLAB X IDE.
In this post I assumed that you must know following if not then please read them before proceeding further:
1.How to setconfiguration bits for 32 Bit PIC microcontroller. 2.LED blinking code. 3.LCD interfacing withPIC32. 4.USB HID Host.
As mentioned above you may download code and schematic from the download sectio…

LCD interfacing with PIC32 in 8bit (code + simulation + schematic)

Image
This post will provide a tutorial of how to interface LCD 16x2 or 20x4 with PIC32 microcontroller. You may download code and schematic from the download section at the bottom of this page. I am using custom designed PIC32 I/O board in this particular example for simulating code practically. The code is written in C language using XC32 compiler and MPLAB X IDE. PIC32 is running at 80MHz on its Maximum performance.
In this post I supposed that you must know following if not then please read them before proceeding further:
1.How to setconfiguration bits for 32 Bit PIC microcontroller. 2.LED blinking code. 3.Generating precisedelay using Core Timer.
As mentioned above you may download code and schematic from the download section at the bottom of this page. I am using MPLAB X IDE, XC32 Compiler. This code is written in C Language and will work on all PIC32 (32bit microcontroller by Microchip) by slightly changing the code according to their features.
I have an external high speed crystal of 8MH…

Reverse polarity protection (reverse protection) simulation and schematic.

Image
This post will provide a tutorial of how to protect your circuit from reverse voltage (Reverse Polarity). In this post I will simulate it with details at every step to make you understand. You may download the Proteus simulation or schematic from the download section at the bottom of this page. Sometime we often put a battery inside an electronic equipment in a reverse polarity this causes it to burn. So as a good design engineer your circuit design should have a protection to maximum possible reasons that causes complete failure to your device operation. Your product should be reliable.
There are many possible ways to protect your circuit from reverse polarity. This is the simplest way to achieve protection as well as it requires least components. The benefit of using this technique is this makes your circuit working in any polarity. So you don’t need to worry about polarity just put battery in any configuration. But this circuit has one tradeoff which I will explain later in this pos…

PIC32 Perfect delay using Core Timer Code + Simulation

Image
This post will provide a tutorial of how to use Core Timer for generating precise delay in PIC32. PIC32MX architecture has a core timer having fixed clock, system frequency divided by 2. It has a separate clock (System clock/2) from the peripheral clock. It is also used to generate interrupt and has a highest priority of interrupt in PIC32. It has great importance when using it with RTOS (Real Time Operating System) for scheduling code.
This post will also make you familiar with the usage of built-in Macros in XC32 compiler. In this post I going to toggle 2 pins RB0 and RB4 two times per second. In this post I supposed that you must know following if not then please read them before proceeding further:
1.How to setconfiguration bits for 32 Bit PIC microcontroller. 2.LED blinking code.
You may download code and schematic from the download section at the bottom of this page. I am using MPLAB X IDE, XC32 Compiler. This code is written in C Language and will work on all PIC32 (32bit microcon…