Mikroe PICPLC16 V7A User manual

U S E R M A N U A L
mikroBUS™
SOCKETS
CODEGRIP
ON BOARD
POWER
RELAYS
16 16
ISOLATED
INPUTS
AMAZING
CONNECTIVITY


From day one, we at MikroElektronika are committed to changing the embedded electronics industry
through the use of industry standard hardware and software solutions.
We are excited to have the opportunity to present you the NEW generation of our flagship development
board – the P I C P L C 1 6 v 7 a !
The Ageneration of the board brings you some awesome new features. We hope that you will like it as
much as the previous one.
Use it wisely and have fun!
Thank you for being our valued customer!
Nebojsa Matic,
CEO

Time-saving embedded tools

All images shown in the manual are for illustration purpose only.
Introduction
Introduction 6
It's good to know 8
Power supply unit
Power supply 9
How to power the board? 10
Programmer/debugger
On-board programmer 11
What is the CODEGRIP? 10
Where to start? 11
Programming with icd2/icd3 12
Communication
Ethernet 13
LIN Communication 14
Connectivity
mikroBUS™sockets 15
Click boards™16
INPUT/OUTPUT group 18
Modules
Real Time Clock 19
Magnetic Buzzer 19
Relays and Octocouplers 20
Additional GNDs 21
Table of contents

INTRODUCTION
The PICPLC16 v7a development system provides a development environment for experimenting with industrial devices. With 16 opto-
inputs and 16 relays (for currents up to 16A), you can develop PIC-based industrial, home or office automation devices the easy way.
We equipped it with our revolutionary new programmer & debugger - CODEGRIP and mikroBUS™ support. We now present you with the
new version 7a that brings so much more, and we hope that you will be thrilled with your new board, just as we are.
PICPLC16 v7a offers amazing
connectivity options. Ethernet, LIN,
and pin headers for each port, you can
connect accessory boards, sensors and
your custom electronics with ease.
Powerful on-board CODEGRIP
USB-C programmer and In-Circuit
debugger will simplify programming
and debugging, whether you’re an
experienced professional or a begginer.
A CONNECTOR FOR EACH PORT EVERYTHING IS ALREADY HERE
Amazing connectivity CODEGRIP on board
Develop complex industrial, home
or office control systems with 16
optocouplers and 16 relays that
allow you to connect the MCU to high
-powered external industrial (but also
home or office) devices.
INDUSTRIAL CONTROL
Relays and
optocouplers
Just plug in your Click board, and
it’s ready to work. We picked up a
set of the most useful pins you need
for development and made a pinout
standard you will enjoy using.
FOR EASIER CONNECTIONS
mikroBUS™support
16


P A G E 8
P I C P L C 1 6 v 7 a U s e r M a n u a l
INTRODUCTION
IT'S GOOD TO KNOW!
SYSTEM SPECIFICATIONS
PACKAGE CONTAINS
AC/DC
POWER SUPPLY
7–23V AC or 9–32V DC
Damage
resistant
protective
box
User Manual &
Schematics
PICPLC16 v7a
development
board
USB
cable
POWER CONSUMPTION
~55mA
(when all on-board modules
are off)
BOARD DIMENSION
266 x 220 mm
(10.47 x 8.66 inch)
BOARD WEIGHT
490g
(1.080 lbs)
1 42 3
We present you with a complete schematics for the Hexiwear Workstation
development board - a board that is power ful, we ll or ganized, with
high-quality components, onboard programmer and debugger, and lots
more. The Hex iwear Workstation is rea dy to be your strong ally in
development. We hope you will enjoy it as much as we do.
SCHEMATIC
SCHEMATIC
U S E R M A N U A L
mikroBUS™
SOCKETS
CODEGRIP
ON B OARD
POWE R
RELAY S
16 16
ISOLATED
INPUTS
AMAZING
CONNECTIVITY
PIC18F97J60 is the on-board chip of PICPLC16 v7a. It has operating frequency up to 42 MHz, 128K bytes of flash memory,
and 4K RAM memory. It's a feature rich PIC18 Microcontroller with an integrated 10Mbps Ethernet communications peripheral.
This single-chip solution is ideal for applications requiring remote control and monitoring. Target applications include Industrial
Automation, Building Automation, Home control, Security and Instrumentation.
PIC18F97J60 is the on-board microcontroller!

