Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: new library UIPEthernet: uIP adapted to Arduino for ENC28J60 on: September 22, 2014, 10:47:10 pm
 smiley-red

Doh!  Thanks,  that's the last time I trust 'search in files' which only found the header file!   Maybe I messed up the filter.
2  Using Arduino / Networking, Protocols, and Devices / Re: new library UIPEthernet: uIP adapted to Arduino for ENC28J60 on: September 21, 2014, 09:32:44 pm
Trying to minimize the size of uip and target parts of it to an Attiny85..

Unfortunately, I'm not well versed in cpp, and I'm trying to understand the following code:

Code:
1) const IPAddress INADDR_NONE(0,0,0,0);
...
2)
 uint8_t  _dhcpDnsServerIp[4];
return IPAddress(_dhcpDnsServerIp);
...
3)  IPAddress remote_addr;

In all 3 examples above, an object of IPAddress is created with the associated constructor called.    If I understand that correctly, where does the constructor get implemented?   I see the class defined in IPAddress.h, but isn't that like a function prototype only?

Code:
class IPAddress : public Printable {
    public:
    IPAddress();
    IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
    IPAddress(uint32_t address);
    IPAddress(const uint8_t *address);
3  Development / Other Software Development / Re: Updated tutorial: Using Atmel Studio 6 with Arduino on: July 25, 2014, 05:12:44 pm
I've managed to compile a project with Atmel Studio that's linked to the libcore.a I compiled..

Only thing is, is there a list of functions that are in libcore.a?    Just so I don't mistakenly use the same name, or include .cpp/h files that are not needed since the object code is already there!

4  Using Arduino / Networking, Protocols, and Devices / Re: new library UIPEthernet: uIP adapted to Arduino for ENC28J60 on: July 16, 2014, 12:45:59 am
I've been playing with porting UIPEthernet over to both Atmel Studio 6 and the CodeVision IDE Compiler.

Everything seems to compile ok, but the linker complains of an 'undefined reference to vtable for IPAddress':

Code:
class IPAddress : public Printable {

I'm an Arduino / cpp beginner so I'm not sure how to fix this... 

from what I've read this error generally happens when a base class has a pure virtual function = 0, and the derived class fails to implement the function.   But I don't see which functions need implementing, let alone how to implement them!   I'm guessing all the functions have been written, and it  must be that I've neglected to include the right one.   

BTW, I've included Printable,cpp/h in the project

5  Using Arduino / Programming Questions / Re: Migrating from Arduino IDE -> Atmel Studio , "delay" hangs forever on: July 15, 2014, 10:17:01 pm
Thanks!  Calling init() did the trick!

It's also good that my application didn't have an init() function declared.. although I bet the linker would have caught that.

Is there a page that lists all the core library function names?     


6  Using Arduino / Programming Questions / Migrating from Arduino IDE -> Atmel Studio , "delay" hangs forever on: July 14, 2014, 11:13:27 pm
If I use the arduino ‘delay’ function my application never gets past the delay(1)  line..
if I use the atmel studio's _delay_ms , it works fine.

My application includes “Arduino.h” and the compiler symbol flag is set correctly (F_CPU=16000000L), with the optimization set for size (-O2)

Do I need to include Wiring.cpp?

I could live without using the Arduino delay, but I'm worried that there may be other arduino functions in the arduino core.a library that may fail to work if the root cause isn't fixed!
7  Using Arduino / Programming Questions / Re: Where's the (hardware) "Serial" object instantiated in the Arduino ecosystem? on: July 13, 2014, 06:50:19 pm
Adding 'Arduino.h' fixed it!

Interestingly, in HardwareSerial.h, the  UBRROH symbol is defined (in iomxx0_1.h) and this code gets compiled:

#if defined(UBRRH) || defined(UBRR0H)
  extern HardwareSeddrial Serial;
  #define HAVE_HWSERIAL0
#endif

yet, if try to use the same UBRR0H symbol in my local code it doesn't see it!   

I suppose it's academic at this point, but it's interesting that HardwareSerial.h doesn't 'include' any file that has the UBRRH/UBRR0H, so why wouldn't my local code see it?




8  Using Arduino / Programming Questions / Re: Where's the (hardware) "Serial" object instantiated in the Arduino ecosystem? on: July 13, 2014, 11:21:02 am
I'm trying to migrate over to AtmelStudio and I included HardwareSerial0.cpp/HardwareSerial.h which has the Serial defined and extern'd

but AtmelStudio still complains of
" 'Serial' was not declared in this scope."

Is this a C++ thing?   How do you use the Serial object declared in HardwareSerial0.cpp/h, if it's not just including the file?



9  Using Arduino / Programming Questions / Where's the (hardware) "Serial" object instantiated in the Arduino ecosystem? on: July 13, 2014, 12:34:01 am
Looking at the SoftwareSerial example ( arduino.cc/en/Reference/SoftwareSerial ),  I see setup() uses a 'Serial' object that was never declared:

Serial.begin(57600);

It does globally declare a software-based Serial object:

SoftwareSerial mySerial(10, 11);
mySerial.begin(4800);

but where is the original 'Serial' object at?  I'm sure it's buried deep within some core library cpp

Also is there a reason why someone would want to use a Software Serial instead of the (hardware Usart) Serial ?

Thanks!

10  Using Arduino / Networking, Protocols, and Devices / Mega 2560 + SerialIP library + WinXP (SLIP) on: June 10, 2014, 12:26:23 pm
Hi,

I uploaded the example 'hello world' sketch to my Arduino but Windows is never able to establish a connection.
http://playground.arduino.cc/Code/SerialIP

On the WinXP (guest) side, when it tries to connect, I see the rx led on the board blink..   and the data the arduino gets is  "CLIENT".

I'm not familiar with the SLIP protocol, but since the Mega2560 is receives seemingly non-random characters, I'm assuming the baud rate / com port connection is ok.. yet it never transmits anything.     As a quick test I changed the setup to do an infinite loop of Serial.write ('h'), and verified that the arduino is transmitting properly  (I see the tx blink & the h's on hyperterminal).

But why doesn't the arduino respond to the "CLIENT" connection attempt?  Has anyone tried this library or can point me in the right direction?

I was thinking of changing  all references in example source code from Serial to Serial 1 (or 2, or 3) to see if using another port might make a difference, but need to purchase a ttl/232 converter.

 UPDATE: On a different (VM XP) machine instead of windows sending CLIENT (and expecting  CLIENTSERVER), I see the Arduino receives "LET" 3 times.     Anyone know of a VM Linux distro that might have SLIP support built-in that I could try?

11  Development / Other Hardware Development / How to Make Arduino Compatible Board on: May 15, 2011, 02:41:17 am
I understand Arudino consists of both the software (ide + wiring libraries) and hardware (avr, specific header pinout)..

But I'd like to design my own pcb... with some robot specific features.   I plan to use the new open hardware license, and of course I won't be using the "arduino" brand on anything, but I'm curious what exactly does it take in order for full compatibility?

For example, in the IDE, I would love for my would-be board to be listed.     I realize I'd have to add to the software libraries for people to access the added functionality, but is that even possible, or would I have to branch completely on my own... ala 'Freeduino Epic'?

With so many flavors of official arduino boards out there, I assume they've made it easy for themselves to port the ide/software to new hardware, but can I add support for a non-"Arudino" brand board?

Pages: [1]