Start a new topic
Not Taken

Put the serial into listen mode

 Hi guys

I don't know if this idea has any merit or not but I was thinking that if the serial comms could be but into a listen only mode and the display be given an address then you could hang multipal displays of the one comms line.

Any way I am having a lot of fun with the display its making life much easier, thank you for such a great product.


Cheers

Mark


Hi Raphael Thanks for the idea, I guess I could always put a t1 and t3 into nextion2 on an unused page so I don't get lots of error messages. My project is to replace five analogue current meters with individual nextions, I'm thinking to not have the nextion touch screen talk to the main processor but to change screens and maybe reset individual counters in the display. Thanks, it will be a while till I get things up and running when I do I'll post my project and any solution Cheers Mark

If you need to send commands from only one Nextion, you connect TX from this Nextion to RX on MCU.

In addition you connect RX from MCU to TX on all Nextions.


image


In this example, the text component t0 exists on the three Nextions, whereas t1, t2 and t3 exist on one Nextion only. Button b2 on Nextion 2 is used to send a command to MCU.

Of course Nextion 2 will send an error message to MCU when MCU sends t1.txt="xx" or t3.txt="xx", since Nextion 2 doesn't have t1 and t3 text components.

NB: I have not tested this solution, it is just a concept.

How many displays is ... most of the displays?

For this project most of the displays will just be indicators but it would be nice to be able to interigate each display from the main program

@Mark Saunders

I have an application where I need to monitor and control a small scale off grid power station and I will be using these displays to replace mechanical meters.


Do you only need to send data from the MCU to the displays, or do you also need to send commands from the displays to the MCU?

Not sure which model you have. 

   Look up Data sheet for your model - says TTL, no?

   TTL is an idle high 5V characteristic .. not rs232.


Press Compile - watch Output pane, no?

  Global + Page SRAM = Total SRAM for page

  TFT File Size given at end of compile

   Breakdown at beginning tallied font and pictures

Data sheet for your model says? Model dependent

   SRAM can be 3584 Bytes or 8192 Bytes for HMI

   Flash space for TFT file can be 4M 16M or 32M


   

Are the serial subsections in the chip hard wired to actual pins or are the selectable? Emulate was probably the wrong term but true rs232 also has drive voltage specifications ie + - 12 volt output I'd say the controller uses general i/o pins either hard wired or selectable to the serial sub section. Completely off topic but can you tell in the IDE how much resources ar being used ie have I filled up my available space?

Why would the display emulate serial?  Such would be a flakey connection compared when 2 to 3 good hardware ports exist.  Flakey connection wouldn't be worth selling.  no? ;)

Talking to several displays is easy enough just have to have enough serial ports. I was just thinking that the display probably just emulates a serial port ( is just using general I/o ports on the controller ) so it would be a relitavly easy mod to put the transmit line into a tri state mode until it hears its address. That way you just need one cable running around your setup daisychained all you displays together. The nextion is smart enough to store any touch events or increment counters ect and the master controller could just pole each display to get / send any current data. If I get enough spare time I'll just program up a small pic chip to be an interface for my project and attach one to the back of each display. I must say I'm having a ball playing with these displays the quality and features are amazing for the price wish I had found them earlier :) Chees Mark

You could consider using a Teensy 3.6 MCU from pjrc.com. It has 6 hardware UARTs on chip which theoretically allows communicating with 6 Nextion displays at the same time.

not really ...

even you can connect many clients to one master, it won't change any about the Master Slave topology.

If there is only one Master and one Slave, even no need to care for the comm-status

if there are many Slaves on the Bus, it still won't change the fact, that only one can send at a given time. And this is the magic point. The Master knows all about its Slaves, but the Slaves itself don't know anything about any other Slave. Therefore every Slave can became a Sender without knowledge of the Status of the other Slaves. Because there is just no connection between ...
To avoid collision, you need "a few" more lines between all nodes, and "a little" more logic on all nodes to handle such handshaking ...

And suddenly the whole concept is "a little" more complex than just use a RS232toLAN adapter and a real IP addressing LAN network on a budget ... even a simple ESP8266 module together with every Nextion will do the job much better ...

RS232 can do a lot, but for such things it is just not designed ...

 

Lots of different ways to achieve the same result, I just thought the Nextion already has a command to stop/start the Comms, if you could selective turn the Comms back on it could make for some interesting possibilities
such things only work unidirectional ... one sender, many clients. as soon as clients like to became a master, all fails ...

So, for this all, you even don't need a touchpanel ... :-)

Best solution is a small MCU piggipack for every Nextion. A simple PIC12F683 will do it with ease ... or an Atiny ...

The MCU handles the addressing and the communication between master and to the display ...

Address can be set via jumper ... and when guarantee, that client MCU's only talk to displays on separate TX line, all can receive on one RX master bus ...


 

pdf
(7.08 KB)
Hi Gerry RS 485 would be the way to go, I have an application where I need to monitor and control a small scale off grid power station and I will be using these displays to replace mechanical meters. The displays need to be placed around the control cabinet but all within a few meters of the controlling mcu so being able to address each one and interrogate the stat would be useful for me :) but easily achieved with a small piggyback mcu. Once again thank you for being a part of such a great little product and keep up the good work Cheers Mark
Login or Signup to post a comment