Searching \ for 'newbie, pic basic' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/begin.htm?key=basic
Search entire site for: 'newbie, pic basic'.

Truncated match.
PICList Thread
'newbie, pic basic'
1998\07\27@133730 by Ryan Pogge

flavicon
face
I *just* started messing with electronics so I know very little.
I am trying to interface a PIC 16F84 with an LM75 temp sensor and send
results to a serial LCD.
I am useing PIC BASIC
can anyone help me with my code/hardware? I don't think I have it right?
thanks a bunch.. I realy want to get this working!
Regards,
Ryan


Symbol  con = %10010000    '(pins 5,6,an7 on the LM75 tied to ground)
Symbol  addr = B5                   '

Loop:
      addr = 17                  ' Set address to 17
       I2Cin con,addr,B2   ' Read data at address 17 into B2

(equation here?...is data read from LM75 in correct format?)

'send to serial LCD

Symbol SO = 0                              '  Serial Out
(this is pin A0 I think)
  Serout SO, N9600, (B2)             ' Send Character     at 9600 to serial
LCD
   Pause 50
     Goto Loop                                 ' go again

1998\07\28@145040 by George Varga

flavicon
face
Hi Ryan and Folks,

> I am trying to interface a PIC 16F84 with an LM75 temp sensor and send
> can anyone help me with my code/hardware? I don't think I have it right?

> Symbol  con = %10010000    '(pins 5,6,an7 on the LM75 tied to
ground) The good controll byte is the 01001000

> Symbol  addr = B5                   '



??? >        addr = 17                  ' Set address to 17
Ryan, there is only 4 registers in the LM47

00000000=temperature reg.
00000001=conmfiguration reg.
00000010=T_hyst
00000011=T_os
So, if you would like to read the temperature your address is 0 .


>         I2Cin con,addr,B2   ' Read data at address 17 into B2

You can read 8 bites of the temperature register with the following
program.

symbol  con=%01001000
symbol  addr=b2
symbol  temp=b0

addr=%00000000
I2cin con,addr,temp
.
.
.
.

Unfortunatelly the Pbasic compiler can't read the 16 bit from the
LM75 so we loose the two lsb bits( I think).
If we want to get the another 8 bits we have to ask the listers to
help us (please).

Chers George

1998\07\28@152317 by ryan

flavicon
face
> > Symbol  con = %10010000    '(pins 5,6,an7 on the LM75 tied to
> ground) The good controll byte is the 01001000

it says on the lm75 data sheet that it is 1001xxx  where the x's are pins
5-7.
ahh I see now I added the extra 0 to the wrong end to get 8 bits right.


> Ryan, there is only 4 registers in the LM47
47? its a 75 :)

> 00000000=temperature reg.
> 00000001=conmfiguration reg.
> 00000010=T_hyst
> 00000011=T_os

what are these for?(T_hyst,T_os)

> So, if you would like to read the temperature your address is 0 .
> You can read 8 bites of the temperature register with the following
> program.



> symbol  con=%01001000
OK

> symbol  addr=b2
what does b2 stand for? is this the variable it is stored in?

> symbol  temp=b0
what does b0 stand for? is this the portb.o pin?   sorry Im still learning
this stuff :)

> addr=%00000000
OK

> I2cin con,addr,temp
OK


> Unfortunatelly the Pbasic compiler can't read the 16 bit from the
> LM75 so we loose the two lsb bits( I think).
> If we want to get the another 8 bits we have to ask the listers to
> help us (please).


hmm someonesaid to me something about useing 9 bits and looseing a little
accuracy , duno what though.(bad memory)

regards,
Ryan Pogge

1998\07\28@162819 by Jeff Dickson

flavicon
face
The latest Borland (inprise) C++ stuff lets you do 16 bit apps.
Let's upgrade, so we can get away from that DOS box and maybe
get some reasonably intelligent code.

1998\07\28@171738 by Ryan Pogge

flavicon
face
OK
where do I get this c++ compiler?




>The latest Borland (inprise) C++ stuff lets you do 16 bit apps.
>Let's upgrade, so we can get away from that DOS box and maybe
>get some reasonably intelligent code.
>

1998\07\29@062927 by Caisson

flavicon
face
> Van: Jeff Dickson <spam_OUTdicksonTakeThisOuTspamMICRO.CALTECH.EDU>
> Aan: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
> Onderwerp: Re: newbie, pic basic
> Datum: dinsdag 28 juli 1998 22:17
>
> The latest Borland (inprise) C++ stuff lets you do 16 bit apps.
> Let's upgrade, so we can get away from that DOS box and maybe
> get some reasonably intelligent code.

Placing a 747-airplane's cockpit-controlls in a truck does not make the
truck more intelligent.  It just gets more shiny lights & buttons to press.
(refering to Win?? ontop of DOS)

Who does not know the "blonde" jokes : Nice to look at, but no
intelligence. :-)

Greetz,
 Rudy Wieser

1998\07\29@113502 by George Varga

flavicon
face
Hi,

> ahh I see now I added the extra 0 to the wrong end to get 8 bits right.
Yes Sir.

> > Ryan, there is only 4 registers in the LM47
> 47? its a 75 :)
Of course 75 I did a mistake.

> > 00000000=temperature reg.
> > 00000001=configuration reg.
> > 00000010=T_hyst
> > 00000011=T_os
> what are these for?(T_hyst,T_os)

There is an output pin in the LM75 called Overtemperature Shoutdown.
If temperature is over than the data in the OS resister the OS
pin is goes low according to the power up default.

The T_hyst is the hysteresis register.
If the temperature less then OS-Thyst the OS pin goes high.

> > symbol  addr=b2
> what does b2 stand for? is this the variable it is stored in?
I put the address into a variable because we can change the address
from 0 to 3


> > symbol  temp=b0
> what does b0 stand for? is this the portb.o pin?   sorry Im still learning
> this stuff :)
It's not the port B pin.
The b0 is a variable which stores the temperature.

> > Unfortunatelly the Pbasic compiler can't read the 16 bit from the
> > LM75 so we loose the two lsb bits( I think).
> > If we want to get the another 8 bits we have to ask the listers to
> > help us (please).
>
>
> hmm someonesaid to me something about useing 9 bits and looseing a little
> accuracy , duno what though.(bad memory)

Yes, we loose only one bit. The lsb is a 0.5 Celsius but the
1 celsius accuracy is a not too big deal.


regards,
George

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...