AMICUS18-COMPANION-SHIELD AMICUS, AMICUS18-COMPANION-SHIELD Datasheet - Page 32

Amicus18 Companion Shield

AMICUS18-COMPANION-SHIELD

Manufacturer Part Number
AMICUS18-COMPANION-SHIELD
Description
Amicus18 Companion Shield
Manufacturer
AMICUS

Specifications of AMICUS18-COMPANION-SHIELD

Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC18
Features
USB Interface, In Circuit Serial Programming Interface
Kit Contents
Board
Silicon Family Name
PIC
Silicon Core Number
PIC18F25K20
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
PIC18F25K20 Microcontroller
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
'
'
' Open the ADC:
'
'
'
'
'
'
Once the program is compiled and loaded into the Amicus18 board by clicking on the toolbar
and Program
Turning the potentiometer anti-clockwise will increase the voltage to the ADC, therefore increasing the
ADC’s value. Turning the potentiometer clockwise will decrease the voltage to the ADC, and decrease
the ADC’s value, as can be seen from the screenshot above.
Don’t worry too much is the ADC value isn’t exactly 1023 for 3.3 Volts, as it’s only a tiny fraction of the
actual value, and this will make very little difference, if any, to most programs. This can be caused by
many things, wrong
Crownhill AssociatesLimited 2009 - All Rights Reserved
Dim ADC_Input As Word
Include
OpenADC(ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_2_TAD, ADC_REF_VDD_VSS, ADC_1ANA)
While 1 = 1
Wend
ADC_Input = ReadADC(0)
HRSOut
DelayMS 500
"ADC.inc"
or pressing F10, open the serial terminal and connect to the Amicus18 board’s com port:
"ADC =
Fosc set for Fosc/32
Right justified for 10-bit operation
Tad value of 2
Vref+ at Vcc : Vref- at Gnd
Make AN0 an analogue input
Tad
", Dec ADC_Input, 13
being used, wrong
Amicus18 Companion Shield
Pot Fully Clockwise (0 Volts)
Version 1.0
Pot Mid Way (Approx 1.6 Volts)
Pot Fully Anti-Clockwise (3.3 Volts)
' Create a variable to hold the 10-bit ADC result
' Load the ADC macros into the program
Fosc
, losses in the wiring etc…
' Create an infinite loop
' Read the ADC from channel AN0
' Display the ADC value
' Delay for half a second
' Do it forever
31
06-10-2009
Compile

Related parts for AMICUS18-COMPANION-SHIELD