pic -3. this class: introduction to autonomous microboard next class - hosted mode. this class is...
Post on 21-Dec-2015
218 views
TRANSCRIPT
![Page 1: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/1.jpg)
PIC -3
![Page 2: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/2.jpg)
This Class: Introduction to Autonomous Microboard
• Next class - hosted mode.
• This class is overview of autonomous mode.
• Most projects expected to use some form of autonomous mode….
![Page 3: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/3.jpg)
What is Autonomous Mode?
• Assembly/Machine or C programming.
• C2C (shareware) & CCS
• Simple instructions.
• Full capability of PIC.
![Page 4: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/4.jpg)
When to be Autonomous
• Response in usec.
• Need full capabilities of PIC.
• Not too computing or data intensive.
• No interface to host needed.
• Low duty cycle (e.g. data logging)
![Page 5: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/5.jpg)
The 87x PIC• Data sheet on
website
• RISC (35 inst.)
• Fast &Cheap
• EEPROM, Flash, RAM
• Programmable
• In-Circuit Pgming
![Page 6: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/6.jpg)
873 - Versatile
• Sleep mode
• Power management
(uA to mA !)
• Timers
• Interrupts
• UART
• Parallel port
• DIO (A,B,C)
• PWM output
• PWM capture
• 10 bit ADC
• SPI
• I2C
![Page 7: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/7.jpg)
Instruction Set• Simple• Portable skill• Program from Sheet (“Fortran”)• Bit intensive• 4k 14 bit words• 1 us/instruction
![Page 8: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/8.jpg)
Bit Banging• Complete data sheet.• Many application
notes, books.• Can code many
operations yourself.• Many placed in
“Modules”• UART• SPI• I2C• USB (devel.)
![Page 9: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/9.jpg)
Assembler Programming• Perhaps alien - but powerful and fast.• From Section 9.1 in manual:
![Page 10: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/10.jpg)
Modules and Debug
• Many modules on PIC
• Much setup & many modes
• Most common modules covered by subroutines in Debug (e.g. hosted mode)
![Page 11: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/11.jpg)
Hacking Debug• Command Sub.• Low-Level Sub.• Definitions
• Parser
![Page 12: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/12.jpg)
Calling a Debug Subroutine
• Section 11.1
• Banks for Data
• Pages for Program
• Simple!
![Page 13: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/13.jpg)
Programming - MPLAB
• Section 9• Assembler• Simulator• Programmer• Freeware(Also GNU, C2C
etc)
![Page 14: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/14.jpg)
Simulating - MPLAB
• Section 10
• Step through program
• Watch memory/ports change.
• Perfect for tracking bugs.
• Limitations: Serial/ADC
![Page 15: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/15.jpg)
Free C Compilers : C2C
C2C • On web • LCD etc. interface
routines available• Easy to adapt and
develop.• Allows inline ASM.• No floats• Not ANSI
• Careful with different devices such as LCDs
• Will need to read data sheets.
• Configurable to most PICs
• No examples yet…
![Page 16: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/16.jpg)
Free C Compilers : Optama
Optama • Demo available on web.• LCD etc. interface
routines available?• Easy to adapt and
develop.• Allows inline ASM?• No floats?• Not ANSI?
• Careful with different devices such as LCDs
• Will need to read data sheets.
• Configurable to most PICs
• USB example…
![Page 17: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/17.jpg)
C Compilers : HiTech
HiTech Demo• 21day from web• LCD etc. interface
routines available.• Easy to adapt and
develop.• Allows inline ASM.• Full floating point!• ANSI
• Careful with different devices such as LCDs
• Will need to read data sheets.
• Configurable to all PICs?
• No examples yet…• Reinstall system after
21d!
![Page 18: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/18.jpg)
C Compilers : CCS
CCS• Purchased (145$)• LCD etc. interface
routines available.• Easy to adapt and
develop.• Allows inline ASM.• Full floating point!• ANSI
• Careful with different devices such as LCDs
• Will need to read data sheets.
• Configurable to all PICs
• Some examples in 401• Now in my lab…
![Page 19: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/19.jpg)
CCS in My Lab• Souped up
Microboard:
20 MHz 877 PIC• C far faster & easier• LCD, Serial, SPI,
ADC, DIO, Steppers, Servos, DAC, Interrupts
• “Real Time OS”
• ‘Bomb’ detectors• Ion thrusters• Robotic fingers• Temperature controllers• DNA detectors
Soon:• Mutation detectors• Launch…
![Page 20: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/20.jpg)
CCS Coding : LCD & Floats#device PIC16F877 *=16 ICD=TRUE#include <defs_877.h>#include <lcd_out.h>void main(void){ ... lcd_init(); q = 0; while(1) { ...lcd_clr_line(1); // advance to line 1printf(lcd_char, " Hello World ");
T_F = 76.6 + 0.015 * ((float) (q)); lcd_clr_line(2); printf(lcd_char, "T_F = %f", T_F);
…Not Bad Eh?
![Page 21: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/21.jpg)
Other Examples
• Telephone Dialing• Temperature• Pressure• SPI devices• I2C devices• EEPROM• Control
• Music Playing• Floating point• …Countless• HiTech site• CCS site• Internet as a whole• C far more portable
![Page 22: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/22.jpg)
CCS in EE401
• Windows version• Integrated into
MPLAB!• Perfect for simulating,
debugging and burning…
• Limited access?
• Linux version• Remote compiles!• Perfect for debugging
from home or?• Unlimited access?
![Page 23: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/23.jpg)
Other Thoughts
• Many methods for using bootloaders with asm or C! (e.g. HiTech site)
• Power management (e.g. data logging)
• USB C code now on web
• Some new RF units (simple and readily available components)
![Page 24: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/24.jpg)
By End of Week• Sketch Proposal
(Friday September 20, 5pm)
• Parts.
• Schematic.
• Objectives.
• Description/Background
• Attribute.
• See website checklist!
![Page 25: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/25.jpg)
Next 2 Weeks
• Prototyping on SK-10s
• Return of Proposals
• Complete Schematic (EAGLE)
• Programming/Interfacing Signoff
• Easy if keep underway.
![Page 26: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/26.jpg)
Guest Lectures Later
• Jerry Kowalyk• Library & Electronic
searches• Background required
in any project report.
Loren Wyard-Scott• PC Layout.• Use of EAGLE.• Instruction on getting
a good PCB layout.• Rules for PCB
submission.
![Page 27: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/27.jpg)
Lectures
Loren Wyard-Scott• Simulation• Tracking bugs• Methods• Limitations• Examples
![Page 28: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/28.jpg)
Schedule
• Easy schedule if regular.
• Don’t let due dates loom!
• Do not underestimate times for:
- design
- parts
- fixes
- software
- integration
- background
- creativity
![Page 29: PIC -3. This Class: Introduction to Autonomous Microboard Next class - hosted mode. This class is overview of autonomous mode. Most projects expected](https://reader030.vdocuments.us/reader030/viewer/2022032801/56649d545503460f94a313ee/html5/thumbnails/29.jpg)
The Labs
• Office hours are generally in lab.
• Generally in each lab day.
• Approach in lab or after class.
• Arrange time if need be.