MrDEB
Well-Known Member
been hacking at this most of the day.
Thought I had found the problem but to no avail
I connected a NEW ds18B20 to Junebug via the con4 port.
used this code, programed the Junebug, using pickit2 clicked on the usart tool.
perhaps something in the code hopefully.
Have A3 to pin 3, A4 to DQ and then grd (con4 connections)
nothing??
Thought I had found the problem but to no avail
I connected a NEW ds18B20 to Junebug via the con4 port.
used this code, programed the Junebug, using pickit2 clicked on the usart tool.
perhaps something in the code hopefully.
Have A3 to pin 3, A4 to DQ and then grd (con4 connections)
nothing??
Code:
// device and clock speed...
device = 18F1320
clock = 8
config OSC = INTIO2, WDT = OFF, LVP = OFF
// import modules...
include "DS18B20.bas"
include "convert.bas"
include "usart.bas"
// FAMILY $28 ($1D) ($0000002CDBAE) <- DS18B20
// FAMILY $28 ($3F) ($0000002CD16E) <- DS18B20
const Sensor_A(8) as byte = ($28, $AE, $DB, $2C, $00, $00, $00, $1D)
const Sensor_B(8) as byte = ($28, $6E, $D1, $2C, $00, $00, $00, $3F)
// display a sensor value...
sub DisplaySensor(byrefconst pID() as byte)
dim TempA as shortint
dim TempB as word
RomID = pID
Convert
GetTemp(TempA, TempB)
USART.Write(DecToStr(TempA),".",DecToStr(TempB,2), $BA, "C",13,10)
end sub
// program start...
SetBaudrate(br115200)
SetPin(PORTA.4)
while true
DisplaySensor(Sensor_A)
DisplaySensor(Sensor_B)
delayms(1000)
wend
[/code/