View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
#use fast_io & #use standard_io |
Posted: Fri Nov 30, 2007 2:50 am |
|
|
Dear sir,
here i am using 16f684, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.
At start of programme i set port pins as input/output using set_tris_x(); &
if i used INPUT(),INPUT_STATE() & INPUT_X()these functions, then these functions will affect on the tris register? _________________ Thank You,
With Best Regards,
Deepak. |
|
|
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Fri Nov 30, 2007 8:17 am |
|
|
If you use fast_io, then you need to set the tris regs as you indicate, and they will not change.
If you use standard_io, you do not need to set the tris regs, the compiler takes care of that for you.
Check the help file for #use fast_io, standard_io.
Ken |
|
|
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
#use fast_io & #use standard_io |
Posted: Fri Nov 30, 2007 8:30 am |
|
|
Ok,Sir
I read the help file but i couldn't understand.
So,Now consider 16f684 device.
& Pin RA0 & RA2 used as i/p rest all are o/p.And if i used #use standard_io then how the compiler will knows that,Pin RA0 & RA2 are i/p & rest all are o/p.And should i declare #use standard_io. _________________ Thank You,
With Best Regards,
Deepak. |
|
|
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Fri Nov 30, 2007 9:25 am |
|
|
Standard I/O is the default - you don't need to specify it (but it won't hurt).
If you write to a pin, the compiler makes the pin an output; if you read the pin, the compiler makes it an input (using standard i/o) - it's all taken care of for you
Ken |
|
|
|