How can i disable them?
Hi DiGGi,
It usually depends on what's in the data sheet for the particular PIC you are using. These are something like: ADCON1 = 7 to disable the analog inputs and make the pins digital and CMCON = 7 to disable the comparators. There is a section in the PIC datasheet for each of these 2 items. Go to www.microchip.com and in the search field enter the part number you want a manual for. example: PIC16F628. This will give you selections on all the available documents for that part.
ADCON1 and CMCON are then placed in your initialization section of your program.
Please bear in mind that PICs that have analog ports don't necessarily have comparators. This is why you need to have the datasheet handy to refer to.
BobK
Hi,
fiorst ThX for your help, but in my data sheet there is no ADCON1 and CMCON.
is there an other solution , for PIC16F627A?
Diggi
Ok i do a try, PicBasic is far different from PBP...
try
refer to figure 4-2 of the datasheet for the memory map, and section 10 for the comparator moduleCode:POKE $1F,7 ' disable comparator
About 'Pin' Statement... i guess it's valid but i can't confirm how and why... time for me to purchase PBC. I hate to guess..
Last edited by mister_e; - 10th September 2006 at 17:46.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
hi
Thank you both.
@paul borgmeier, yes i know but i want to read the pin states seperately
@mister_e the command you sent is working in PB but how can i controle the Pins on PortA with comands like Button/Pin ?
Dirk
Not tried but should workOriginally Posted by DiGGi
Code:poke $85, $04 ' make RA2 an input ... peek $05, B0 ' read all of PORTA B0=B0 & $04 ' isolate bit 2 IF B0 = 0 then TurnOFF do something here if B0 = 1 goto IFEXIT TurnOFF: do something here if B0 = 0 IFEXIT: ...
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Edit: nevermind... too late![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve,Originally Posted by mister_e
No need to buy PBC or guess - the manual is free online on MELABs site.
http://www.melabs.com/resources/index.htm#Manuals
Paul Borgmeier
Salt Lake City, UT
USA
__________________
hi
The text in '2.2. The Pins' chapter says that PIN, Button - Commands only work on PortB. That is annoying.
If I would use PEEK the stats of every pin would be written in a var.
E.G. Pin 4 and Pin 6 are high , tha var would look like %01010000.
Is that right?
Yes - BITWISE operate to find what you want. See the LET command for more in the PBC manual and my example above your last post.Originally Posted by DiGGi
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks