An Introduction to Designing Ham Radio Projects with PIC Microcontrollers. George Zafiropoulos KJ6VU

Similar documents
Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

DEV-1 HamStack Development Board

PIC-LCD-3310 development board Users Manual

Manual of Board ET-PIC STAMP 18F8722-K22 ET-PIC STAMP 18F8722-K22

An Arduino Controlled 1 Hz to 60 MHz Signal Generator

ET-PIC 24 WEB-V1. o Central Processing Unit (CPU) o System. o nanowatt Power Managed Modes. o Analog Features

Microcontroller basics

Arduino Uno R3 INTRODUCTION

ARDUINO MEGA INTRODUCTION

Sierra Radio Systems. Getting Started With The. HamStack. Microcontroller Project Platform

32 bit Micro Experimenter Board Description and Assembly manual

MOD-ZIGBEE-PIR sensor development board USER S MANUAL All boards produced by Olimex LTD are ROHS compliant

Microcontrollers for Ham Radio

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

PIC Microcontroller Introduction

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

ATmega128. Introduction

Getting to know the Arduino IDE

Introducing the 32 bit Micro Experimenter

Sierra Radio Systems. HamStack. Project Board Reference Manual V1.0

PIC-32MX development board Users Manual

Embedded Systems. Software Development & Education Center. (Design & Development with Various µc)

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Goal: We want to build an autonomous vehicle (robot)

CN310 Microprocessor Systems Design

AVR- M16 development board Users Manual

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

CHIPS Newsletter Vol 5 - Yahoo! Mail. Official Newsletter of

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

Breeze Board. Type A. User Manual.

AVR Microcontrollers Architecture

Bolt 18F2550 System Hardware Manual

MICROPROCESSOR BASED SYSTEM DESIGN

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

MICROPROCESSORS B (17.384) Spring Lecture Outline

Inside the Ten-Tec 506 Rebel Open Source QRP CW Transceiver. Bob Proctor, N6YPE and Brian Tompson, AC7FK

The industrial technology is rapidly moving towards ARM based solutions. Keeping this in mind, we are providing a Embedded ARM Training Suite.

Introducing: New Low-Cost & Low Pin Count PIC Microcontrollers for the 8-, 16- & 32-bit Markets

Basic Components of Digital Computer

Introduction to Arduino. Wilson Wingston Sharon

AVR MICROCONTROLLER PROJECT TUTORIAL E-PUB

Microcontroller Overview

Arduino Internals. Dale Wheat. Apress

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

Digital Homebrewing. Bob Okas W3CD. Copyright 2004 Robert P. Okas

Objective: Additional project details: Code: PSEMBP 100 Category:STEM Level: High School/Community C.

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

MICROPROCESSORS B (17.384) Spring Lecture Outline

SBAT90USB162 Atmel. SBAT90USB162 Development Board User s Manual

Z8 Encore! XP F0822 Series

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

Sierra Radio Systems. Digital Compass. Reference Manual. Version 1.0

Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system.

PIC32MX150F128 Breakout Board

Workshop on Microcontroller Based Project Development

TDSDB Features. Description

Wireless communication for social robotics. Gu C. Department of Electrical & Computer Enginnering. National University of.

PIC-P67J60 development board Users Manual

Lab Course Microcontroller Programming

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

PICado Alpha Development Board V1.0

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Microcontroller Basics

Sierra Radio Systems. Station Controller. User Guide. Version 1.1

WIZTECH AUTOMATION SOLUTIONS (P) LTD., An ISO 9001:2000 and IAO certified company

PIC Microcontroller and

Breeze Board. Type B. User Manual.

ELCT708 MicroLab Session #1 Introduction to Embedded Systems and Microcontrollers. Eng. Salma Hesham

Introduction to ARM LPC2148 Microcontroller

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

LBAT90USB162 Atmel. LBAT90USB162 Development Board User s Manual

AVR-TLCD-128CAN development board Users Manual

Embedded programming, AVR intro

Table of Contents COMPANY PROFILE 1-1 SECTION 1. INTRODUCTION 1-1

Embedded systems. Exercise session 3. Microcontroller Programming Lab Preparation

Distributed Real- Time Control Systems

