login

online now

We have 60 guests and no members online

search

 
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Arudino Due Software Serial compatibility

Arudino Due Software Serial compatibility 3 years 2 weeks ago #548

Hi,

I'm using Arduino Due (ATmega16U2), to upload sketches to board i need Arduino SDK 1.5.8 and i have GinSing V1.2.

I can't compile any GinSing examples, i always got an compile error.

Anyone can help me?

ERROR

In file included from C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingSerial.h:22:0,
from C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSing.h:96,
from _1_welcome.ino:27:
C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingSerialMacros.h:66:2: error: #error This processor is not supported by SoftwareSerial
#error This processor is not supported by SoftwareSerial
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/WCharacter.h:23:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Arduino.h:179,
from C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSing.h:76,
from _1_welcome.ino:27:
C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingDefs.h:81:2: error: expected identifier before numeric constant
_U = 243 , /* luck, jump, plus */ _UE = 244 , /* food, june */ _V = 245 , /* vest, even, twelve */
^
C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingDefs.h:81:2: error: expected '}' before numeric constant
C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingDefs.h:81:2: error: expected unqualified-id before numeric constant
In file included from C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSing.h:90:0,
from _1_welcome.ino:27:
C:\Users\xxx\Documents\Arduino\libraries\GinSing/GinSingDefs.h:91:1: error: expected declaration before '}' token
Last Edit: 2 years 10 months ago by administrator.
The administrator has disabled public write access.

Arudino Due Software Serial compatibility 3 years 1 week ago #549

I believe you may be first to attempt to use a Due with the GinSing shield. According to what I could find there may not (yet) be support for Software Serial on that platform, as per this discussion. The GinSing library uses software serial to allow the use of selectable pins in the communication between the two boards. On the Due, there are several hardware serial ports so I don't think anyone has considered backward compatibility.

If you are willing to dig into this we can provide you with help on what functions need to be implemented that could replace the interface but we don't have a Due here to test with currently. The other option may be to hit the Arduino forums (and/or GitHub) to see if anyone is currently pursing the port. Sorry about the trouble, but let us know if we can help.
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 3 years 1 week ago #550

hi again,

Unfortunately i'm new in Arduino and GinSing, so maybe im not the target to explore that path, so i think i need to get another Arduino board if i want listen my GinSing.
May you give me an advice witch board i can use?
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 3 years 1 week ago #551

Sorry again about the hardware incompatibility. The Uno is the one that is officially supported.
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 2 years 10 months ago #583

I just ordered a GinSing, and I would love to get it working with the Due for a project I'm working on (interactively programmable computer for my kids with sound synthesis and hardware graphics). I'm also a programmer, so I'm happy to write the functions needed to get software serial working or hook up a hardware serial port.

The hardware will arrive in a few days, but anything you can tell me to get me started will be a big help. Thanks!
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 2 years 10 months ago #584

Thanks for taking in on sean! I don't think it should be super complicated, but you will need to know just a bit of C++. I would suggest you start by downloading the source code if you have not already and take a look at GinSingSerial.h. In the end I think the best best would be to replace the public functions there. I'll include it here for reference:


#ifndef _GINSINGSERIAL_H_DEF
#define _GINSINGSERIAL_H_DEF

//
// GinSingSerial - serial interface to the GingSing Arudino Board
//
//
// This code has be modified from its original content to better fit into this software library.
// Our many thanks an gratitude to the original writers of this code. This library is being redistributed under
// the GNU Lesser Genral Public License as published by the Free Software Foundation version 2.1 or later.
// You should have received a copy of the GNU Lesser General Public License along with this library; if not, write
// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// This code is based on a downloaded version of NewSoftSerial.h from arduiniana.org. We have decided to
// encapsulate this version to avoid having to link in another library for convenience.
// We hope you actively support development efforts by these fine people.
//
//

#include <inttypes.h> // native variable types
#include <Stream.h> // streaming control
#include "GinSingSerialMacros.h" // useful macros for this lubrary


#define _SS_MAX_RX_BUFF 64 // RX buffer size ( in bytes )
#define _SS_VERSION 01 // software version of this library


//
// GinSingSerial - library class that supports serial interface on any pin set
//

