Re: Pins, ports and variables
Hi Malcom,
I messed with your code some & tried it on a 16F690
it compiles, dont know if it works though 
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
DEFINE OSC 4
DEFINE DEBUG_MODE 0 ' Debug sending True serial data
DEFINE DEBUG_REG_PORTA ' Debug Port = PortA as required by PICKIT2 serial Monitor
DEFINE DEBUG_BIT 0 ' Debug.bit = PortA.0
DEFINE DEBUG_BAUD 9600 ' Default baud rate = 9600
DEFINE DEBUGIN_REG PORTA' Debug Port = PortA as required by PICKIT2 serial Monitor
DEFINE DEBUGIN_BIT 1 ' Debugin bit PortA.1
DEFINE DEBUGIN_BAUD 9600' Default baud rate = 9600
DEFINE DEBUGIN_MODE 0 ' Debugin receiving data true = 0 inverted = 1
dht_data var bit[4]
dht_data0 var PORTc.0 ' RH sensor connected to pin A0
dht_data1 var PORTc.1 ' RH sensor connected to pin A1
dht_data2 var PORTc.2 ' RH sensor connected to pin A2
dht_data3 var PORTc.3 ' RH sensor connected to pin A3
y var byte
dht var byte
for y =0 to 3
'TRISc.0 = 0 '
high dht_data[y]
low dht_data[y] : pause 180 ' send 18ms low
high dht_data[y] : pauseus 300 ' send 30us hi
TRISc = %00001111
PulsIn PORTA[y], 1, dht
debug dht
next y
Last edited by Archangel; - 3rd April 2015 at 22:22.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks