View previous topic :: View next topic |
Author |
Message |
bolubeyi
Joined: 27 Apr 2012 Posts: 15 Location: TURKEY
|
pic24 series 12 or 15 pin tris setting or pin calibration ? |
Posted: Wed Aug 01, 2012 2:36 am |
|
|
hi. pic 24 series has got more than 8 pins(11 or 15).for example PIC24HJ32GP202 b port b1 b2...........b11 b12 b13. how can set tris pin b11 or b13 ?
b 11 for input => set_tris_b(0x0800); or
b13 for input => set_tris_b(0x2000);
is it true? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Aug 01, 2012 2:57 am |
|
|
Have you tried reading the manual?.
Quote:
"Parameters:
value is an 16 bit int with each bit representing a bit of the I/O port."
_16bit int_. |
|
|
bolubeyi
Joined: 27 Apr 2012 Posts: 15 Location: TURKEY
|
|
Posted: Wed Aug 01, 2012 3:34 am |
|
|
i am sorry but can you give me an example? |
|
|
andyfraser
Joined: 04 May 2004 Posts: 47 Location: UK
|
|
Posted: Wed Aug 01, 2012 6:24 am |
|
|
You gave 'us' an example in your first post |
|
|
bolubeyi
Joined: 27 Apr 2012 Posts: 15 Location: TURKEY
|
|
Posted: Wed Aug 01, 2012 7:32 am |
|
|
but i am not sure,is it true? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Aug 01, 2012 7:44 am |
|
|
Yes.
If you are having trouble, then :
What other peripherals are on the pins?. Sometimes things may need to be turned off or moved, before normal I/O operation will work.
On RB11, JTAG is normally here if I remember correctly - so this needs to be turned off in the fuses. Also the parallel master port uses some pins round here.
Remember that TRIS _will_ be automatically overridden by the compiler. If (for instance) you perform a TRIS operation selecting a pin as an input, then write something to the port, that TRIS will be cancelled. Fixed_io, or fast_io allow this behaviour to be controlled.
Best Wishes |
|
|
|