i am programming a pic16f648 for the first time. in the manuel i found a statement that says the pin number has nothing to do with the physical pin number. How do I assign know which physical pin number will be used for each pin of a port
i am programming a pic16f648 for the first time. in the manuel i found a statement that says the pin number has nothing to do with the physical pin number. How do I assign know which physical pin number will be used for each pin of a port
Doesn't the datasheet show you what port numbers are assigned to what physical pin numbers? It's usually right near the front of the specific PIC datasheet.
Bart
Hello Cheznez,
Chez>>i am programming a pic16f648 for the first time. in the manuel i found a statement that says the pin number has nothing to do with the physical pin number. How do I assign know which physical pin number will be used for each pin of a port<<
Most chips that I know of, have a little indent, or dot on the #1 pin of the chip, and you count clockwise or counter clockwise for the pin numer.
You have to look at the DATA sheet for the PIC chip you are using.
For example the chip has 8 pins.....
PortA has 8 pins, but for a ADC pin there may be 5 of them. Pins number 0,1,2,3,7. but on your Switch part of the program (the headers that tell the chip which pins you are using for ADC), It keeps them in order.
so activating a ADC would be like
ADCON1="00011111" 'Activating all 5 ADC's on pin 0,1,2,3,7
not
ADCON1="10001111"
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
If you refer to ident pin like for
HIGH PinNumber
as
HIGH 0
you'll find some information in the page 26 of the PBP manual.
BUT i'll prefer to use PIN NAME instead of pin number... more easy to read.
ex:
HIGH PORTB.0
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hello Steve,
Steve>>BUT i'll prefer to use PIN NAME instead of pin number... more easy to read.
ex:
HIGH PORTB.0
<<
I agree Steve... Makes a heck of a lot easier to debug too. You are not constantly referring back to a previously assigned Pin Value.
I do the same with the header variables too. I realize that using certain functions will automatically assign a pin to a input or output, but I use (by habit) the Header assignments for safety sake <g>.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks