Jocman Posted March 7, 2023 Posted March 7, 2023 Hi all. I've read several similar posts,but no solution worked to my issue. I self-made 2 type of rs485 interfaces (using MAX487): one such an embedded system for nano, one just the rs485 for Mega. The Nano embedded interface works very fine,all the Nanos connected work fine. But now I'm trying to connect a Mega (for the PVI800 keyboard). Well,it simply doesn't work..... I made some crossed test: - connect the Nano interface to Mega: it doesn't work - connect the Mega interface to Nano: it works - connected Mega as IRQ Serial : it works - connected Tx/Rx pin over all the Mega connection (tx/rx 0 to tx/rx 3) but no working When Mega is connected to its dedicated rs485 interface, the RX led stays off and the board doesn't work..... I tried with 2 different Mega Boards,but same result: if connected as IRQ Serial, both the boards do their job, but if connected via RS485 no way to make them work. Honestly i don't understand..... Both kind of interfaces are correctly working,so the problem is Mega, but why? Jocman Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
No1sonuk Posted March 7, 2023 Posted March 7, 2023 What does "connect the Nano interface to Mega" mean? If you use an RS485 network, you can only use a Mega as a master because it has more than one hardware UART. Nanos have only one UART, so the TX0 and RX0 pins are used for USB OR RS485. You can't do both on the same Nano at the same time.
Jocman Posted March 8, 2023 Author Posted March 8, 2023 (edited) I made 2 interfaces. The one for the Nano hosts a Max487 chip (and the needed components), the connectors for the nano board and the pins for wiring the panels switches/leds/others. As the Nano board is very small, it is directly mounted on the interface PCB The one for the Mega board is smaller, as it hosts only the Max487 chip and the needed components. This interface is connected to Mega board via wires: the enabled pin for RS485 is the #2, while TX and RX are wired to TX1/RX1 pins. (attached the image of both the interfaces) With some dupont wires it's "easy" to connect "on the fly" the Mega board to the interface made fo the Nano and viceversa. This way I made the cross test, so I'm sure the interface for the Mega board works, thus the problem is the Mega board (i'm referring to a Mega board as slave). When I use a Nano with both type of interfaces, by pressing the physical button the virtual button is regurarly pressed. My plans are (or were??) to connect most of the panels to Nano boards, but for some panels (as the PVI800 keyboard) I'd like to use a Mega board via RS485 The RS485 master is obviously a Mega board direct via USB. Edited March 8, 2023 by Jocman Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Vinc_Vega Posted March 10, 2023 Posted March 10, 2023 (edited) We recently had a discussion on that topic. Maybe you find the solution by using TX0 / RX0 of the Mega? Regards, Vinc Edited March 11, 2023 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Jocman Posted March 10, 2023 Author Posted March 10, 2023 Thankyou very much for your suggestion. I'll read the post and meke some test. I'll post in the next days about the news. Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Vinc_Vega Posted March 10, 2023 Posted March 10, 2023 (edited) As there are cheap Mega clones on the market, additionally you may swap TX0 with RX0. Regards, Vinc Edited March 15, 2023 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Jocman Posted March 20, 2023 Author Posted March 20, 2023 Well, after several days of testing (and swearing) suddenly something's changed. I don't know what....I just re-loaded the sketch on the board. For the sake of honesty, I tested an RS485 chain with 2 Nanos and 1 Mega. The 2 Nanos are correctly working (they communicate), but initially the mega kept not communicating. I tried (desperation?) by unplugging the dupont wires fromt TX0/RX0 and plugging into TX1/RX1 (with all the system still powered and connected to the master.) The mega started to communicate..... Then unpowered the system and powered again: the mega didn't work. Unplugged the wires again and plugged back to TX0/RX0: it started to work again.... Unpowered then powered: the mega didn't work again.....unplugged and plugged the wires again (this time on the same TX0/RX0): the mega works..... I don't understand, what's wrong??? Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Recommended Posts