P I C P L C 1 6 v 7 a U s e r M a n u a l
P A G E 9
POWER
SUPPLY
POWER SUPPLY
The PICPLC16 v7a development system is connected to the power
supply source via the TB1 connector. The power supply voltage
can be either DC or AC. A DC power supply voltage can be in the
range of 9V to 32V, whereas the AC power supply voltage can
range between 7V and 23V. Have in mind that the board cannot
operate without being connected to the power supply source
although it is connected to a PC via the USB cable.
On-board is a very accurate, programmable voltage reference
(VREF) in the range from 0V to 3.3V. VREF is very useful for
many different applications including A/D and D/A converters,
comparators, etc. The programmable voltage output can be
controlled over the CODEGRIP Suite.
Figure 1: Power
supply unit of
PICPLC16 v7a
P A G E 9
The voltage supervisor device, MCP1320T from Microchip, keep a
microcontroller in reset until the system voltage has reached and
stabilized at the proper level of stabilized for reliable system operation.
MCP1320T also provides an external Watchdog Timer functionality,
to monitor the operation of the system. WDT period is 1.6s, an edge
transition on the WDI

P A G E 10
P I C P L C 1 6 v 7 a U s e r M a n u a l
POWER SUPPLY
HOW TO POWER THE BOARD?
STEP 1 STEP 2
POWER SUPPLY:
Via screw terminal (7V to 23V AC or
9V to 32V DC)
POWER CAPACITY:
Up to 500mA with USB, and
up to 600mA with external
power supply
Figure 3: Powered by wall-adapter
Figure 2: Powered by laboratory PSU
The PICPLC16 v7a development board is powered with
external power supply source. Make sure the power supply
source is connected. Otherwise, the on-board programmer
cannot be enabled.
To power the board using screw
terminals, screw-on the cables
in the screw terminals as shown
on image Figure 2, and turn the
power switch ON.
When the development system
is connected to the power
supply source, it is necessary
to plug in a USB cable into
the on-board USB connector.
Connection between the USB
cable and the development
system makes the on-board
programmer to be connected
to a PC.

P I C P L C 1 6 v 7 a U s e r M a n u a l
P A G E 11
ON BOARD PROGRAMMER
PROGRAMMING
WHAT IS CODEGRIP?
WHERE TO START?
CODEGRIP is a unified solution, designed to perform programming and
debugging tasks on a range of different microcontroller devices (MCUs)
based on the Microchip PIC architecture. The USB-C connector offers
improved performance and reliability, compared to traditionally used
USB Type A/B connectors.
PICPLC16 v7a development board is supported by a powerful CODEGRIP
Suite, offering complete control over the development board. It is used
to intelligently manage programming and debugging tasks, and to
configure various other options and settings, providing visual feedback
through its clean and comprehensive Graphical User Interface (GUI).
To better understand how to operate and configure PICPLC16 v7
development board and its integrated CODEGRIP module, check out the
CODEGRIP Suite quick start guide on the www.mikroe.com/picplc16-v7a
In order to start using CODEGRIP and program your
microcontroller, you just have to follow two simple steps:
1. Install the necessary software
∫ Install CODEGRIP Suite software
2. Power up the board, and you are ready to go!
∫ Plug in the programmer USB cable
∫ LINK LED should light up.
Why so many LEDs?
Three LEDs indicate specific programmer operation. Link LED lights up when
USB link is established with your PC, Active LED lights up when programmer is
active. Data is on when data is being transferred between the programmer and
PC software. (Compiler or CODEGRIP).
Figure 4: CODEGRIP on board programmer

P A G E 12
P I C P L C 1 6 v 7 a U s e r M a n u a l
Figure 5: RJ-12 connector view
PICPLC 16 v7a is equipped with RJ-12 connector compatible with
Microchip®ICD2, ICD3, and ICD4 external programmers. You can either
use the on-board CODEGRIP programmer or external programming
tools as long as you use only one of them in the same time. Insert
your ICD programmer cable into connector CN9, as shown in image.
PROGRAMMING WITH ICD2/ICD3/ICD4
PROGRAMMING
ONBOARD (up): Interface is enabled. If an external debugger
probe-device is connected, there is a possible collision in
communication.
EXTERNAL (down): Interface is disabled. External debugger
probe-device can reliably communicate with target MCU.
The DIP switch located next to the RJ-12 connector allows control of
the interface between onboard CODEGRIP module and target MCU:

P I C P L C 1 6 v 7 a U s e r M a n u a l
P A G E 13
ETHERNET
Ethernet is a popular networking technology for local area networks
(LAN). Systems communicating over Ethernet divide a stream of data
into individual packets, known as frames. Each frame contains source
and destination addresses and error-checking data so that damaged
data can be detected and re-transmitted. This makes the Ethernet
protocol very popular for communication over longer distances or in
noisy environments.
The PICPLC16 v7a features standard RJ-45 Ethernet connector to
establish a connection with a personal computer, network router,
or other Ethernet network device. PIC18F97J60 MCU feature
an embedded Ethernet controller module. This is a complete
connectivity solution, including full implementations of both Media
Access Control (MAC) and Physical Layer (PHY) transceiver modules.
COMMUNICATION

