TinyCircuits

TinyScreen+ and GPS module

TinyScreen+ and GPS module
« on: May 13, 2016, 08:57:48 AM »
Hello!

Disclaimer: Total noob on arduino development.

I just received my TinyScreen+ and GPS module.
I played with the TinyScreen+ alone and everything is fine, hello world was ok, etc.
However, I can't find a working example of the GPS module.

I'm using Arduino IDE 1.6.9 on OSX, and it seems there's a problem around the SoftwareSerial library.

What happens is the following:

With https://codebender.cc/sketch:37442#TinyShield_GPS.ino

Code: [Select]
/Users/Fiche/Downloads/TinyShield_GPS/TinyShield_GPS.ino:18:28: fatal error: SoftwareSerial.h: No such file or directory
 #include <SoftwareSerial.h>
                            ^
compilation terminated.
exit status 1
Error compiling for board TinyScreen+.

I googled a bit, tried to move the library from "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial" to "/Applications/Arduino.app/Contents/Java/libraries/SoftwareSerial" but I got an error telling me this isn't compatible.

Not understanding everything but I think the library isn't compatible with the TinyScreen+ board/cpu (am I right?)


Then I found https://codebender.cc/sketch:60928#TinyShield_GPS_V2.ino

But I get
Quote
SoftwareSerial256.cpp:129: error: #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors
 #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors

Bummer.

Sooo, I'm now stuck. I don't really know where to look, what should I do, any help would be greatly appreciated :)

Re: TinyScreen+ and GPS module
« Reply #1 on: May 13, 2016, 11:34:00 AM »
Self replying:

The tinyscreen+ has hardware serial ports, so no need to use SoftwareSerial libraries.

Now I need to find how to properly declare it for the GPS module!

Something along, just need to find the good PIN values :)

Code: [Select]
Uart Serial2(&sercom1, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX);

Re: TinyScreen+ and GPS module
« Reply #2 on: May 13, 2016, 02:13:55 PM »
Hi fiche- very cool that you've found the Arduino hardware UART init.

As you've seen, there isn't currently an Arduino Zero(and TS+) SoftwareSerial. If the hardware pins are available, that's of course optimal, but for cases that there are not, I've been working on adapting the SoftwareSerial library for the SAMD21 platform. I've attached a zip if you'd like to test it.

Re: TinyScreen+ and GPS module
« Reply #3 on: May 14, 2016, 09:36:33 AM »
Hi fiche- very cool that you've found the Arduino hardware UART init.

As you've seen, there isn't currently an Arduino Zero(and TS+) SoftwareSerial. If the hardware pins are available, that's of course optimal, but for cases that there are not, I've been working on adapting the SoftwareSerial library for the SAMD21 platform. I've attached a zip if you'd like to test it.

Wow, that's awesome, thanks!

Just had to change SoftwareSerialZero.cpp:270 to
Code: [Select]
uint8_t in = digitalPinToInterrupt(_receivePin);otherwise it wouldn't compile.

It works like a charm, thanks again!

Is your code licensed and/or hosted somewhere else by any chance?

Re: TinyScreen+ and GPS module
« Reply #4 on: May 16, 2016, 10:40:58 PM »
Ah- broke it when I updated the SAMD21 core for TS+. That might work, but a 'better'(and untested) Arduino way should be:

Code: [Select]
#if ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606
  EExt_Interrupts in = g_APinDescription[_receivePin].ulExtInt;
#else
  EExt_Interrupts in = digitalPinToInterrupt(_receivePin);
#endif

Unfortunately we don't have this published yet, but it's just a modified SoftwareSerial and will stay under GNU LGPL.

Re: TinyScreen+ and GPS module
« Reply #5 on: April 04, 2018, 04:13:46 PM »
Dear Ben,

Sorry to reopen an old topic but still am struggling with this old problem (and SoftwareSerialZero library).
Indeed the transmit from GPS to Tinyscreen is indeed OK (i.e. the A1 pin works well) but the transmit to the GPS seems not to work (i.e. A0 pin). i.e. I'm sending $PSRF103 commands to the GPS that doesn't work with Tinyscreen+ although the same command is working when I'am using another setup with tinyprocessor board (328P).

Have you tested the Rx/Tx both ways ?
I noticed that in SAM21D datasheet that A0 and A1 pins are different (Analog for A0 and PWM for A1) - could that be pqrt of the explanation ?

I'm quite blocked now - any help you can provide ?
Thks
« Last Edit: April 05, 2018, 02:19:51 AM by fvoiron »