Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

mcp9700 with pic18f46k20 using PICBasic

Status
Not open for further replies.

jmie

Newbie level 4
Joined
Dec 9, 2009
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,349
hi guys.. i'm doing a project which use mcp9700 to measure temperature interfacing with pic18f46k20, then display on LCD and hyper terminal..here's my code PICBasic below:


INCLUDE "modedefs.bas"
define osc 20
define LCD_DREG PORTD
define LCD_DBIT 4
define LCD_RSREG PORTD
DEFINE LCD_RSBIT 2
define LCD_EREG PORTD
define LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
'HIGH PORTD.1
C VAR WORD

define ADC_BITS 10
define ADC_CLOCK 3
define ADC_SAMPLEUS 50

lmtemp var word
temp var word

quanta con 1250
TRISE = %11111111
ADCON1 = 0


MAIN:
ADCIN 6, lmtemp
temp = ((lmtemp/100)/2)+8-50

;PORTA.1=1
;C=PORTE.1
'LOW PORTD.1
LCDOUT $FE,1
LCDOUT " Programmed by"
LCDOUT $FE,$C0
lcdout "Jmie TEMP="
LCDOUT #temp
LCDOUT " C"
'Serout portb.0,N9600,["The Room Temp Are Now ",#temp,"C",10,13,32]
Serout portb.0,N9600,["The Room Temp Are Now ",#temp,"C",13]

PAUSE 200
GOTO MAIN
end

is it correct for the temperature equation??

LCD is working fine but i have a problem to display at hyper terminal because when i change my pic18f46k20 to pic16f877A, it will display at hyper terminal..so..what's wrong with my pic?is it about baud rate?

i hope guys can help me...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top