1818281+1818282 Microchip Technology, 1818281+1818282 Datasheet

no-image

1818281+1818282

Manufacturer Part Number
1818281+1818282
Description
EDF / AMICUS18 + SHIELD, BUNDLE
Manufacturer
Microchip Technology
Type
Development Boardr

Specifications of 1818281+1818282

Kit Contents
Board
Svhc
No SVHC (15-Dec-2010)
Kit Features
Nine 10-bit ADC Inputs, Two 10-bit PWM Outputs, Two Comparators
Mcu Supported Families
PIC18F25K20
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC18
Silicon Core Number
PIC18F
Silicon Family Name
PIC18FxxKxx
Amicus18
Companion Shield

Related parts for 1818281+1818282

1818281+1818282 Summary of contents

Page 1

Amicus18 Companion Shield ...

Page 2

Amicus18 Companion Shield Amicus18 Companion Shield ...................................................................................2 Companion Shield Options ............................................................................................3 Building the Companion Shield ......................................................................................4 First Program..................................................................................................................................... 7 2 LED Flasher ...................................................................................................................................11 4 LED Sequencer...............................................................................................................................13 8 LED Sequencer...............................................................................................................................16 Traffic Light Sequencer......................................................................................................................19 Sensing the Outside World.......................................................................................... 21 Switch Input (Pulled-Up)....................................................................................................................21 ...

Page 3

Amicus18 Companion Shield Amicus18 Companion Shield A shield is a PCB that fits over the Amicus18 board and provides extra functionality, such as Ethernet, Motor control, LCD, Smartcard, GPS, GSM etc… All Arduino shields will physically fit on the Amicus18, ...

Page 4

Amicus18 Companion Shield Companion Shield Options The companion shield is available as a blank PCB or ready built. However, there are two flavours of the ready built boards, one with header sockets, and one with header pins. It all depends ...

Page 5

Amicus18 Companion Shield The two flavours of the shield allow the boards to be stackable or at the top of the stack: The illustration above shows the Amicus18 board at the bottom of the stack, then a socketed shield, then ...

Page 6

Amicus18 Companion Shield Next solder on the resistor R6 which is a 1KΩ 1% 0805 casing type: Next to solder is the power indicator LED, this is a red type 0805 casing, but any colour will do. Note that resistor ...

Page 7

Amicus18 Companion Shield The next component is the reset button, this is a standard PCB push to make type: Then place either the header pins or the header sockets as the earlier diagram illustrate. These are standard 2.54 (0.1”) spacing ...

Page 8

Amicus18 Companion Shield First Program We’ll jump straight in at this point and produce our very first program that does something, but not us- ing the companion shield just yet. Open the AmicusIDE and type in the following code. Note ...

Page 9

Amicus18 Companion Shield The circuit for the layout above is shown below: The same program may be used with the layout above, but this time the LED is protected from over voltage and over current. ' Flash an LED connected ...

Page 10

Amicus18 Companion Shield How to choose the resistor value A resistor is a device designed to cause resistance to an electric current and therefore cause a drop in voltage across its terminals. If you imagine a resistor to be like ...

Page 11

Amicus18 Companion Shield We need a 47Ω resistor look at the colour table we see that we need 4 in the first band, which is Yellow, followed the next band which is Violet ...

Page 12

Amicus18 Companion Shield 2 LED Flasher Adding a second LED is simple, and the code for driving them is not too difficult either: Crownhill AssociatesLimited 2009 - All Rights Reserved Version 1.0 11 06-10-2009 ...

Page 13

Amicus18 Companion Shield The circuit for the two LED flasher layout is shown below: The code for driving the LEDs is shown below: ' Flash 2 LEDs connected to RB2 and RB3 Symbol LED1 = RB2 Symbol LED2 = RB3 ...

Page 14

Amicus18 Companion Shield 4 LED Sequencer Adding, and using, extra LEDs is also very simple, as illustrated below: Crownhill AssociatesLimited 2009 - All Rights Reserved Version 1.0 13 06-10-2009 ...

Page 15

