Are both serial ports available for use when using the rfm69?
I see that the rfm69s has its int pin on d2 and the serial ports are on pins d8, d9, d10, d11 and d10 and d11 are also int 0 and int 1.
I thought the 1284p had only 2 interrupt pins.
When using the ftdi adapter to download new code is either serial port used?
If Yes then I need to disconnect my serial device from that port before I connect the ftdi and start downloading.
Thanks
Hi Tom,
Both serial ports are available. Ser1 is the common serial port that is used during sketch upload to the board (used by bootloader). This is called "Serial" in software and you would use it like Serial.print(..). Serial1 (indicated by "Ser1" on the silkscreen) is shared with INT0 and INT1 so you cannot use both Serial1 and those 2 interrupts at the same time. You can always use pin change interrupts on any other pin, but you will need to check which pin changed state to find out which pin caused the interrupt, so an extra step but others were able to work it out pretty easily.
INT2 as you noted is used by the RFM69 radio.
After programming both serial ports are available for whatever purpose you need.
And yes, if you attach a device to the serial port 1 (Ser1 on pins D10+D11) you will need to disconnect it before reprogramming.
Or if you want you can use wireless programming which is ... wireless :) but is slightly more involved, your sketch has to be listening for a wireless programming token so it has to stay in RX mode, and you need an extra programmer Moteino that sends the HEX binary file wirelessly to it.
Thanks Felix, I am liking your mega board more and more.
The wireless programming sounds like something I want to explore.
Quote from: Felix on December 11, 2014, 04:55:21 PM
Hi Tom,
Both serial ports are available. Ser1 is the common serial port that is used during sketch upload to the board (used by bootloader). This is called "Serial" in software and you would use it like Serial.print(..). Serial1 (indicated by "Ser1" on the silkscreen) is shared with INT0 and INT1 so you cannot use both Serial1 and those 2 interrupts at the same time. You can always use pin change interrupts on any other pin, but you will need to check which pin changed state to find out which pin caused the interrupt, so an extra step but others were able to work it out pretty easily.
INT2 as you noted is used by the RFM69 radio.
After programming both serial ports are available for whatever purpose you need.
And yes, if you attach a device to the serial port 1 (Ser1 on pins D8+D9) you will need to disconnect it before reprogramming.
I'm confused. So I think pins D8 & D9 are Serial 0 which is are connected to the FTDI connector (green arrows on silkscreen) and are used to program the MoteinoMega and used by the serial monitor with commands like Serial.println("Hello World"), right? But you say Ser1 is on D8&D9. Is that a typo or do I have things mixed up?
Ref: MoteinoMega Pinout (http://lowpowerlab.com/blog/2014/08/09/moteinomega-available-now/)
You are correct, it was a typo, fixed now. Ser1 is on 10/11 as shown in the pinout photo. I wonder why people have to ask in words what is clearly shown in a photo (it wasnt you).
Quote from: Felix on December 11, 2014, 04:55:21 PM
Hi Tom,
Both serial ports are available. Ser1 is the common serial port that is used during sketch upload to the board (used by bootloader). This is called "Serial" in software and you would use it like Serial.print(..). Serial1 (indicated by "Ser1" on the silkscreen) is shared with INT0 and INT1 so you cannot use both Serial1 and those 2 interrupts at the same time. You can always use pin change interrupts on any other pin, but you will need to check which pin changed state to find out which pin caused the interrupt, so an extra step but others were able to work it out pretty easily.
INT2 as you noted is used by the RFM69 radio.
After programming both serial ports are available for whatever purpose you need.
And yes, if you attach a device to the serial port 1 (Ser1 on pins D10+D11) you will need to disconnect it before reprogramming.
Or if you want you can use wireless programming which is ... wireless :) but is slightly more involved, your sketch has to be listening for a wireless programming token so it has to stay in RX mode, and you need an extra programmer Moteino that sends the HEX binary file wirelessly to it.
Felix,
I'll join the crowd needing clarification on this. Here is the scenario:
I have Moteino Mega with an RFM69 radio, SPI Flash for Wireless Programming, use an FTDI cable on TX0&RX0 for program download and debug, AND my own device attached to Serial1 (D10_RX1, D11_TX1) and have no plans to use INT0 or INT1.
Do you see any conflicts in this scenario, ie, the RFM69, SPI_Flash, and WirelessProgramming will work without any change?
HINT: This requires a 'Yes' or 'No because...' answer. Sometimes your 'explanations' cause more havoc than simply answering the question :D
Tom
@TomWS: No, I did not see any conflicts and have no reason to believe there would be. Ser1 is a hardware serial separated from Ser0 (or just aka Serial) and what clocks in the Ser1 is independent of anything else, you will of course need to read out that serial data otherwise the hardware buffer will fill up if more data clocks in than data being read out.
I don't think any of my examples have Ser1 use in them because they are meant to work on all Moteinos not just the MEGA. So they will work but not "without any change" as you mentioned, it would require declaring Serial1.begin(...) and then changing the code to add Serial1 usage etc.
Quote from: Felix on January 15, 2015, 10:58:05 AM
@TomWS: No, I did not see any conflicts and have no reason to believe there would be. Ser1 is a hardware serial separated from Ser0 (or just aka Serial) and what clocks in the Ser1 is independent of anything else, you will of course need to read out that serial data otherwise the hardware buffer will fill up if more data clocks in than data being read out.
I don't think any of my examples have Ser1 use in them because they are meant to work on all Moteinos not just the MEGA. So they will work but not "without any change" as you mentioned, it would require declaring Serial1.begin(...) and then changing the code to add Serial1 usage etc.
Thank you for the long 'Yes' answer... ::)
T
PS: I suppose I could have been more precise in my question, adding
Quote...will work without any change to the libraries?
In general, I think it's given that a user developed application is probably 'changed' from any of your example code - but I could be wrong about this...