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 CCS Technical Support

#use fast_IO(c)

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







#use fast_IO(c)
PostPosted: Mon Jun 09, 2003 9:05 am     Reply with quote

HELLO
If I do use fast_IO(c) in the my code, the portc doesn't function. If I do use standard_io the Portc is right,

#include <18F252.h>
#device adc=8
#use delay(clock=40000000,RESTART_WDT)
#fuses H4,PUT,BROWNOUT,WDT1,nolvp
#use fast_io(c)

set_tris_C(0);

do {

output_high(PIN_c0);

output_low(PIN_c0);
restart_wdt();
} while(1);

Some idea?
Thank in advance
Albert
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515111
R.J.Hamlett
Guest







Re: #use fast_IO(c)
PostPosted: Mon Jun 09, 2003 10:29 am     Reply with quote

:=HELLO
:=If I do use fast_IO(c) in the my code, the portc doesn't function. If I do use standard_io the Portc is right,
:=
:=#include <18F252.h>
:=#device adc=8
:=#use delay(clock=40000000,RESTART_WDT)
:=#fuses H4,PUT,BROWNOUT,WDT1,nolvp
:=#use fast_io(c)
:=
:=set_tris_C(0);
:=
:=do {
:=
:=output_high(PIN_c0);
:=
:=output_low(PIN_c0);
:=restart_wdt();
:=} while(1);
:=
:=Some idea?
:=Thank in advance
:=Albert
I think you will find, it is working, but is now too fast!...
The problem is that the bit set/reset functions, do a read modify write cycle. Now with standard IO, there is also an access to the TRIS register, which allows time for the signal to settle. Unfortunately, if instead you use fast_io, and do two operations in rapid sequence like this, there is not time for the chip to respond. There are warnings about this in the MicroChip data sheets, and 'example' files for the PIC.
Stick a tiny delay between setting, and clearing the bit.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515117
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