PIC18F Hands-on Workshop with PTK40A

We have been using PTK40A for PIC Microcontroller workshop since it is launched in 2010. With it, we have 3 different PIC Workshop, Module 1, 2 and Advance. All these workshops use the famous Mid-Range PIC microcontroller – PIC16F877A. Frankly, PIC16F877A is pretty mature PIC microcontroller as it has been around for more than 20 years J

Last year, we received feedback and inquiries to adopt PIC18F into PTK40A and also the workshops. Sure! After 1 year of preparation and choosing famous model of PIC18F, we are ready to upgrade the PIC workshops to PIC18F and we will be using PIC18F4550 and PIC18F4520.


Currently, we will be launching PIC18F Microcontroller Hands-on Workshop module 1 and 2, we are working on module advance. Allow me to talk about PIC18F vs PIC16F generally and why we choose PIC18F4550. Do check out our training calendar here.

PIC16F vs PIC18F:

  • PIC18F can run up to 48MHz while PIC16F (conventional) can only run up to maximum of 20MHz
  • PIC18F has up to 32Kbytes (18F4550 and 4520) while PIC16F (conventional) has only 14Kbytes
  • PIC18F has more RAM (data memory) compared to PIC16F
  • PIC18F offers better ADC module compared to PIC16F
  • PIC18F may have more special peripherals such as USB, CAN, ECCP, EUSART, etc compared to PIC16F (conventional)

So can PTK40A support PIC18F, yes and no. Yes, which is good because when Microchip design PIC18F, they made the microcontroller to be pin to pin compatible with PIC16F, as far as I know, 40-pin, 28-pin are compatible. It is good because you can simply change the PIC16F on PTK40A with another 40-pins PIC18F and it works, at least the circuit is correct, what we need to focus is the program. No, not all peripheral pins are compatible. On PTK40A, the SPI and I2C is designed for PIC16F877A, PIC16F887, PIC18F4520, not for PIC18F4550. Because on PIC18F4550, with additional USB peripheral, the MSSP (Master Synchronous Serial Port) that I2C and SPI pins are being shifted to other pins.

That is one of the reasons why we choose PIC18F4550 and PIC18F4520 to be on PTK40A. Most of the exercises are developed based on PIC18F4550 as it comes with USB and with this; we have choice to use USB Bootloader. Only when in I2C and SPI exercises, we will change to PIC18F4520. Anyway, all other examples and libraries are designed for both models of PIC18F.

MPLAB X IDE


Besides the upgrade of PIC18F, now PTK40A comes with MPLAB X IDE installer and also the exercises and examples is developed in MPLAB X IDE (in CD/DVD). Check out the user friendly features offered by this IDE:

[youtube]http://www.youtube.com/watch?v=6FNKJSWuaJE[/youtube]


Not to forget we have also now using the new compiler, MPLAB XC8 for this workshop.


Is there any restriction on the PTK40A with this upgrade? No, not at all, in fact, PTK40A comes with the features of:

  • Build in USB PIC Programmer that is compatible with PICkit2. Using it with MPLAB X IDE will be easy as it is 1 click to compiler and load program into the PIC on PTK40A. No additional 3rd party software is needed to load program.
  • You can always change it back to PIC16F877A, and we include three PIC models in PTK40A.
  • Changeable Crystal, we are still using 20MHz.
  • 2 digit of 7-segment
  • 2×16 Parallel LCD
  • 4×4 Keypad
  • DS1307 as I2C communication example
  • External EEPROM for SPI communication
  • 32.768KHz Crystal as Real Time Clock interrupt
  • Connector ready for UC00A, UART communication to PC’s USB
  • Connector reader for Cytron’s SKPS, SKKCA, SKXBee
  • Standard RC Servo, C17S
  • Stepper motor which can be driven with unipolar or bipolar method
  • Relay to control external device such as magnetic lock
  • SPG10 DC motor with rotary encoder feedback
  • Output pin is connected to LED as indicator
  • ADC input which offers reading of on board variable resistor, external analog sensor and temperature sensor, LM35
  • Buzzer for sound indication
  • External digital input connector
  • 1 reset button
  • 3 programmable push buttons
  • All pin of PIC is extended out on turn pin for experiment purpose
  • USB, is supported with PIC18F4550.
  • Single power supply for all on board experiments, including DC brush motor and stepper motor
  • Suitable for laboratory experiment works

