Here's a little program which link the LED ( sorry comments are write  
in french because i am french :-) )
i think it can works on 16f84. I'm working now on it but i hav'ent  
tested on 16f84. Its work fine on 16f690

#include <pic16f690.h>
/*   clignotement d'une diode a une fréquence donnée */

typedef unsigned int word;
word at 0x2007 __CONFIG = (_INTRC_OSC_NOCLKOUT & _CP_OFF & _WDT_OFF &  
_BOR_OFF & _PWRTE_ON & _MCLRE_OFF & _IESO_OFF & _FCMEN_OFF);

void attente(unsigned char k, unsigned char l) /* Routine de  
temporisation  */
{
        unsigned char i,j;
        for(i=0;i<=k;i++)
                for(j=0;j<=l;j++);
}

void main()
{
        
                TRISC = 0x00;/* postionnement de PORTC en sortie */
                while(1)
                {
                        PORTC = 0x01;
                        attente(50,50);
                        PORTC = 0x00;
                        attente(50,50);
                }
        
}


Le 4 juin 08 à 09:54, John J. McDonough a écrit :

> Unless you are using a VERY slow clock, the LED on RB0 should  
> blink, but it
> will blink so fast you won't see it.
>
> --McD
>
> ----- Original Message -----
> From: Get Started
> To: [email protected]
> Sent: Wednesday, June 04, 2008 9:46 AM
> Subject: [Sdcc-user] simple program
>
>
> Is this program correct? This should work? (blinking led)
>
> #include "pic16f84.h"
> void main()
> {
>     TRISB = 0;
>     for (;;)
>     {
>         PORTB = 0;
>         PORTB = 1;
>     }
> }
>
>
>
>
>
> ---------------------------------------------------------------------- 
> ---
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Sdcc-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to