ECACE
Joined: 24 Jul 2006 Posts: 94
|
|
Posted: Thu Jan 31, 2008 5:18 pm |
|
|
1) Page 119 of the compiler manual --
From the manual:
Syntax:
#use fast_io (port)
Elements:
port is A-G
Purpose:
Affects how the compiler will generate code for input and output instructions that follow. This directive takes effect until another #use xxxx_IO directive is encountered. The fast method of doing I/O will cause the compiler to perform I/O without programming of the direction register. The user must ensure the direction register is set correctly via set_tris_X(). When linking multiple compilation units be aware this directive only applies to the current compilation unit.
--- In other words ---
If a port is not set to fast I/O, then every time you access it, the compiler will set the direction registers, when you add the fast_io, you have to set the direction yourself
2) Not sure if I understand your question: If you look at the datasheet for the 16F876A, you will notice that port_b is mapped to location 0x06. So in your program, you need to tell the compiler when you refer to 'port_b', you are refering to location 0x06. _________________ A HW Engineer 'trying' to do SW !!! Run!!! |
|