Acknowledgments About the Author

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

Capacitive Touch Remote Control Reference Design User s Guide

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

ET-BASE AVR ATmega64/128

Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their

Diploma in Embedded Systems

The Freescale MC908JL16 Microcontroller

INDUSTRIAL TRAINING:6 MONTHS PROGRAM TEVATRON TECHNOLOGIES PVT LTD

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

EMBEDDED SYSTEMS COURSE CURRICULUM

To be familiar with the USART (RS-232) protocol. To be familiar with one type of internal storage system in PIC (EEPROM).

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

MEXLE. International Educational Platform. International Educational Platform. for Informatics based on Embedded Systems

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

More than Compatibility

EasyPIC5 Development System

GPIO-2 Board and Station Controller Firmware

Transcription:

An Introduction to Designing Ham Radio Projects with PIC Microcontrollers George Zafiropoulos KJ6VU

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Ideas for Projects Using PIC Microcontrollers TR sequencer Memory keyer CW keyboard Station power controller Rotor controller Tone generator Test equipment controller Speaker / audio router Repeater controller Fox hunt tx controller Radio control Morse code decoder APRS encoder Frequency counter Battery monitor Audio meter

Hardware Options Design your own hardware Software Options Use existing prototype board Hardware platform Assembler C Basic

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Picking a Microcontroller Selection Criteria for Ham Radio Projects Cheap Easy to program (relatively) Serial interface (for control and configuration) Fast Non-volatile flash memory (program and data) 5V supply and I/O Wide variety of IO besides digital in/out A/D converter, SPI, UART, I2C, PWM (tone), etc DIP package Code examples Big eco-system RF immune Low noise generation

Microcontroller Suppliers

Devices for Hobby Projects Atmel AVR Basic Stamp Arduino Microchip PIC HamStack Chips Modules Boards

Lets Pick the PIC what s a PIC? Product of Microchip Technology PIC1640 originally developed by General Instrument's Microelectronics Division PIC = "Programmable Interface Controller PICs are low cost & widely available Large user base Low cost or free development tools In 2008 Microchip shipped its 6,000,000,000 th PIC processor

PIC 18Fxxxx Family

Processing Horsepower 1 MIP 16 MIPs < PIC Microcontroller

What s Inside a PIC 18Fxxxx CPU Chip?

Lets Use the 18F2620 CPU up to 10 MIPS performance (40 MHz) CPU up to 16 MIPS performance (64 MHz) C, Assembler, Basic compiler support 8 x 8 Single Cycle Hardware Multiply System Internal oscillator support 31 khz to 8 MHz Fail-Safe Clock Monitor allows safe shutdown if clock fails Watchdog Timer with separate RC oscillator Wide operating Voltage range; 2.0V to 5.5V nanowatt Power Managed Modes Run, Idle and Sleep modes Idle mode currents down to 5.8uA typical Sleep mode currents down to 0.1uA typical Analog Features 10-bit ADC, 10 channels, 100K samples/second Programmable Low Voltage Detection Module Programmable Brown-out Reset module Two Analog comparators with input multiplexing Peripherals Master Synchronous Serial Port supports SPI and I2C Master and Slave Mode EUSART module including LIN bus support Four Timer Modules Up to 2 PWM outputs

18F2620 18F4620 18F8722 All code compatible, just more pins 28 Pins 80 Pins 40 Pins

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Minimum Configuration Blinky PicKit2 Programmer Power Input

19 User Configurable I/O Pins PicKit2 Programmer 6 Analog Input Or Digital I/O Pins Power Input 13 Digital I/O Pins

Many Special Purpose I/O Pins PicKit2 Programmer Timers PWM 6 Analog Input Or Digital I/O Pins SPI / I2C Clock PWM Power Input UART SPI data out SPI Data In or I2C Data Interrupt

Howz That Work?

Minimum Configuration Blinky PicKit2 Programmer Power Input

Let s add some additional input / output devices Analog Inputs Digital Inputs Digital Outputs

Now lets add an RS-232 Interface RS-232 Interface

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Design Your Own Boards Low cost prototype PCB services Free design tools Prototype quality Drilled and plated Production quality Drilled, plated, solder mask, silkscreen Prototypes Minimum order 2 boards ~$120 and up for 2 Or get 3 boards 2.5 x 3.8 for $52 www.expresspcb.com www.pcbexpress.com www.pcb123.com

Free Schematic Editor

Free Layout Editor

Use an bare off the shelf Prototype Boards Examples from ME Labs Simple Prototype Boards Blank Boards Multi-purpose Prototype Boards

Off the Shelf Single Board Computers Arduino Uno HamStack Basic Stamp

CPU Comparison Arduino Arduino HamStack HamStack Parallax Parallax Processor Processor ATMega328 ATMega328 PIC PIC 18F46K22 18F4620 Basic Basic Stamp Stamp II II Vendor Speed Atmel 20 MHz Microchip 64 MHzPIC Microchip 20 MHz PIC Speed Instructions per second 2020,000,000 MHz 16,000,000 40 MHz 4,000 20 MHz RAM RAM 2,028 2,028 bytes bytes 4,096 bytes 25 25 bytes Flash Flash memory memory for for program program store store 32,000 32,000 64,000 2,048 Flash Flash memory memory for for data data storage storage 1024 1024 bytes bytes 1024 1024 bytes bytes None None Onboard Peripherals Onboard Peripherals 8 Bit 8 counter Bit counter / timer / timer 2 2 13 None None 16 bit 16 counter bit counter / timer / timer 1 1 34 None PWM PWM 6 6 5 Yes Yes 10 bit 10 A bit to A D to converter D converter 6 6 13 25 None Serial Serial UART UART 1 1 12 11 SPI SPI serial serial interface interface 1 1 12 None I2C I2C serial serial interface interface 1 1 12 None None Digital Digital IO pins IO pins 14 14 30 30 16 16 Total IO pins at any time 20 30 16 Total IO pins at any time 20 30 16 Form factor Board Board Chip Form Assembled Kit Assembled Kit/Assembled Assembled Kit Assembled CPU CPU board board / module $ 29.00 $ 29.00 $ 39.00 $ $ 49.00

HamStack CPU Board Upgrade to Newer CPUs 4620 46K22 46K80

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Software Development Flow Edit source code Use any ASCII text editor test.c Compile program Compile or assemble into executable file test.hex Download into CPU Use PicKit2 or similar programmer to transfer the.hex file into the program store flash memory in the PIC Run program It s alive!

Compilers Microchip MPLAB IDE & Assembler Text editor Assembler Debugger Free!

Microchip C18 Compiler Full-featured C compiler ANSI compliant Compatibility with object modules generated by the MPASM assembler Extensive library support PWM SPI I 2 C UART, USART string manipulation math libraries Free version available

Swordfish Basic Editor/Compiler Powerful and easy to use basic language String handling Relational operations Boolean Logic Operators Floating Point Math In line assembly Graphical LCD support Compact Flash USB in/out SPI I 2 C DS OneWire UART ASCII Lite version $FREE Full version $150

In-Circuit Programmer Downloads the Program Open the.hex file Hit the Write button

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

Software Example Task: Flash the LED forever

All Programs Have a Common Control Program Structure Initialize Program Read Inputs Make Decisions Loop forever Write Outputs Subroutine Library

Blinky Written in Swordfish Basic ' ============================================================================ ' blinky.bas ' Blinking LED demo using Swordfish Basic ' ============================================================================ Device 18F2620 Clock = 10 ' Select device type ' Set clock frequency to 40 MHz CONFIG_START OSC = HSPLL CONFIG_END ' Set hardware configuration parameters ' Set 4x PLL on (10 MHz crystal * 4x = 40 MHz) TRISC.1 = 0 ' Set pin C1 connected to the status LED to be an output While true Low PORTC.1 DelayMS (200) High PORTC.1 DelayMS (200) Wend ' Set pin C1 low (0 volts) LED on ' Delay 200 ms ' Set pin C1 high (5 volts) LED off ' Delay 200 ms Loop forever

