CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

fast io

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pic my name
Guest







fast io
PostPosted: Sun Feb 22, 2004 9:45 am     Reply with quote

hi guys, i was programming a 16f877a to read a pin and output on another pin when it went high. I am trying to modify a pulse width modulation signal. I didnt have internet access there and only just read about the fast io just now.

my question is when i go in tomorrow and set the port for fast io will there be any noticable increase in pin reads or writes?

cant test it till tomorrow, but i gotta know Smile
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 22, 2004 12:43 pm     Reply with quote

A quick test with the compiler and viewing the LST file:

Code:

0000                00306 .................... #use fast_io(b)
0000                00307 ....................    set_tris_b(0x00); // all output
009E 3000       00308 MOVLW  00
009F 0066       00309 TRIS   6
0000                00310 ....................    output_high(PIN_B0);
00A0 1406       00311 BSF    06.0
0000                00312 ....................    output_low(PIN_B0);
00A1 1006       00313 BCF    06.0
0000                00314 ....................
0000                00315 .................... #use standard_io(b)
0000                00316 ....................    output_high(PIN_B0);
00A2 1683       00317 BSF    03.5
00A3 1006       00318 BCF    06.0
00A4 1283       00319 BCF    03.5
00A5 1406       00320 BSF    06.0
0000                00321 ....................    output_low(PIN_B0);
00A6 1683       00322 BSF    03.5
00A7 1006       00323 BCF    06.0
00A8 1283       00324 BCF    03.5
00A9 1006       00325 BCF    06.0


At the top you see I have #use fast_io(B). Then I set all the bits to output. After that every time I set or clear an individual bit it is one instruction. This would also go for writing all bits in the port with "output_b(bytevalue)".

Then for a test I switch back to #use standard_io(B). Now you see the compiler is inserting a bunch of port direction control instructions. In fact it looks like it is flipping the port back and forth between read and write each time I change the value.

So fast_io means one instruction per port write/read (plus one to configure the port initially) and standard_io is using 4 each time I read/write to the port.

I only tested code generation with one version of the compiler (V3.182) and for one chip (PIC16F88).

If I remember correctly this information is given in the help file but I can't say if it is linked to the #use or the output/input instructions. Sometimes the help file doesn't have everything cross referenced as well as it could.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group