Today, I will show you a development board from Microchip that I will use in
programming lessons on eight-bit PIC microcontrollers. This board is called
Curiosity HPC
and has part number DM164136. At TME, where I usually shop, Curiosity HPC
costs around $65 plus VAT. Microchip boards have always been expensive. When I
selected this board, I looked for a compromise between the ability to develop
complex projects and the price I would have to pay.
Curiosity HPC
allows the development of projects with eight-bit PIC microcontrollers in 28-
or 40-pin packages. I will use the second hardware version of this board in my
projects. This hardware version comes with a current limiting circuit that can
be drawn from the USB port. This limiting circuit is absent in the first
version of the board.
Therefore, I recommend you avoid the old version because there is a higher chance of damaging the USB port if you make a mistake and cause a short circuit. The second significant improvement over the first version of the board is the implementation of a USB-to-serial converter, which allows us to connect to the board with a program like TeraTerm.
Old version (Rev 1) of Curiosity HPC. |
The programmer side: PKOB4 and power circuits
I'll start introducing the board by going from left to right, and we see two
different areas of this board. On the left side, we have the PKOB4 (PicKit On
Board 4) programmer, a simplified version of the PICKIT4 programmer. Also, on
the left side, we have the power circuits, and we notice that this board can
only be powered from the USB port. The maximum current that can be drawn from
the USB port is limited by a MIC2042 integrated circuit.
If we
study the schematic of the
Curiosity HPC
board and the
MIC2042
datasheet, we can calculate the current limit at 840mA. Given that the MIC2042
has a 20% tolerance, the current limit can vary from board to board in the
range of 650mA to 1.03A.
These values exceed the limits set by
standards for USB1 and USB 2.0, and only USB3 ports can deliver such high
currents.
The same MIC2042 circuitry also monitors the supply
voltage and generates a Power Good signal, which is sent to the
microcontroller in the PKOB4. The development board will operate correctly if
the supply voltage is above 4.4 V and will be stopped if the supply voltage
drops below 4.1 V.
All these protections should ensure we don't
destroy the USB port if we make the wrong connections and have a short
circuit. However, the practice has often shown me that the protections aren't
fast enough to protect the USB ports, and, like with the Arduino boards, I
recommend using a separately powered USB hub between the PC and the board.
That way, in case of problems, it's preferable to damage a cheap USB hub
instead of destroying the USB ports in the computer.
Also, in the programmer area, we have the reset button. It is connected to the microcontroller in the programmer, so pressing the button will reset both microcontrollers. Here, we also find two LEDs used to display various error codes.
Next, we see the white line separating the programmer area from the area dedicated to the microcontroller we will be programming. Supply voltages and the ground cross this line. Also, we have the signals needed to program the microcontroller and the serial port. The signals for programming are PGD or Program Data, PGC or Program Clock, and /MCLR or Memory Clear or Reset. /MCLR is a pin with multiple functionalities to reset and switch the microcontroller to programming mode.
Curiosity HPC uses only LVP or "Low-Voltage Programming", which allows the microcontroller to be programmed using the VDD supply voltage.
Note here that all new PIC microcontrollers come with LVP active. We cannot exit LVP mode as long as we use LVP programming. To get the microcontroller out of LVP mode, we need a programmer that uses HVP, or High Voltage Programming. This way, we can't make a mistake and end up with a microcontroller that can no longer be programmed.
The two serial port lines are marked RX and TX. After loading the program into the microcontroller's memory, the programmer acts as a USB-to-serial converter.
The microcontroller side
On the right side of the board, we will find the microcontroller that we will
program and use in all the programming lessons.
The board I'm
using came equipped with a
PIC18F47Q10, a microcontroller based on the PIC18 core, with 83 instructions and 31
stack levels. The internal oscillator can be configured up to a frequency of
64 MHz. PIC microcontrollers need four clock cycles to execute an
instruction.
Memory includes 128 KB FLASH memory for storing code,
3728 bits of SRAM memory, and 1024 bytes of EEPROM memory.
Among
the peripherals I will mention here:
- 10-bit resolution analog-to-digital converter
- Two I2C/SPI communication ports
- Two EUSART ports
- 5-bit resolution digital-to-analog converter
- Two comparators
- Two 10-bit resolution PWM ports
- Three 8-bit resolution timers
- Four 16-bit resolution timers
The PIC18F47Q10 microcontroller is part of the new generation of PIC
microcontrollers equipped with Peripheral Pin Select.
PPS allows
for a flexible allocation of digital I/O peripheral pins to the physical pins
of the microcontroller. In older 8-bit devices, a peripheral was assigned to a
specific pin (example: PWM1 output on pin RC5). PPS gives the developer a
broader basis for selecting the output and input pins to which a peripheral
can be connected.
In addition to the microcontroller provided with
the board, in a 40-pin package, we also have the option of using 28-pin PIC
microcontrollers. Inside the 40-pin socket, we find a second 28-pin socket.
I'll show you the picture because removing the microcontroller from the board
and inserting it back in without bending or breaking a pin is difficult.
When we use microcontrollers in a 28-pin package, we won't be able
to take advantage of all the features offered by the Curiosity HPC board.
Also,
in this area of the board, we find a potentiometer, two buttons, and four
LEDs. One can deactivate them by removing these little solder blobs.
The
Curiosity HPC board comes with two mikroBUS sockets, an open standard
developed by the Serbian company MikroElektronika for their extension modules,
called Click boards (TM). These modules have been designed to offer SPI, I2C,
UART, PWM, ADC, reset, interrupt, and power (3.3V and 5V) for the extension
modules in a small footprint.
More than a thousand Click board
modules are currently available, performing various functions. I use these
kinds of modules a lot, and I'm a big fan of the mikroBUS system, especially
as I can use adapters to use Click modules on Arduino and other
development systems I work with. Thus, I have a unified system of extension
modules.
For those who have sensors from other manufacturers, there
are two modules in the Click boards range with connectors from which we can
run cables to our modules. One is with pins; the other has terminal blocks for
wires. There is also a Proto Click, which we can use as an adapter for various
small modules.
Click boards to expand the connectivity of Curiosity HPC |
For those who want to avoid using mikroBUS modules, there is the option of
using the two extension connectors located next to the microcontroller. From
where we can run wires to a breadboard on which we develop our projects. By
their nature, these breadboards are intended for building non-permanent
projects. Suppose we want to achieve a permanent assembly. In that case, there
are prototype development boards with a similar layout of connections as
breadboards, so we can use such boards and make permanent connections for our
project.
To make working with this board easier, I have prepared a
pinout where I have shown the PIC18F47Q10 microcontroller. I have drawn its
capsule and shown how each pin connects to the various elements on the
Curiosity HPC board and the mikroBUS sockets. I used yellow for the elements
on the Curiosity board, pink for the connections to the programmer, green for
the connections to the first mikroBUS socket, and purple for the second one.
As you can see, several elements share some pins. In certain
instances, like with I2C and SPI interfaces, this overlapping is not
problematic. However, a conflict arises between serial communication with a PC
and serial communication with the first mikroBUS module. To mitigate this
issue, one viable strategy is to refrain from inserting modules that require
serial communication into the first mikroBUS socket.
I'd like to add a note on the terminology for SPI pin labeling. Initially, SPI
signals were known as MISO (Master In Slave Out), MOSI (Master Out Slave In),
SCK (the clock signal), and CS (Chip Select). However, due to the politically
sensitive and dehumanizing nature of the terms "master" and "slave," these
have been
updated. The terminology has shifted to "controller" in place of "master" and
"peripheral" replacing "slave." Accordingly, the pin labels have also been
revised to COPI (Controller Out Peripheral In) and CIPO (Controller In
Peripheral Out), reflecting this change.
In my context, thankfully, slavery is a historical concept encountered only through literature. I don't have a direct personal connection with the terminology discussed. I have to say, though, I'm not too fond of the new terminology because it creates confusion.
While I'm open to adopting the term "controller," the distinction between
"peripheral" in one communication protocol and "target" in another, despite
referring to similar concepts, seems problematic. The challenge is compounded
by the extensive legacy of articles, documentation, and educational materials
that utilize the traditional terminology. Additionally, the transition poses
practical difficulties, particularly when interfacing older development
boards, which use MOSI/MISO labels, with newer ones adopting COPI/CIPO
terminology, potentially leading to confusion during connections.
While
I did not set these standards, I recognize the importance of adhering to them.
Therefore, I plan to use both the new and old terminologies concurrently,
particularly when working on projects that integrate modules following both
naming conventions. This approach will continue until there is a universal
shift away from the traditional "master/slave" terminology.
Conclusion
Given its robust hardware capabilities, the Curiosity HPC board is intricately
designed for developing 8-bit PIC microcontroller projects, particularly when
utilizing MikroElektronika's Click Board modules.
Its design, which
accommodates both 28- and 40-pin PIC microcontrollers and significant upgrades
compared to the first hardware version, makes it a robust platform for
developing complex projects.
Despite its relatively high cost, the
board's features, including the integration with mikroBUS sockets, justify the
investment by providing enhanced versatility and ease of use. Curiosity HPC
will prove its utility as a valuable education tool for those looking to
deepen their understanding and skills in 8-bit PIC microcontroller
programming, offering a balance between cost and functionality that is hard to
match among PIC microcontroller development boards.
In conclusion,
considering these hardware features, Curiosity HPC is a board complex enough
to develop 8-bit PIC projects, especially if we use Click Board modules from
MikroElektronika.
Note: I originally wanted to write this review for my new YouTube channel, but
there was too much talk and too little movement in the video, so I transformed
it into a blog post.
0 Comments