P A G E 14
P I C P L C 1 6 v 7 a U s e r M a n u a l
LIN COMMUNICATION
LIN (Local Interconnect Network) is a inexpensive serial network protocol used for communication between components in
vehicles, It effectively supports remote application within a car's network. The LIN Bus is particularly intended for mechatronic
nodes in distributed automotive applications, but is equally suited to industrial applications.
The PICPLC16 v7a utilizes the MCP2003B, it provides a physical
interface to automotive and industrial LIN systems, in accordance to
the LIN Bus Specifications Revision 2.2, SAE J2602 and ISO 17987. It
is short circuit and overtemperature protected by internal circuitry.
MCP2003B communicates with the target board MCU through the
UART interface (RXD, TXD), with additional functionality provided by
the CS and WAKE pins.
COMMUNICATION
∫ SW16.1 (TX)
ON (up): connects the RG1 pin to the transmit data input
OFF (down): disconnects the RG1 pin from the transmit data input
∫ SW16.2 (RX)
ON (up): connects the RG2 pin to receive data output
OFF (down): disconnects the RG2 pin from the receive data output
∫ SW16.3 (CS)
ON (up): connects the RJ0 pin to the chip select input
OFF (down): disconnects the RJ0 pin from the chip select input
∫ SW16.4 (WK)
ON (up): connects the RJ1 pin to the wake up input
OFF (down): disconnects the RJ1 pin from the wake up input
A four-pole DIP switch (SW16) located in the LIN COMM. section of the board, allow fully independent control of the UART RX and TX lines,
and CS and WAKE lines.
Figure 7: LIN Communication view

P I C P L C 1 6 v 7 a U s e r M a n u a l
P A G E 15
mikroBUS™SOCKETS
The superior connectivity features of the EasyPIC v7a development board
are rounded up with three standardized mikroBUS™host connectors. It is
a considerable upgrade for the board, as it allows interfacing with the vast
amount of Click boards™.
mikroBUS™is the add-on board standard that offers maximum
expandability with the smallest number of pins. More information at www.
mikroe.com/mikrobus
All the mikroBUS™sockets are now redesigned and improved. They
became much sturdier, allowing a better grip of the Click board™. In
addition to added horizontal supports between two 8-pin connectors,
the right lower edge is chamfered at the angle of 45°, the same as the
Click board™, making it seamlessly fit into the mikroBUS™socket. The
new mikroBUS™socket is now a fully-fledged, standardized monolithic
component with all its pins clearly labeled, offering very good grip for the
Click board™, preventing it to flip over or to be placed incorrectly.
mikroBUS™is not made to be only a part of our development boards.
You can freely place mikroBUS™host connectors in your final PCB
designs, as long as you clearly mark them with mikroBUS™logo and
footprint specifications. For more information, logo artwork and
PCB files visit our website:
www.mikroe.com/mikrobus
Integrate mikroBUS™in your design
mikroBUS™ SOCKET IN DETAIL
Analog pin – AN
Reset pin – RST
SPI Chip Select line – CS
SPI Clock line – SCK
SPI Slave Output line – MISO
SPI Slave Input line – MOSI
VCC-3.3V power line – +3.3V
Reference Ground – GND
PWM - PWM output line
INT - Hardware Interrupt line
RX - UART Receive line
TX - UART Transmit line
SCL - I2C Clock line
SDA - I2C Data line
+5V - VCC-5V power line
GND - Reference Ground
CONNECTIVITY
P A G E 15
The mikroBUS™socket supports the following communication interfaces: SPI,
UART, and I2C. There are also single pins reserved for PWM, Interrupt, Analog
input, Reset, and SPI Chip Select. The mikroBUS™socket also contains pins with
the two power rails (3.3V and 5V), along with the GND pins.

P A G E 16
P I C P L C 1 6 v 7 a U s e r M a n u a l
CONNECTIVITY
Click Boards™
THE LARGEST AND FASTEST-GROWING BASE OF
ADD-ON BOARDS IN THE WORLD!
Click boards™are standardized add-on boards that carry a variety of different
electronic devices. They are designed to perfectly fit the mikroBUS™socket.
Engineered to deliver the best performances for the used components, they save
developers of testing and troubleshooting often associated with the prototyping
phase. They enhance rapid development and accelerate time to market. These ready-
to-use boards require no additional hardware configuration. More information at
www.mikroe.com/click
CODE EXAMPLES
It's easy to get your Click board™
up and running. We provided
the examples for mikroC,
mikroBasic and mikroPascal
compilers on our Libstock
community website. Just
download them and you are
ready to start:
www.libstock.mikroe.com