Amicus18 Companion Shield The two extra LEDs are connected to RB0 and RB1 of PortB, as the circuit shows below: A suitable program for the 4 LED sequencer is shown below: ' Illuminate 4 LEDs attached to PortB in sequence ...

Page 16

Amicus18 Companion Shield A more advanced program to do the same thing is shown below: ' Illuminate 4 LEDs attached to PortB in sequence ' Using a more advanced method ' Make sure the Amicus18 board’s jumper Q3 is set ...

Page 17

Amicus18 Companion Shield 8 LED Sequencer A more sophisticated layout is shown below, in which eight LEDs are used. Notice how the use of differ- ent colour LEDs adds a new twist: A top down view of the above layout ...

Page 18

Amicus18 Companion Shield The circuit for the eight LED layout is shown below: PortB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 Power GND A suitable program for the 8 LED sequencer is shown below: ' Illuminate 8 LEDs attached ...

Page 19

Amicus18 Companion Shield A more advanced program to do the same thing is shown below: ' Illuminate 8 LEDs attached to PortB in sequence ' Using a more advanced method ' Make sure the Amicus18 board’s jumper Q3 is set ...

Page 20

Amicus18 Companion Shield Traffic Light Sequencer Using an adaptation of the 8 multi-coloured LED layout, we can create the sequence for a UK traffic light. The layout is shown below, notice that the only difference is the removal of four ...

Page 21

Amicus18 Companion Shield The circuit for the traffic light sequencer is shown below: The sequence of traffic lights in the UK is shown below: The program below shows the steps required to reproduce the sequence of lights shown above: ' ...

Page 22

Amicus18 Companion Shield Sensing the Outside World Interacting with the outside world is always desirable when using a microcontroller, whether it’s choos- ing a drink in a vending machine or deciding which way a pacman will move. The easiest method ...

Page 23

Amicus18 Companion Shield The circuit for the pulled-up switch input is shown below: Open the Amicus IDE and type in the following program, or copy and paste from here: ' Demonstrate a switch input using a pull-up resistor ' Display ...

Page 24

Amicus18 Companion Shield Notice how the state of the pin is 0 when the button is pressed. This is because the weak pull-up resis- tor (22K ) holds the pin to 3.3 Volts when it’s not being operated, and the ...

Page 25

Amicus18 Companion Shield Switch Input (Pulled-Down) The layout below shows a pull-down resistance: Crownhill AssociatesLimited 2009 - All Rights Reserved Version 1.0 24 06-10-2009 ...

Page 26

Amicus18 Companion Shield The circuit for the above layout is shown below: Open the Amicus IDE and type in the following program, or copy and paste from here: ' Demonstrate a switch input using a pull-down resistor ' Display state ...

Page 27

Amicus18 Companion Shield Notice how the state of the pin is 1 when the button is pressed. This is because the weak pull-up resis- tor (22K ) holds the pin to ground when it’s not being operated, and the button ...

Page 28

Amicus18 Companion Shield Switch Debounce Mechanical switches are frequently encountered in embedded processor applications, and are inexpen- sive, simple, and reliable. However, such switches are also often very electrically noisy. This noise is known as switch bounce, whereby the connection ...

Page 29

Amicus18 Companion Shield The same layout as the pulled-up switch demonstration can be used: The circuit for the debounced pulled-up switch input is shown below: Crownhill AssociatesLimited 2009 - All Rights Reserved Version 1.0 PortB RB7 Power Push RB6 Button ...

Page 30

Amicus18 Companion Shield In order to detect and debounce a switch that is pulled down to ground through a resistor, the following code can be used. It’s essentially the same program as the pulled up version, but references to 0 ...

Page 31

Amicus18 Companion Shield Analogue Meets Digital Not everything in the microcontroller world is made up of ons or offs, sometimes the input required analogue nature i.e. a voltage. This is where an Analogue to Digital Converter (ADC) ...

Page 32

Amicus18 Companion Shield The program for the ADC demonstration is shown below: ' Demonstrate an ADC (Analogue to Digital Converter) input ' Display the state of AN0 (Channel 0 of the ADC) on the serial terminal ' Dim ADC_Input As ...

