Bonjour,
J'ai fait un petit programme pour écrire et lire le port parallèle mais ça ne fonctionne pas.
De plus quand je branche mon montage toutes les LED sont allumées, pourtant j'ai bien vérifié mon montage et je ne vois rien de particulier.
Est ce normal ou alors ai je fait une erreur quelque part ???
Voici mon code:
#include <stdio.h>
#include <string.h>
unsigned char inportb (unsigned short _port)
{
unsigned char rv;
__asm__ __volatile__ ("inb %1, %0" : "=a" (rv) : "dN" (_port));
return rv;
}
void outportb (unsigned short _port, unsigned char _data)
{
__asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data));
}
int main(int argc,char *argv[])
{
int i=0;
char out_char;
unsigned char data;
strcpy(&data,"0");
unsigned short port = 0x378;
printf("Début du test \n");
outportb(0X378,data);
printf("Fin du test \n");
data = inportb(0X378);
printf("data : %c\n",data);
return 0;
}
Avez vous une ou plusieurs idées?

Merci à vous