PDA

View Full Version : Problem with porta for 16F886(PIC 28X1)



Anghel Cosmin
- 25th February 2009, 16:13
Hi all!
I have problems with making portA for 16F886(PIC 28X1) a digital input. I use PICAXE Programming Editor, downlowd't from picaxe.co.uk in basic language, not assembler. So, I need a code to transform portA pins from analogue in digital input, and when I perform the program , the leg 2,3,4,5 I want to appear like inputs.

PS: For my hobby project I need 12 digital inputs an 8 outputs. If I perform a simple program like:

"main:
let pins=outpins
goto main"

it appear to the monitor a PIC 16F886 just with 8 inputs and 8 outputs and i don't know how make the portA pins became - and apper in simulate - digital inputs:(((

If you can help me, please-please from my heart just do't!!!
Sorry for my english! :))) I'm a romania beginner.

mister_e
- 25th February 2009, 16:20
Can't help with your programming environment/setup as we use Melabs PICBasic Pro here, but you may have a look at PIC16F886 datasheet.

Section 8 Comparator
CM1CON0 = 0 ' disable comparator
CM2CON0 = 0 ' disable comparator

Section 9 ADC
ANSEL=0 ' disable all ADC

PicAxe forum
http://www.picaxeforum.co.uk/

Anghel Cosmin
- 26th February 2009, 13:07
Thank you very much for your help! I posted my problom to the picaxe forum and i hope to resolve this impediment. So, thank you very much again!