P A G E 18
P I C P L C 1 6 v 7 a U s e r M a n u a l
CONNECTIVITY
INPUT/OUTPUT GROUP
EVERYTHING IS GROUPED TOGETHER
There are eight PORTs on the PICPLC16 v7a development board, labeled from PORTA
to PORTH. The PORTs are located along the right side of the board, each containing a
an eight-pole DIP switch, and a single 2x5 pin header with the standard 2.54mm pitch.
The PORTs are labeled according to the MCU PORT they are routed to, and they add so
much to the connectivity potential of the There are eight PORTs on the PICPLC16 v7a
development board, labeled from PORTA to PORTH. The PORTs are located along the
right side of the board, each containing a an eight-pole DIP switch, and a single 2x5
pin header with the standard 2.54mm pitch. The PORTs are labeled according to the
MCU PORT they are routed to, and they add so much to the connectivity potential of
the board.
CONNECTIVITY
TRI-STATE DIP SWITCHES
Tri-state DIP switches are used to enable 4K7 pull-up or pull-down resistor on
any desired port pin. Each of these switches has three states:
Figure 9:
Tri-state DIP
switch on
PORTB
Figure 8: Input/Output group
1. MIDDLE POSITION disables
both pull-up and pull-down feature
from the PORT pin
2. UP POSITION connects the
resistor in pull-up state to the selected
pin
3. DOWN POSITION connects
the resistor in pull-down state to the
selected PORT pin.
I/O pins of MCU are internally grouped as PORTs. The same grouping concept is kept throughout the development board as
well, offering a clean and organized user interface.

P I C P L C 1 6 v 7 a U s e r M a n u a l
P A G E 19 MODULES
A real-time clock is widely used in alarm devices, industrial controllers, consumer devices etc. An external real-time clock
peripheral module (RTC) in combination with the button cell battery allow continuous tracking of time, even if the main
power supply is OFF. Extremely low power consumption of the RTC peripheral allows these batteries to last very long.
Figure 10: Real Time Clock view
Figure 11: Buzzer view
Real-Time Clock (RTC)
The main features of the built-in real-time clock MCP79411 from
Microchip are:
¬ Providing information on seconds, minutes, hours, days in a week and
dates including correction for a leap year
¬ I2C serial interface
¬ Automatic power-fail detection
¬ Power consumption around 900nA
A buzzer is a simple device capable of reproducing sound. It is driven by
a small pre-biased transistor. The buzzer can be driven by applying a
PWM signal from the MCU at the base of the transistor: the pitch of the
sound depends on the frequency of the PWM signal, while the volume can
be controlled by changing its duty cycle. Since it is very easy to program,
it can be very useful for simple alarms, notifications, and other types of
simple sound signalization.
MAGNETIC BUZZER

P A G E 20
P I C P L C 1 6 v 7 a U s e r M a n u a l
MODULES
RELAYS AND OPTOCOUPLERS
Industrial devices usually utilize more power than the
microcontroller can provide via its I/O ports. To enable
the microcontroller to be connected to such devices, the
development system is provided with 16 relays by means of
which it is possible to provide up to 250V/16A power supply.
Each relay has one normally-open (W0, W1...) and one normally-
closed (NW0, NW1...) contact. Sixteen relays are divided in four
groups each consisting of four relays. Relays of one group are
connected to one common contact. Accordingly, there are
COMA, COMB, COMC and COMD common contacts.
In addition to relays, the development system also features
optocouplers, the function of which is to galvanically isolate
signals brought to the microcontroller inputs from industrial
devices. Isolated digital inputs are designed specifically as
digital input receivers for programmable logic control (PLC),
motor control and grid applications to interface between
field-side inputs and a host controller. Input voltage is 5V,
and optocouplers are also linked to one common connector
OCVCC.
Figure 12: Relay Control view Figure 12: Isolated Input view
Two eight-pole DIP switches marked as SW4
and SW5 are used to connect the MCU pins to
the relay control circuitry:
EIGHT-POLE DIP SWITCHES
Two eight-pole DIP switches marked as SW2 and
SW3 are used to connect the MCU pins to the
optocoupler circuitry:
ON(right): MCU pins are
connected to the relay control
circuitry
OFF(left): MCU pins are not
connected to the relay control
circuitry
ON(right): MCU pins are
connected to the optocoupler
circuitry
OFF(left): MCU pins are not
connected to the optocoupler
circuitry
Table of contents
Other Mikroe Microcontroller manuals