|
|
View previous topic :: View next topic |
Author |
Message |
acid Guest
|
#use fast_IO(c) |
Posted: Mon Jun 09, 2003 9:05 am |
|
|
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) |
Posted: Mon Jun 09, 2003 10:29 am |
|
|
:=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 |
|
|
|
|
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
|