Let’s talk about the workshops. Though it is upgraded to PIC18F, we will still be following most of the syllabus from previous workshops: All these workshops will take 3 days each and every participant brings back a PTK40A home after the workshop.


  • Module 1: We will be introduced to PIC18F’s architecture, discuss about the development tools which include the MPLAB X IDE and programmer. Basic circuit for your own development will also be discovered. Then we will start with the real hands-on:
    • Lab 0, where we have overview of the features and hardware of PTK40A, install MPLAB X IDE and the XC8 C compiler, and then we will continue with basic digital input and output of PIC, also the 1st project of your own. Compile and download your code into PTK40A.
    • Lab 1: Parallel interface 2×16 character LCD, this is the most common and popular display device in embedded system. The circuit/interface will be elaborated and with the help of code development, the understanding is strengthened.
    • Lab 2: DC Brushed Motor, as the name shows, we are going to learn how to control DC brush motor from PIC. This lab will include the new peripheral – PWM (Pulse Width Modulation). Again, I always start with circuit/interface explanation.
    • Lab 3: Stepper motor, another type of DC motor – Stepper motor is another type of popular motor being used in most of open loop position or speed control system such as 3D printer and antenna direction adjustment.
    • Lab 4: RC Servo motor. Yes, another type of DC motor. RC Servo is not a standard industry motor, but it is quite popular and low cost motor for students, armatures and hobbyist.

  • Module 2: We will be introduced to PIC18F’s architecture, discussed about the development tools which include the MPLAB X IDE and programmer. Basic circuit for your own development will also be discovered. Then we will start with the real hands-on:
    • Lab 0, where we have overview of the features and hardware of PTK40A, install MPLAB X IDE and the XC8 C compiler, and then we will continue with basic digital input and output of PIC, also the 1st project of your own. Compile and download your code into PTK40A.
    • Lab 1: Analog to Digital Conversion, ADC. We will explore about ADC in this lab. Besides the configuration of the ADC in PIC, we then develop code for the actual hardware to read analog voltage, and also an actual sensor, the LM35. Finally convert the value into temperature.
    • Lab 2: 4 x 4 Matrix keypad. Matrix keypad is a good device that allows us to learn multiplexing between inputs and output.
    • Lab 3: Password Door Security. In this lab, we will learn the integration of keypad, LCD, LED, buzzer, also relay to control a door lock, by using program. At the end of lab, you get yourself a password door security that you can build for your office J
    • Lab 4: Bonus lab – UART. Universal Asynchronous Receiver and Transmitter, a mature yet popular serial communication standard between microcontrollers, sensors, controllers. Yes, we will be learning about it and there is lab for it too.


  • Module 3 (Advance): We are yet ready with module advance for PIC18F but the syllabus will be as described here. We will be introduced to PIC18F’s architecture, discussed about the development tools which include the MPLAB X IDE and programmer. Basic circuit for your own development will also be discovered. Then we will start with the real hands-on:
    • Lab 0, where we have overview of the features and hardware of PTK40A, install MPLAB X IDE and the XC8 C compiler, and then we will continue with basic digital input and output of PIC, also the 1st project of your own. Compile and download your code into PTK40A.
    • Lab 1: Interrupt and timer 1. In advance module, the 1st actual lab will discuss about interrupt and how to utilize it in one of the peripherals – Timer 1. We will talk about the theoretical operation on both the interrupt and timer 1, also finally, creating a real time clock with timer 1.
    • Lab 2: I2C – Inter IC communication. One master and multiple slaves communication. Under the MSSP peripheral in PIC, I2C is one of synchronous serial communication standard. Again, we will discover the theoretical operation and develop actual code for communication with DS1307 real time clock, configuration and also reading the information.
    • Lab 3: SPI – Serial Peripheral Interface. Another synchronous serial communication, mostly being used for high speed commination such as SD card or MP3 decoder, etc. Besides exploring the operation, we will develop the code for communication with external EEPROM via SPI.
    • Lab 4: UART, another UART lab where we will communicate with interesting device, the SKPS. We will have with SONY PS2 dual controller joystick.

Currently, we are launching the 1st PIC18F Microcontroller Hands-on Workshop at Penang Science Café, Krystal point, Bayan Lepas, Penang. There is early bird discount, please get yourself registered and pay by 22nd July to enjoy the discount.



Buy

, , , ,

Related Post

Simple steps to control Stepper Motor using 2Amp Motor Driver Shield and CIKU

PIC16F VS PIC18F:Analysis of PIC Mid-Range 8 bit family and Advanced 8-bits Family

Cytron as Nuvoton Training Partner

USB (Universal Serial Bus)

Leave a Reply

Your email address will not be published. Required fields are marked *