1818281+1818282 Microchip Technology, 1818281+1818282 Datasheet - Page 39

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
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 value of approx
701, and any value lower than this is an increase in temperature, and a lower value is a decrease in
temperature, so even without knowing the actual temperature we can write some code:
' Illuminate an LED when the temperature increases
' Also display the ADC value of the thermistor connected to AN0
'
'
' Open the ADC:
'
'
'
'
'
'
Once the program is compiled and loaded into the Amicus18 board using the toolbar
gram
nate the LED. To adjust the threshold of the temperature trigger, alter the value within the code line:
“If ThermistorIn < 600 Then”. A lower value will illuminate the LED at higher temparatures.
Crownhill AssociatesLimited 2009 - All Rights Reserved
Include
Dim ThermistorIn As Word
Symbol LED = RB0
OpenADC(ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_0_TAD, ADC_REF_VDD_VSS, ADC_1ANA)
While 1 = 1
Wend
ThermistorIn = ReadADC(0)
HRSOut
If ThermistorIn < 600 Then
Else
EndIf
or pressing
High LED
Low LED
"ADC.inc"
"Therm =
F10
Fosc set for Fosc/32
Right justified for 10-bit operation
Tad value of 0
Vref+ at Vcc : Vref- at Gnd
Make AN0 an analogue input
, placing a finger over the thermistor, thus increasing the temperature, will illumi-
", Dec ThermistorIn, 13
Amicus18 Companion Shield
Version 1.0
' Load the ADC macros into the program
' Create a variable to hold the 10-bit ADC result
' Alias the name LED to pin RB0
' Create an infinite loop
' Read the value from the thermistor
' Has there been an increase in temperature?
' Yes. So illuminate the LED
' Otherwise...
' Extinguish the LED
' Do it forever
38
' Display the ADC value on the terminal
06-10-2009
Compile and Pro-

Related parts for 1818281+1818282