Ahche, I ment to prepare a code like this:
Code: Select all
procedure Delay200;
begin
delay_ms (200);
end;
procedure chaser1;
begin
GPIO:=$01 ;
Delay200;
GPIO:=$02 ;
Delay200;
GPIO:=$04 ;
Delay200;
GPIO:=$10 ;
Delay200;
GPIO:=$20 ;
end;
The compiled code will occupy considerably less space in your PIC.
ahche wrote:
PS : I have some other questions . The first : How i can make the device go in slippnig mode ? (much smaller consumation )
I am not sure if I understand you correctly but if you want to use "low power" mode for your PIC you need to use LP oscillator (not XT or HS) config bits and very low Xtal frequency (32,768 kHz). Please study the datasheet for your specific PIC - it always states the maximum LP frequency and it also recommends capacitors to be used with that particular Xtal. The lower the frequency, the lower the consumed power.
With 16F84A and 32,768 kHz Xtal the consumption of my devices is usually somewhere around 500 uA. Pay also attention to the PIC specifics! You cannot use 32,768 kHz Xtal for 20 MHz flavour of 16F84A. It would not work. You need to pick the 4 MHz one.
But I am also a newbie to PICs and mikroPascal so if someone more experienced can advice, please go ahead.