class GinSingSerial : public Stream
{

public:

GinSingSerial (); // constructor
~GinSingSerial(); // destructor

void config ( uint8_t receivePin , // configure the hardware connections for
uint8_t transmitPin , // communication
uint8_t ovfPin );

bool begin ( long speed ); // activate serial connection at the specified speed

bool listen(); // listen for communication from the other side of the link
void end(); // terminate the serial connection

bool is_listening(); // true if data is availabe on the other side of the connection
bool rcvOverflow(); // true if the recieve buffer has been overrun
bool sndOverflow(); // true if the device has ben overrun by sends

static int library_version(); // get the current library version
static void enable_timer0 ( bool enable ); // enables hardware time for interrupt processing
int peek(); // check the contents of the receive buffer


#if defined(ARDUINO) && ARDUINO >= 100
virtual size_t write ( uint8_t byte ); // write a byte out to the serial connection
#else
virtual void write ( uint8_t byte ); // write a byte out to the serial connection
#endif

virtual int read (); // read the concents of the recieve buffer
virtual int available (); // check to see if dadta is available
virtual void flush (); // flush the contents of the buffers

bool readByte( uint8_t * dataByte ); // read single byte and return true if data is available


static inline void handle_interrupt (); // internal method to access interrupt handlers


private:

// internal variables

uint8_t _receivePin; // pin assigned to recieve data
uint8_t _receiveBitMask; // bitmask applied to recieved data
volatile uint8_t *_receivePortRegister; // chip register port for recieve

uint8_t _transmitBitMask; // bitmask applied to send data
volatile uint8_t *_transmitPortRegister; // chip register port for transit

uint16_t _rx_delay_centering; // temporal receive timing parameter
uint16_t _rx_delay_intrabit; // temporal receive timing parameter
uint16_t _rx_delay_stopbit; // temporal receive timing parameter
uint16_t _tx_delay; // computed delay value for read

uint8_t _ovfPin; // pin assigned for overflow control
uint16_t _rcv_overflow:1; // true if received overload has occurred
bool _snd_overflow; // true if send overflow has occurred
uint16_t _inverse_logic:1; // true if using inverse log


// static data

static char _receive_buffer[_SS_MAX_RX_BUFF]; // static recieve data ring buffer
static volatile uint8_t _receive_buffer_tail; // pointer to the tail of ring buffer
static volatile uint8_t _receive_buffer_head; // pointer tothe head of the ring buffer

static GinSingSerial *active_object; // internal pointer to the class oject


// private methods

void recv(); // perform blocking read from the connection
uint8_t rx_pin_read(); // read raw data from the RX pin
void tx_pin_write(uint8_t pin_state); // send raw data to the TX pin
void setTX ( uint8_t transmitPin ); // assign transmit hardware pin
void setRX ( uint8_t receivePin ); // assign receive hardware pin
void setOVF ( uint8_t ovrPin ); // assign send overflow pin

static inline void tunedDelay ( uint16_t delay ); // perform delay based on connection parameters


};

#endif // _GINSINGSERIAL_H_DEF


The approach I would take would be to strip this class down to only the functions that are needed to compile and make dummy functions in the cpp file. Once the code builds, it should be a straightforward task of implanting the functions using the hardware interface on the Due. Let me know if I can provide more help in advance of your arrival. Good luck on the start of a great adventure!
Last Edit: 2 years 10 months ago by administrator.
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 2 years 10 months ago #585

The GinSing kit has arrived, and I've put it together and tested it out on my Diavolino. Other than nearly blasting my ear out at the suggested 1/4 turn initial volume setting, it works great.

I researched the possibility of software serial on the Due, but it doesn't appear anyone has even started work on such a thing, so I think hardware serial is definitely the way to go. It seems like the easiest thing to do will be to pull off the jumpers for RX and TX and run wires from the serial pins to the center jumper pins.

There appear to be some naming collisions with the Due libraries. In particular _TS seems to already be used. If that's really what I'm seeing, it's an easy fix, but with two kids and Christmas and Boxing Day festivities I have not yet been able to do that.

My one big concern is voltage: the Due is a 3.3V board, though it provides 5V power, and it cannot tolerate 5V on its pins. Will this prevent me from plugging the GinSing board directly into the Due? Should I just pull the chips and put them on a Mega protyping board instead, powering from the 3.3v supply? Is there some easier rewiring I can do?
The administrator has disabled public write access.
The following user(s) said Thank You: administrator

Re: Arudino Due Software Serial compatibility 2 years 10 months ago #588

Well, the Babblebot IC will run down to 2V, but the LM386 technically can only run down to 4V. If you are not using the power output, you could bypass the LM386 by pulling the chip and bypassing the output directly to the audio jack.
The administrator has disabled public write access.

Re: Arudino Due Software Serial compatibility 2 years 10 months ago #591

Ok, thanks. The Due actually does provide 5V power, though, so my concern is that the GinSing board will be sending 5V on the serial line, which would damage the Due. I have a level converter on the way, but once I can't plug the GinSing directly in to the Due anymore, I am thinking I should probably just solder everything into a protoboard and leave out the audio amplifier entirely.

Before I do a bunch of hardware work, I'm going to see what I can do with the synth on the Gameduino 2 for my Due project. I may end up using the GinSing for a separate MIDI synth project.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.203 seconds