PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 09, 2008 1:07 pm |
|
|
That will work. You need to tell the compiler that you want to set TRIS
for Port B, by using the #use fast_io directive. See the manual.
But you can also just let the compiler set the TRIS. Don't use Fast i/o
mode, and don't write directly to Port B. Instead, use the CCS pin and
port i/o functions, such as output_low(), output_high, output_b(), etc.
These are in the manual. The compiler will "know" the proper TRIS
settings for the function that you use, and set the TRIS for you.
It's much easier to write programs this way. It's one of the good things
about the CCS compiler (which is not even advertised as an important
feature). |
|