Jump to content

midi et pic


lthomas
 Share

Recommended Posts

Bonjour,

Je recherche de l'aide pour débuger un programme d'un PIC16F877A car après multiples recherches et essais le montage ne fonctionne toujours pas.

Je souhaite simplement faire jouer une note à mon expandeur, concrètement il faut envoyer les messages  adaptés (noteon, canal, N°note, vélocité)

Je programme en C avec le compilateur CC5X, le pic tourne à 20MHz.

Voici le programme :

void initialisation(void)

{

TRISC = 0x00;

TXSTA = 0b10010000;

SPBRG = 0x27;

}

void envoi(char data)

{

while(!TRMT);

TXEN = 1;

TXREG = data;

}

void main(void)

{

initialisation();

envoi(0x90);

envoi(0x3C);

envoi(0x7B);

while(1);

}

Ce projet n'a pas grand chose à voir avec une midibox, mais il doit bien y avoir des spécialistes du midi ici !

Le problème ne vient sans doute pas du montage électronique, donc c'est forcément un problème de programme, et je n'arrive pas à le résoudre !

L'expandeur ne sort aucun son, il affiche juste MIDI OFF LINE lors du lancement du pic.

Merci pour votre aide

Thomas

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...