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

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
The circuit for the thermistat layout is shown below:
The code for the two LED thermostat is shown below:
' Illuminate a Red LED when the temperature increases
' Illuminate a Green LED when the temperature decreases
' Also display the ADC value of the thermistor connected to AN0
'
'
' Open the ADC:
'
'
'
'
'
'
Crownhill AssociatesLimited 2009 - All Rights Reserved
Include
Dim ThermistorIn As Word
Symbol GreenLED = RB0
Symbol RedLED = RB1
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
ElseIf ThermistorIn > 750 Then
Else
EndIf
High RedLED
Low GreenLED
Low RedLED
High GreenLED
Low GreenLED
Low RedLED
"ADC.inc"
"Therm =
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
", Dec ThermistorIn, 13
Amicus18 Companion Shield
AN4/AN5
AN3/RA3
AN2/RA2
AN1/RA1
AN0/RA0
Version 1.0
PortA
Power
GND
GND
RA4
3V3
Rst
Vin
5V
Thermistor
' Load the ADC macros into the program
' Create a variable to hold the 10-bit ADC result
' Alias the name GreenLED to pin RB0
' Alias the name RedLED to pin RB1
-t
' Create an infinite loop
' Read the value from the thermistor
' Has there been an increase in temperature ?
' Yes. So illuminate the Red LED
'
' Has there been a decrease in temperature?
' Yes. So Extinguish the Red LED
' Illuminate the Green LED
' Otherwise...
' Extinguish the Green LED
' Extinguish the Red LED
' Do it forever
Extinguish the Green LED
10K
Ω
41
' Display the ADC value on the terminal
LED
47
Ω
LED
47
Ω
PortB
Power
GND
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
06-10-2009

Related parts for 1818281+1818282