Hello,
I have a problem. I'm using PIC16F627A and PicBasic-Compiler (NOT PRO!!).
If I use e.g. the commands 'PINx' , 'Button' or 'High/Low' they all work only on PortB. Is there a possibility that they work on PortA ??
Dirk
Hello,
I have a problem. I'm using PIC16F627A and PicBasic-Compiler (NOT PRO!!).
If I use e.g. the commands 'PINx' , 'Button' or 'High/Low' they all work only on PortB. Is there a possibility that they work on PortA ??
Dirk
Hi DiGG,
Did you remember to disable the analog and comparator features on PortA?
BobK
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.
No - As I remember, PBC does not have predefined pins or directions for PORTA. You must do them directly (make sure you turn off any analog presets as Bob has noted – this requirement is PIC specific).Originally Posted by DiGGi
For example to make RA0 high,
to turn off RA0 and turn on RA1, you could then do thisCode:poke $85, %00000000 ' make all PORTA outputs poke $05, %00000001 ' set RA0 high
Ask if you need more and good luckCode:poke $05, %00000010
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks