Upload
bocorob8883
View
222
Download
0
Embed Size (px)
Citation preview
8/9/2019 Digital Home Brewing
1/43
1
DigitalHomebrewingBob Okas W3CD
Copyright 2004 Robert P. Okas
8/9/2019 Digital Home Brewing
2/43
2
Introduction
Digital Homebrewing is a broad topic thatencompasses:
Hardware Logic Design Software design
Combinations of both: Embedded Systems
8/9/2019 Digital Home Brewing
3/43
3
Introduction
Pure hardware design uses only logic to get thejob done. For example a CMOS keyer1.
Pure software design assumes a generalpurpose platform and an operating system, suchas a PC running Windows or Linux. Keyboards
and mice let you know youre using a computer.
8/9/2019 Digital Home Brewing
4/43
4
Introduction
PC software can be considered digitalhomebrewing.
WD6CNFs CW decoder program.2
Digipan, MixW, etc. are all homebrewed.
Software Defined Radio uses a PC platform formany functions.3
8/9/2019 Digital Home Brewing
5/43
5
Introduction
Embedded systems are usually task-specific and you
dont interact with the processor like you would with aPC.
Examples of embedded systems are NorCal keyer4,Small Wonder Labs Freq-Mite5 , PIC-EL6 or themicrocontroller in modern rigs.
Today, well focus is on homebrewing embeddedsystems.
8/9/2019 Digital Home Brewing
6/43
6
Embedded Systems
Hardware
Lets start with the hardware.
Embedded systems obviously require some sort
of platform.
The application dictates the size and method of
construction.
8/9/2019 Digital Home Brewing
7/43
7
Embedded Systems
Hardware
There are several approaches to digitalhardware:
Wire Wrap
Dead BugPC Board Cadsoft7
Manhattan Style visit K7QOs Website8
No-Brew
8/9/2019 Digital Home Brewing
8/43
8
Embedded Systems
HardwareWire-wrapped S-100 Single Board ComputerFront
8/9/2019 Digital Home Brewing
9/43
9
Embedded Systems
HardwareWire-wrapped S-100 Single Board ComputerBack
8/9/2019 Digital Home Brewing
10/43
10
Embedded Systems
HardwarePrinted Circuit / Dead Bug Video Display PrototypeTop
8/9/2019 Digital Home Brewing
11/43
11
Embedded Systems
HardwarePrinted Circuit / Dead Bug Video Display PrototypeBottom
8/9/2019 Digital Home Brewing
12/43
12
Embedded Systems
HardwareHomebrew Printed Circuit
8/9/2019 Digital Home Brewing
13/43
13
Embedded Systems
HardwareAA0ZZs Manhattan PIC-EL Prototype9
8/9/2019 Digital Home Brewing
14/43
14
Embedded Systems
Hardware
No-brew Hardware options:
PIC-EL board10
Micro 908 Board11 Atmel Butterfly12
Evaluation boards from Analog Devices, TI,
Freescale and others
8/9/2019 Digital Home Brewing
15/43
15
Embedded Systems
Hardware
PIC-EL Board
Unfortunately, no longer available
Full hardware documentation on the Web10 Elmer 160 Course is an excellent tutorial on PIC
programming
8/9/2019 Digital Home Brewing
16/43
16
Embedded Systems
Hardware
Micro-908
Powerful, self-contained processor
Adapts easily to your base board Excellent support by AmQRP11
8/9/2019 Digital Home Brewing
17/43
17
Embedded Systems
HardwareAmQRP Micro-908
8/9/2019 Digital Home Brewing
18/43
18
Embedded Systems
Hardware
Atmel Butterfly
Low Cost - $20 at DigiKey13
Self-contained
Battery powered
Numerous Enthusiasts14
KD1JV Melt Solder projects15, 16
8/9/2019 Digital Home Brewing
19/43
19
Embedded Systems
HardwareAtmel Butterfly
8/9/2019 Digital Home Brewing
20/43
20
Embedded Systems
HardwareHomebrewing From Scratch
What if No-Brew doesnt satisfy needs?
8/9/2019 Digital Home Brewing
21/43
21
Embedded Systems
HardwareHomebrewing From Scratch
Time for a homebrew project!
1 Identify requirements
2 Evaluate suitable processors
3 Evaluate software development tools
4 Repeat steps 1, 2 & 3 until satisfied
8/9/2019 Digital Home Brewing
22/43
22
Embedded Systems
HardwareHomebrewing From Scratch
Choosing a Processor
Many Factors determine the best choice:
Cost
Package
Processing Speed
Memory Type and Size
Power Consumption
I/O pins & Features
Software Development Environment
8/9/2019 Digital Home Brewing
23/43
23
Embedded Systems
HardwareHomebrewing From Scratch
Cost less that $10
Package DIP or Surface Mount
Speed Fast enough to do the job Memory Flash for the program, RAM for the variables
Power Consumption The lower, the better
I/O pins & Features Depends on application
Software Development Environment Free is best!
8/9/2019 Digital Home Brewing
24/43
24
Embedded Systems
HardwareHomebrewing From Scratch
Consider the Microchip PIC processors:
Inexpensive
Available in DIP package
Various clock speeds Various Flash memory sizes, limited RAM
RISC Architecture yields high processing speed
Current Consumption as low as 13 uA
Limited I/O pins, but numerous features like USARTs, A/Dconverters & Timers
Free Development Software17
8/9/2019 Digital Home Brewing
25/43
25
Embedded Systems
HardwareHomebrewing From Scratch
Consider the Atmel processors:
Inexpensive
Available in DIP package
Various clock speeds Large program Flash memory and RAM
RISC Architecture yields high processing speed
Low power consumption
Numerous features like USARTs, A/D converters & Timers Free Development Software18
8/9/2019 Digital Home Brewing
26/43
26
Embedded SystemsSoftware
Once the processor is selected, its time to startwriting code.
8/9/2019 Digital Home Brewing
27/43
27
Embedded SystemsSoftware
There are two basic options:
Assembly Language
High Level Language - C
8/9/2019 Digital Home Brewing
28/43
28
Embedded Systems
SoftwareAssembly Language
Most chip vendors provide free tools
Integrated development environments provide:
Context-sensitive editors
Assemblers & linkers
Simulators
8/9/2019 Digital Home Brewing
29/43
29
Embedded Systems
SoftwareAssembly Language
MP
LAB
MPLAB
E b dd d S
8/9/2019 Digital Home Brewing
30/43
30
Embedded Systems
SoftwareAssembly Language
Context-sensitive editors:
Provide a convenient way to type in your program
Highlight labels, variables, instructions and comments
using various colors
Help you avoid common mistakes
E b dd d S t
8/9/2019 Digital Home Brewing
31/43
31
Embedded Systems
SoftwareAssembly Language
Assemblers: Convert your source program into opcodes the
processor understands. They work on individual
source files.
Linkers: Combine the outputs from the assembler and resolve
references to labels (jump and call instruction targets)and any library functions.
Produce the final binary program for the processor.
E b dd d S t
8/9/2019 Digital Home Brewing
32/43
32
Embedded Systems
SoftwareAssembly Language
Simulators provide:
A way to test your program without using actualhardware
A way to simulate hardware inputs
E b dd d S t
8/9/2019 Digital Home Brewing
33/43
33
Embedded Systems
SoftwareC
Why use a High Level Language? It allows you to be efficient. A few lines of C replace
several lines of assembly.
You dont lose control of the hardware. You can easily port your program to another
processor.
E b dd d S t
8/9/2019 Digital Home Brewing
34/43
34
Embedded Systems
SoftwareC
Pros and Cons: Its easy to port programs between chips C is not supported on some processors.
Commercial development packages cost $$$$.
Development suites offer similar features as assemblylanguage: Editors
Program Build tools
Simulators / Debuggers
E b dd d S t
8/9/2019 Digital Home Brewing
35/43
35
Embedded Systems
SoftwareC
There are alternatives to commercial packages. Just as homebrew software enthusiasts developed
Linux, there are folks who develop microcontrollerdevelopment tools.
The good news is theyre free! WinAVR19 is one example
Embedded Systems
8/9/2019 Digital Home Brewing
36/43
36
Embedded Systems
SoftwareCWinAVR Development Environment
8/9/2019 Digital Home Brewing
37/43
37
Embedded SystemsChip Programming
Several options exist for programming the processor Commercial programmers: $150 - $200
Microchip ICD 2
Quick Writer JTAG
Homebrew
Self-programming processors
8/9/2019 Digital Home Brewing
38/43
38
Embedded SystemsChip Programming
JTAG can be used for programming and debugging
Commercial units are expensive
The Web has plenty of homebrew designs
8/9/2019 Digital Home Brewing
39/43
39
Embedded SystemsChip Programming
Homebrew Designs
PIC-EL board
KB0Ps programmer20
Numerous other designs can be found on the Web
8/9/2019 Digital Home Brewing
40/43
40
Embedded SystemsChip Programming
Self-programming processors come with built-inloader software
A serial cable is all thats usually required AmQRP HC-908
Atmel Butterfly
Use the supplied software to download the code andstore it in the chip
8/9/2019 Digital Home Brewing
41/43
41
Embedded SystemsSummary
Powerful, highly integrated microcontrollers dont requiresupport logic.
Hardware options are numerous:
Homebrew construction using various techniques
Club Kits Low cost evaluation modules
There are numerous no-cost software development packagesavailable:
Chip vendors provide free assembly language tools Free C language development tools.
8/9/2019 Digital Home Brewing
42/43
42
Embedded SystemsSummary
Hardware design is easy Only a few chips at most are required
Many examples of projects on the Web
Copy or adapt existing an existing design
Use your favorite construction method
Software development is easy
Online tutorials like Elmer160 help you get started
Copy or adapt existing software21
Many low cost device programmers are available
8/9/2019 Digital Home Brewing
43/43
43
References 1 http://www.io.com/~n5fc/keyer.html
2 http://www.amqrp.org/projects/cwdecod/cwdecod.htm
3 http://www.sdrforum.org/
4 http://www.amqrp.org/kits/NCKeyer/ 5 http://smallwonderlabs.com/swl_frq.htm
6 http://www.amqrp.org/elmer160/board/index.html
7 http://www.cadsoft.de/
8 http://www.qsl.net/k7qo/manhattan.pdf
9 http://home.comcast.net/~aa0zz/
10 http://www.amqrp.org/elmer160/board/index.html
11 http://www.njqrp.org/hc908/index.html 12 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3146
13 http://dkc3.digikey.com/PDF/T043/0300.pdf
14 http://www.avrfreaks.net/
15 http://www.qsl.net/kd1jv/bfydds.HTM
16 http://www.qsl.net/kd1jv/digiswr.HTM
17 Google MPLAB IDE for latest version
18 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 19 http://winavr.sourceforge.net/
20 http://www.qsl.net/kb0p/pic.html
21 http://home.earthlink.net/~vintage2