Blinky Written in Microchip C18 /* blinky.c - This is a simple program that blinks the status LED */ #include <p18cxxx.h> /* Use PIC18 processor family */ #pragma config WDT = OFF /* Turn off watchdog timer checking */ /************************************************************************/ void delay (void) /* Delay subroutine */ { long i; /* Declare variable i as a long integer */ for (i = 0; i < 1000; i++); /* Increment the counter */ } /************************************************************************/ /************************************************************************/ void main (void) { TRISC = 0; /* Set IO register C to output mode */ while (1) /* Loop forever */ LATCbits.LATC1 = 0; /* Turn on status LED */ delay (); /* Wait by calling the delay subroutine */ LATCbits.LATC1 = 1; /* Turn off status LED */ delay (); /* Wait by calling the delay subroutine */ } } /************************************************************************/

Software Example CW Key Key Tx Task: When a button is pressed Key my transmitter Send a CW message Continue while button pressed

CW Beacon Transmitter ' HamStack CW Beacon Device = 18F4620 Clock = 10 Include "hamstack.bas" ' Initialize relay_1_off relay_2_off led_off While true If mode_button = pressed Then led_on relay_2_on DelayMS (500) send_cw ("CQ CQ CQ DE KJ6VU K") DelayMS (500) relay_2_off DelayMS (2000) EndIf Wend

hamstack.bas Library Module hamstack '======================================= '=====[ Physical IO pin assignments ]= '======================================= Public Dim relay_1 As portb.3 Public Dim relay_2 As portb.2 '======================================= '=====[ Common Public Variables ]===== '======================================= Public Const on As Byte = 1 Public Const off As Byte = 0 Public Const yes As Byte = 1 Public Const no As Byte = 0 Public Const pressed As Byte = 0 '============================================================= '=====[ Send CW ]=========================================== '============================================================= Public Sub send_cw (ByVal cw_string As String) '----- VARIABLE DEFINITIONS --------------------------------------- Dim wpm As Byte ' CW speed in words per minute Dim cw_time As Word ' Calculated time value of a dit in ms. Dim cw_len As Byte ' Working variable, length of string Dim i As Byte ' Working variable Dim x As Byte ' Working variable Dim y As Byte ' Workign variable Dim cw_char As String(2) ' Holds the character being sent Dim cw_bits As String(15) ' Dit / Dah pattern being sent Dim cw_temp As String(2) ' Working variable '======================================= '=====[ Status LED Control ]========== '======================================= Public Sub led_on () High (portc.0) End Sub '------------------------------------------ ---------------------------------- Public Sub led_off () Low (portc.0) End Sub '======================================= '=====[ Relay control ]=============== '======================================= Public Sub relay_1_on () High (relay_1) End Sub '--------------------------------------- Public Sub relay_1_off () Low (relay_1) End Sub '----- INITIALIZE VARIABLES ---------------------------------------- wpm = 13 ' CW speed in words per minute '----- START MAIN PROGRAM CODE ------------------------------------- cw_time = 1200 / wpm ' Calculate the length of a dit cw_len = Length(cw_string) ' Determine the length of the string '----- START MASTER CONTROL LOOP ------------------------------------ master_loop:' Outer loop will process the whole string. For i = 0 To cw_len-1 ' Go through the string cw_char = Mid(cw_string,i,1) ' Grab the current char Select cw_char Case "A" : cw_bits = ".-" Case "B" : cw_bits = "-..." Case "C" : cw_bits = "-.-." Case "D" : cw_bits = "-.." Case "E" : cw_bits = "." Case "F" : cw_bits = "..-." Case "G" : cw_bits = "--." Case "H" : cw_bits = "..." Case "I" : cw_bits = ".." Case "J" : cw_bits = ".---" Case "K" : cw_bits = "-.-" Case "L" : cw_bits = ".-.."

Topics Ham radio applications Microcontroller basics Hardware design examples Implementing your design Software tools Software examples Project gallery

HamStack CPU

HamStack Relay Board

HamStack Solder-less Breadboard

HamStack Prototype Board

Arduino Compatible

Multi-Port, Multi-Processor Repeater Control System

Summary Easier then you may think Many good tools and examples Pick a project and jump in For more information ExpressPCB www.expresspcb.com Microchip www.microchip.com Swordfish Basic www.sfcompiler.co.uk Sierra Radio www.sierraradio.net HamStack www.hamstack.com