Page 33

Amicus18 Companion Shield Light Level Switch (Cockroach Mode) We can use the ADC for a more practical example now that we know it works. We’ll use an LDR (Light Dependant Resistor) as the input to the ADC, and turn on ...

Page 34

Amicus18 Companion Shield Don’t worry if the LDR you use doesn’t look like the one used in the layout as LDRs come in all shapes and sizes, but they all perform the same task. However, their light level resistance may ...

Page 35

Amicus18 Companion Shield In order to change the level of darkness that the LDR will react too is simply a matter of changing the value within the line “If LDR_Value > 400 Then”. A larger value will illuminate the LED ...

Page 36

Amicus18 Companion Shield Light Level Switch (Moth Mode) The same circuit and layout is used for the opposite reaction to light levels. The code below will illumi- nate the LED when light levels increase, just like a moth to a ...

Page 37

Amicus18 Companion Shield Temperature Sensor One of the simplest, and least expensive, temperature sensors is a thermistor. This is a special type of resistor that alters it’s resistance based upon it’s temperature. There are generally two types of thermis- tor; ...

Page 38

Amicus18 Companion Shield The circuit for the temperature layout is shown below: AN4/AN5 AN3/RA3 AN2/RA2 AN1/RA1 AN0/RA0 A program to display the the values produced from the thermistor on the serial terminal is shown below: ' Display the value of ...

Page 39

Amicus18 Companion Shield Thermostat (increase in temperature) We can use the information we have to trigger an external device, in this case an LED, when the ther- mistor reaches a pre-determined value. We know that room temperature give an ADC ...

Page 40

Amicus18 Companion Shield Thermostat (decrease in temperature) In order to illuminate the LED at lower temperatures, use the program below: ' Illuminate an LED when the temperature decreases ' Also display the ADC value of the thermistor connected to AN0 ...

Page 41

Amicus18 Companion Shield Thermostat (increase and decrease of temperature) The layout and code below allows the demonstration of high, normal, and low temperature changes. Both LEDs will be extinguished when the temperature is normal, the Red LED will illuminate when ...

Page 42

Amicus18 Companion Shield The circuit for the thermistat layout is shown below: PortA AN4/AN5 AN3/RA3 AN2/RA2 AN1/RA1 AN0/RA0 Power The code for the two LED thermostat is shown below: ' Illuminate a Red LED when the temperature increases ' Illuminate ...

Page 43

Amicus18 Companion Shield Digital Meets Analogue Sometimes the microcontroller needs to interface back to the real world with an analogue result. This is termed Digital to Analogue Conversion, or DAC. This can be performed several ways; by using a dedi- ...

Page 44

Amicus18 Companion Shield There are calculations for the values of the resistor and capacitor used, but we won’t go into that here, RC filter but a search for on the internet will produce a huge amount of information. Here’s two ...

Page 45

Amicus18 Companion Shield The circuit for the PWM1 layout is shown below: The PWM peripherals operate in the background, which means that once a PWM duty cycle is set, it does not block any other instructions from occurring. Type in ...

Page 46

Amicus18 Companion Shield Channel 2 PWM As has been mentioned, the Amicus18 has two hardware PWM channels, each can work independently of each other when adjusting the duty cycle, but share a common operating frequency and resolution. This is because ...

Page 47

Amicus18 Companion Shield Type in the following code and program it into the Amicus18 board by clicking on the toolbar and Program , or pressing F10: Include "Hpwm10.inc" WriteAnalog2(512) The LED will now be glowing, but not at full brightness. ...

Page 48

Amicus18 Companion Shield Two channels of PWM simultaneously (Pulsing Light) The layout below demonstrates both PWM channels operating simultaneously: Crownhill AssociatesLimited 2009 - All Rights Reserved Version 1.0 47 06-10-2009 ...

Page 49

Amicus18 Companion Shield The circuit for the 2 PWMs layout is shown below: The capacitors normally associated with PWM output have been dispensed with because the operating frequency of the PWM channels is so high (62.5KHz) that no noticeable flicker ...

Related keywords