Академический Документы
Профессиональный Документы
Культура Документы
Microcontrollers?
And why
PIC? Programming PICs Electronics & Interfacing PICs Putting it all together, where next What are the alternatives?
Low cost Few other glue components required Low active power use + sleep modes to save power. Many options across hundreds of versions; some have USB or TCP/IP, differing amounts of RAM, ROM and I/O, flash or one time programmable. Product families are often code and/or pin compatible Programmers are very inexpensive Programmable in Assembler or C (free) and a number of other programming languages including Basic.
Programmer
PIC
In Circuit /ICSP
Stand-Alone
Manufactured
Stand-Alone Programmers
RISC (as opposed to CISC) typically 35, no more than 80 assembler instructions. Harvard Architecture (not von-Neumann) = separate 8 data memory versus 12/14/16 bit program memory.
You need to compile your code to the correct PIC micro (or near equivalent)
Many different languages are available. Microchip provide with MPLAB IDE their MPASM (assembler), as well as Microchip C, Microchip HiTech C is also available. Many other 3rd party options including CCS C, CC5X C, GCBasic, Proton Basic, and PIC Basic Pro.
MPLABX for Windows, Mac OS X and Linux users or MPLAB for Windows users Start simple, use a simpler, low-end PIC Spacing is important
Programming PICs C
Digital I/O Ports, D to A ports, + specialised ports including: LIN I2C CAN SPI USB PWM and more
Can be configured for input, output or both = Tristate Input ports can detect a digital (on/off) devices status such as a switch. Output ports can source or sink power (watch current limitations, check the datasheet) Some I/O ports have Analog to Digital converter, A to D check datasheet for no. of ports + no. of bits
Developed by Freescale along with a number of automotive companies. Uses 1 active wire = very simple and inexpensive.
Developed by Philips, uses 2 active wires: serial data + serial clock= simple and inexpensive. Data is half-duplex (one way at a time)
10kbit/s, 100kbit/sec, 400kbit/sec, 1Mbit/sec, 3.4Mbit/sec high speed transfer lowers range to a meters, but using lower speeds, or with buffering can reach 2001000m
Commonly used in embedded devices, such as mobile phones, to connect the displays, buttons and
Developed by Motorola, its a 4-wire bus, comprising serial clock, serial data out, serial data in, chip select.
Started as a message based Vehicle Bus standard for automotive applications. Very high noise immunity 40 metres at 1Mbits/sec or 500m at 125kbits/sec
Now also used for industrial automation and medical equipment , as well as some trucks, tractors, aircraft etc.
Commonly used for DC motor control, aircraft servos, can also control brightness of lights
vs
PIC can see a single push of a switch as multiple presses this is known as key bounce, may need to debounce
Many ways to interface to PC - USB is one of the easiest - RS232 relatively easy to use, but voltages can be an issue Phones often have RS232
Is your project idea is possible? Try the same principles as we do in Agile software development: - break it down into small do-able pieces - do a research Spike, pick a small task - try to create a Sashimi slice a small vertical layer
Breadboard
Look at projects people have already done, it may not be as much fun, but is it simpler to buy something close?
OBD-II connectors on all new cars, these communicate using CAN protocol
See: http://sourceforge.net/projects/priidash/
See: http://sourceforge.net/projects/priidash/
Add code with some maths + air pressure readings, and get an altimeter as well See: http://wiki.openmoko.org/wiki/I2C_Pressure_Sensor
One PIC18F4550, an ultrasonic ranging module and a recycled stepper motor See: http://www.steffenschuette.de/steffenschuette/elektronik/us2bRadar/
See: http://www.steffenschuette.de/steffenschuette/elektronik/us2bRadar/
A PIC microcontroller, open source design, home built hardware See: http://erik-pic-microcontroller.blogspot.com/2010/02/cnc-router-project.html
There are numerous projects that might be possible, though the use of them might best be considered very carefully! eg. A key logger with just 3 chips that can secretly log keys and then later retrieve them with a special combination of keys.
Where next
More Information
Go to http://www.coastnerds.info