Show Posts
|
|
Pages: 1 ... 49 50 [51]
|
|
751
|
Forum 2005-2010 (read only) / Français / Re: Newbie et Carte relais rs-485
|
on: April 28, 2010, 07:01:58 pm
|
Merci pour ta réponse startx  Pour l'instant, je continue mes essais, sans succés hélas... Si je suis les différents avis récoltés, j'ai une topologie type 'mirroir' avec 2 SN75176, le premier en emission piloté par l'Arduino, le second en reception pilotant ATty... ARDUINO|SN75176|OUTPUT CONTROLER(with SN75176) Tx-------->Di----A------>A Rx-------->Ro-----B------>B Int-------->Re/De J'envoie un bit 0 sur Re/De, pour déterminer la direction des données (Tx), puis je balance ma trame... Je ne trouve hélas pas de code détaillé relatif au rs485 ayant cette configuration !!! :-[ Si quelqu'un pouvait m'écrire une code simple, détaillé, avec la commande en décimale afin que je puisse valider mes suspiçions ??? @++ Ps : Startx, peux-tu m'orienter vers la carte que tu as opté ???
|
|
|
|
|
753
|
Forum 2005-2010 (read only) / Français / Re: Newbie et Carte relais rs-485
|
on: April 23, 2010, 05:54:56 pm
|
Schema ici :: http://guilde.cwahi.net/code :
// "TEST DES CARTES RELAIS RS-485"
// "Communication Parameters :" // "8 Data, 1 Stop, No Parity" // "Baud rate : 9600"
// "Commands :" // "OFF command : FF 01 00 (HEX) or 255 1 0 (DEC)" // "ON command : FF 01 01 (HEX) or 255 1 1 (DEC)"
#define Rx 15 #define Tx 14
int inbyte = 0;
void setup(void) { Serial.begin(9600); Serial3.begin(9600); pinMode(Rx, INPUT); pinMode(Tx, OUTPUT); digitalWrite(Tx, LOW); digitalWrite(Rx, LOW); Serial.println("Setup ok"); }
void loop() { digitalWrite(Tx, HIGH); Serial.println("init"); delay(1000); // if (Serial3.available() > 0){ // Serial.println("loop"); delay(10); Serial3.print('FF 01 01', HEX); Serial3.println(); delay(100); digitalWrite(Tx, LOW); delay(1); digitalWrite(Rx, HIGH); delay(1); inbyte = Serial3.read(); Serial.println(inbyte, DEC); delay(100); Serial3.flush(); digitalWrite(Rx, LOW); } //}
|
|
|
|
|
754
|
Forum 2005-2010 (read only) / Français / Re: Newbie et Carte relais rs-485
|
on: April 23, 2010, 04:56:23 pm
|
|
Merci pour ta réponse.
En effet, je me suis posé la question de la compatibilité. La carte relais posséde pourtant un chip SN75176BP (sur la petite carte controler) couplé avec un chip ATMEL ATTINY2313-20PU (pour la gestion du canal, je suppose)
En effet, peut-être un problème de cablage. quoique je penche de plus en plus vers un souci de programation, je doute sur la trame à envoyé.
Je completerais le sujet avec schema et code au plus tôt...
@+
|
|
|
|
|
755
|
Forum 2005-2010 (read only) / Français / Newbie et Carte relais rs-485
|
on: April 23, 2010, 11:08:24 am
|
Bonjour, Tout nouveau dans le monde Arduino, je m'éclate avec ma Mega... Pourtant, je suis face à une difficulté relative au protocole rs-485. J'ai fait l'acquisition de deux cartes relais rs-485 à 8 canaux sur le sîte de sigma-shop : http://www.sigma-shop.com/product/47/rs485-8-channel-relay-controller-12vdc-rs485-bus-id-01-relays-1-8.html8 data, no parity, 1 stop bit J'ai fait different essais, de cablage, de programation...je suis perdu. La commande semble relativement simple : Relay 1 commands: OFF command : FF 01 00 (HEX) or 255 1 0 (DEC) ON command : FF 01 01 (HEX) or 255 1 1 (DEC) J'ai tenté le port serie 3 et 2, avec differentes commandes du type : Serial3.println('FF 01 01', HEX); ...mais rien n'y fait !!! Si quelqu'un possède une telle carte relais ou a la possibilité de m'aider, je suis preneur...
|
|
|
|
|
760
|
Forum 2005-2010 (read only) / Interfacing / Re: 8 channel relay board using rs-485 proto
|
on: April 28, 2010, 07:17:21 pm
|
Thanks all  From now, i understand a little better what is rs485. But i have no issue with my board !!! I have this configuration : ARDUINO|SN75176|OUTPUT CONTROLER(with SN75176) Tx-------->Di----A------>A Rx-------->Ro-----B------>B Int-------->Re/De The Arduino transmit data via an SN75176 to the onboard one wich is in receipt mode...The two SN75176 are in 'mirror' topology (A to A, and B to B). I couldn't find such topology on web !!! First, I send a 0 bit to Re/De to set direction (Tx), and data after. Could someone write me a simple and detailed code to help me validate my scheme ???
|
|
|
|
|