DrychronRed
New member
Hi,
This project barely exists as some test code that sends out serial messages, so I'm asking ahead of time before I put more time into this if I'm ok doing what I'm doing.
Here's what I intend to use and why:
Requirements: I need to communicate with four rs-232 devices, controlled from udp/ip over wired ethernet, and I need timeouts on the serial ports. They don't have to be accurate to 1 ms, but I generally need to know when so many seconds are up. I also *would like* to use a serial port for regular debugging.
- Mega 2560: Because it has 4 hardware serial Ports
- W5100 Shield: Because it has Wired Ethernet, and uses SPI - so therefore pins 10, 11, 12, and 13 (I think) on the Mega
- Use Serial for normal uploading and debug printing
- Use Serial1, Serial2, Serial3, and AltSoftSerial on pins 46 and 48 of the Mega to talk to the four devices
- Can't use Timer1 due to AltSoftSerial using the 16 bit Timer 1 (If I understand correctly)
- Using PJRC's Timer3 due to the above 16 bit timer issue. I figure it's better than the stock Timer3, and more likely to work together with Paul's AltSoftSerial.
Questions and comments:
Where am I being stupid?
Note: as long as I can get second accuracy or so I don't care if my timer is 8 bit or 16 bit.
Alternatively I could use Serial, Serial1, Serial2, and Serial3 to communicate with my four devices via the hardware ports and use the AltSoftSerial port as a debugging port if I had to - this has the disadvantage of not being able to use the built-in, while-connected to USB Serial debug stuff, and the advantage that all four devices will get the exact same handling via serial (all using hardware ports) if that's truly useful (may not be worth the effort).
I could use SoftwareSerial instead of AltSoftSerial and transmit out the port only for debug.
I didn't see a Mega (or non-Teensy) forum, so I posted here anyway...sorry.
THANK YOU!
Jeff
This project barely exists as some test code that sends out serial messages, so I'm asking ahead of time before I put more time into this if I'm ok doing what I'm doing.
Here's what I intend to use and why:
Requirements: I need to communicate with four rs-232 devices, controlled from udp/ip over wired ethernet, and I need timeouts on the serial ports. They don't have to be accurate to 1 ms, but I generally need to know when so many seconds are up. I also *would like* to use a serial port for regular debugging.
- Mega 2560: Because it has 4 hardware serial Ports
- W5100 Shield: Because it has Wired Ethernet, and uses SPI - so therefore pins 10, 11, 12, and 13 (I think) on the Mega
- Use Serial for normal uploading and debug printing
- Use Serial1, Serial2, Serial3, and AltSoftSerial on pins 46 and 48 of the Mega to talk to the four devices
- Can't use Timer1 due to AltSoftSerial using the 16 bit Timer 1 (If I understand correctly)
- Using PJRC's Timer3 due to the above 16 bit timer issue. I figure it's better than the stock Timer3, and more likely to work together with Paul's AltSoftSerial.
Questions and comments:
Where am I being stupid?
Note: as long as I can get second accuracy or so I don't care if my timer is 8 bit or 16 bit.
Alternatively I could use Serial, Serial1, Serial2, and Serial3 to communicate with my four devices via the hardware ports and use the AltSoftSerial port as a debugging port if I had to - this has the disadvantage of not being able to use the built-in, while-connected to USB Serial debug stuff, and the advantage that all four devices will get the exact same handling via serial (all using hardware ports) if that's truly useful (may not be worth the effort).
I could use SoftwareSerial instead of AltSoftSerial and transmit out the port only for debug.
I didn't see a Mega (or non-Teensy) forum, so I posted here anyway...sorry.
THANK YOU!
Jeff