Hello,
I have a problem that drive me nuts for a while : how to make leds linking :(
I'm using a 16F88 with following program :
/* ----------------------------------------------------------------------- */
/* Fichier source modèle généré par Piklab */
#include <pic16f88.h>
/* ----------------------------------------------------------------------- */
/* Bits de configuration: adapté à votre dispositif et à vos besoins */
typedef unsigned int word;
word at _CONFIG1 CONFIG1 = _WDT_OFF & _PWRTE_OFF & _INTRC_IO & _MCLR_OFF &
_BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_PROTECT_OFF & _DEBUG_OFF & _CCP1_RB0 &
_CP_OFF;
word at _CONFIG2 CONFIG2 = _FCMEN_OFF & _IESO_OFF;
#define LED RA0
void main() {
int i;
/* Initialisation general*/
OSCCON = 0b01110000; // Oscillateur interne a 8Mhz
/* Initialisation des IO */
ANSEL = 0; // Port a en Numerique
TRISA = 0; // Tout en sortie
TRISB5 = 0; // RB5/TX en sortie
while(1){
PORTA = 255;
RB5 = 0;
for(i=0;i<30000;i++);
PORTA = 0;
RB5 = 1;
for(i=0;i<30000;i++);
}
}
So nothing complex :)
It's working find on GPSIM ... but when I put it on a real PIC, nothing
happens. Both port A and PortB.5 stay low.
The circuit is very simple :
* + 5v on Pin 14
* GND on Pin 5 and that's all.
It's only for testing purpose.
I've tried to burn my PICs on PIKLab under linux and using ic-prog under W98
(hum, yes, my last and only PC under windows) but same result.
Is my prog guilty ? Else where is my mistake.
Now I'm wandering if the problem isn't my power supply : a stock 220v -> 6v CC
adapter which is expected to be stabilized.
Any help welcome :)
Best regards,
Laurent
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user