Just need to know if the hardware I am about to buy will do what I need it to do.
I don't need to know about sketches yet. Please have patience with the newbie. I think I have included the necessary info on the attached diagram.
As indicated in my diagram:
Program the Uno from my PC via USB
My PC able to Read and write data to the UNO via router and ethernet cable
My PC able to write data thru the UNO to the charge controller
My PC able to extract data from UNO's SD card
Uno able to read and write data to the charge controller
UNO able to read data from 2 separate ads1118 ADCs via SPI
UNO able to write to a 3bit data latch via SPI
UNO able to generate PWM signal from charge controller data
Most of these actions are separated by minutes
Okay, gotcha. When I read the line in the post above
"My PC able to extract data from UNO's SD card"
I knew I had the wrong idea.
I'm not sure why you don't hang the SD on the Uno's SPI bus along with the other devices and communicate through USB but I'm sure you have a reason I don't see yet.
"Most of these actions are separated by minutes"
I don't see the need for Ethernet to PC when you have USB which is for more than programming the ATmega chip! USB is fast enough to let the Uno hit its own speed limit.
I can tell you that AVR-duino's can use their hardware serial ports (UART's) as master-mode SPI hosts. Nick Gammon put the code and explanations up in a tutorial... but here the Uno has only one UART needed to R/T the USB!
There is an AVR DIP chip (not surface mount, the older style with pins on 2 sides) that can be run on a breadboard or better that has an extra UART and also gives 32 IO pins besides and 16K RAM (lots of room for buffers, etc), 4K EEPROM and 128K flash (can hold large data tables, etc) --- that is "the Mighty" ATmega1284P (40 pin wide factor, dwarfs the Uno's 328P) that last time I bought 5 from Mouser cost me only $5.50 each. It's not a Mega2560 with 4 UART's and bus expansion pins but... 16K RAM on-chip makes it a big-hitter and the price is nice, unlike every shield I have seen.
"I don't see the need for Ethernet to PC when you have USB which is for more than programming the ATmega chip! USB is fast enough to let the Uno hit its own speed limit."
What I hear you saying is I can use the usb connection between the UNO and the PC for both programing and access to the SD card. That would eliminate the need for the Ethernet Sheild 2 if I were to add a SPI SD card to the SPI Buss. If I understand this correctly, I will update the diagram.
"I can tell you that AVR-duino's can use their hardware serial ports (UART's) as master-mode SPI hosts. Nick Gammon put the code and explanations up in a tutorial... but here the Uno has only one UART needed to R/T the USB!"
Are you saying that the UNO only has ONE uart port that is used for USB?
I have to have a MODBUS connection for the Charge Controller. If only one port is available, could the UNO connection to the PC be Ethernet is stead of USB?
Thanks in advance. I do appreciate your input.
Barry
The Uno has a USB chip on-board as well as the ATmega328P chip that you program. Serial (UART) is connected from the 328P through USB but the UART works the RX and TX pins on the 328P chip and are not dedicated to the USB.
I read up on MODBUS and it looks like an MKR RS485 shield or MKR Ethernet shield are the made-for options. I use modules instead of shields (board area makes cost, shields have lots while modules are small) but I dunno if there is something special about the shields... you could ask around to members who know Arduino with MODBUS well since I do not about the best choices. How long the MODBUS wiring is may make a difference.
UART is plain serial.
SPI is serial peripheral interface... also serial.
I2C (Wire) is also serial.
Software Serial is IO pins acting as serial.
So the USB port is independent of the RX TX pins which can be configured for Modbus.
The SD card is for infrequent writes during the day. It will hold daily/weekly/monthly data to be retrieved en-mass by the PC for graphing purposes. So a separate SD module on the SPI buss makes sense.
I will redo my diagram to be sure we are on the same page.
You would certainly be better off using an Arduino that has more than one Serial port. As is, your programming/upload/etc USB port will interfere with your MODBus (assuming it wants to use hardware serial.)
Also, I'd put the modbus adapter at the other end of your 15ft cable. MODBus is designed for moderately long cables, "TTL Level Serial" isn't.
If you can solder well, you might protoboard DIY your own board starting with a minimal breadboard circuit to build an ATmega1284 circuit. It has 2 UART's and 32 IO pins and 16K SRAM, allowing a lot of data buffer!
Nick Gammon's DIY minimal breadboard tutorial.
This has step by step with pictures to make your own duinos and programming cables with both the Uno's 328 chip and the mighty 1284 though TBH AVR makes many different ATmegas that can be used the same way.
To program Arduino boards and AVR chips, one option is through the ISCP pins but that has to be done up close.
you appear to have selected the hardware (UNO, ethernet, etc) then attempted to match the project to it
the usual way to approach a project is to draw up a requirements specification - in outline
states the aims and objectives
from that you can draw up a list of hardware requirements - storage, communications and IO
from that you can select suitable hardware (microcontrollers, WiFi, DACs, ADCs, RS485, etc) to support the project
consider possible future enhancements
could you find a development board which would support the project and reduce the need for interconnecting wires which are source of poor connections and intermittent problems?
e.g. thers are development boards with onboard TFT display, microcontroller, WiFi, BLE, SD reader, I2C and SPI interfaces, etc
you have ADCs 20ft away from the main controller- could you use WiFi to transmit the ADCs readings?
If I can suggest a simplification: Remove the Uno.
I expect it will be possible to find PC compatible MODBUS to USB adapters, USB ADC Adapters and so on. There will be no need for SD card, the PC can record everything to its HDD/SSD.