ABOUT THE AUTHOR

Jannie Hamman is a well-known figure in the world of microcontrollers and robotics, which I have the pleasure of knowning for more than 20 years.

The author spent all of his working career as an Instrumentation Engineer in heavy industry, looking after various automation- and control systems. During this time, he designed, programmed and built 100s of microcontroller circuits used to solve problems and various applications (Black Boxes).

The author also trained many young and upcoming engineers in various fields.

Although an Engineer with a wide field of knowledge, he focused on micro-electronics, microcontrollers and programming and can write in total 18 programming languages.

This stretches throughout the whole spectrum from hardware PLA and assembler up to today’s 4th generation languages, including OS environments for Linux and Microsoft PC software.

The author has registered a few patents during his lifetime. He is currently working on IoT for use in home automation in his spare time.

This book is a must for any person interested in electronics and microcontrollers – all the information and examples you’ll find in this book are from real life solutions through the author’s career.

The book is an asset in your toolbox of knowledge.


Theo A. Moelich

BOOK REVIEW

We continuously define our own rules and boundaries throughout life w.r.t what and how we do things. Things referring to our engineering, programming, electronic hobby or work activities. I have come to know Jannie Hamman as someone who has a very unique viewpoint and constantly challenge these walls and boundaries. This book opened my eyes to different opportunities and possibilities whilst vastly improving my skills.

This book combines the worlds of electronic hardware and programming in a unique synergy. It provides the reader with the knowledge to realize his ideas and inventions with the underlying theme – If you can think it, you can build it. It diminishes the line of impossibilities as told by a person with extensive knowledge and over 30 years of experience in electronic design and programming.

The book is packed with knowledge, projects, diagrams and examples, but yet talks to you in a personal tone with a great sense of humour. Even if you are more inclined to the hardware or software environment, you will find the information you need together with the understanding required to finalize your potential. You will be amazed how you can interface old and new technologies. Get ready to even push the boundaries and completely interface your Raspberry Pi or Arduino boards!

Get ready for an exciting read and open the door to a new world of electronic interfacing. You will definitely read this book multiple times and still learn more every time. Remember, the best way to learn how to think out of the box is to ask someone already on the outside.


Andrew Schnuir

CHAPTERS and APPENDICES

1 Introducing PIC and C

Background
PIC® vs. CPU
CISC vs. RISC
Comparison table
The C structure
Writing your first CCS C program
The PIC16F88
C output functions
C input functions
Tut1 with circuit diagram
Using the PCW compiler
Burning the program
Burning the program directly from PCW

2 CCSC: INSIDE AND OUT – PART 1

Bits and bytes
Pre-processor directives

3 CCSC: INSIDE AND OUT – PART 2

Data definitions
String manipulation
Pointers
Statements
Expressions
Logic gates & flip-flops
User defined functions

4 CCSC: INSIDE AND OUT – PART 3

Bit/byte manipulation
Math functions
Delays
Interrupts
RTOS

5 PIC® hardware and C software

The memory inside
Core SFR’s
Processor control
Inputs and outputs
Modules: Comparators and voltage reference, FVR, ADC, RS232/485, SSP, I2C, Timers, CCP, DAC, Op-amps, PSP, PMP, CWG/COG, SMT, PSMC, PPS, DMA, QEI, RTC, LCD, CRC, NCO, CLC, AngTMR, ZCD, PID and USB peripherals
#fuses

6 Interfacing the outside world

De-bouncing inputs
Matrix keyboards
7-segement displays
DC motors
Stepper motors
Servos
I2C devices like RTCC and memory
Infrared and PIR
Flow, Distance, Gas
Operational amplifiers with IA
Strain guage, Force and Flex sensors
MEMS: Barometric pressure, compass, inclinometers, accelerometers, gyroscopes, Wii Nunchuk
Humidity, Vibration, Sound, Light, Hall-effect, Encoders, Tachometers, 1-wire devices and DAC
Interfacing and connecting AC
Measuring AC
Interfacing 4-20mA
Smartcards

7 Displays

Character LCD
Monochrome graphic LCD
Colour TFT display

8 Temperature measuring

Analogue – LM35, thermocouples, thermistor, RTD
Digital – DS1820 etc.

9 GSM

Send a SMS via terminal example
AT commands
Initializing commands
Ring buffer
Parsing a SMS
Check for RING
Security tips

10 RF (Wireless comms)

Cheap RF link
nRF905 transceiver

11 SD card and FAT

SD card info
FATs

12 Touch screen (TFT)

Description and operation

13 GPS

NMEA sentences
GPS based RTC
Altimeter

14 PC interfacing

RS232
USB
Visual Basic frontend

15 Bootloading


16 Voltage regulators

LM317, LM7805, L200, TC1264, LD1117
Transformer-less PSU’s

17 Food for thought (or my second book?)

Bluetooth
WWW
Wi-Fi
RFID or RF tags
NFC (Near Field Communication)
Raspberry Pi (RPi)

18 Getting it together

9 complete projects:
Access control
Random selector
Sunrise/sunset switch
Generic gate controller
kW/h meter
Trainer board
MBPIC prototype board
Solar controlled LED skylight
RF based Home Automation system

Appendix A

JDM compatible serial programmer
Parallel (printer port) programmer
Power supply circuit
Installing PICPgm software
Using PICPgm software
PICKIT2 Clone
My PK2 clone on Vero board

Appendix B

ASCII control characters (character code 0-31)
ASCII printable characters (character code 32-127)
The extended ASCII codes (character code 128-255)

Appendix C

Type K Thermoelectric table
Sub-zero table (mV)
Positive table (mV)

Appendix D

PT100 Resistance reference table
-200 ̊C to 240 ̊C

Appendix E

PIC® (14 bit) Instruction set
Byte-orientated instructions
Bit-orientated file register instructions
Literal and control instructions

Appendix F

Modifying a servo for continuous rotation

Appendix G

MS Initiative FAT32 File System Specification

Appendix H

Using CCSC V4
CCS C-compiler Version 5 notes

Appendix I

MPLAB-X
Download and installation
Quick instructions
Integrating into CCSC
Using it with CCSC

Appendix J

Microchip Trademarks
Patents of Microchip Technology Inc.
PIC® 8-bit MCU Line card