chipKIT® Development Platform

Inspired by Arduino™

Streaming library - Trying to make it work on the UNO 32...

Created Sun, 20 Nov 2011 17:47:36 +0000 by KurtE


KurtE

Sun, 20 Nov 2011 17:47:36 +0000

I purchased an UNO32 to play around with and thought it would be fun to port one of my robots over to it to see how it compares with the Arduino and Arduino Mega as well as with the Basic Micro Atom Pro series like the Arc32.

The first thing I have run into as many of the Arduino libraries I was using are not ported over.

One such library I was using is the contributed library Streaming, which looks like it was not doing any AVR specific stuff. So I copied it over to the appropriate PIC location and tried compiling it. I started off with a very simple sketch:

#include <Streaming.h>
void setup() {
  Serial.begin(38400);
}

void loop() {
    Serial << _DEC(1) << "Hello World" << endl;
}

When I tried to compile it, it end up with several error messages

C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c: In function 'pinMode':
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:54:14: error: 'NOT_A_PIN' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:54:14: note: each undeclared identifier is reported only once for each function it appears in
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:57:14: error: 'PB' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:65:3: error: 'AD1PCFGSET' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c: In function 'getPinMode':
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:127:14: error: 'NOT_A_PIN' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c: In function 'digitalWrite':
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:164:14: error: 'NOT_A_PIN' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:168:15: error: 'NOT_ON_TIMER' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c: In function 'digitalRead':
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:195:14: error: 'NOT_A_PIN' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:199:15: error: 'NOT_ON_TIMER' undeclared (first use in this function)
C:\mpide-0022-windows-20110822\hardware\pic32\cores\pic32\wiring_digital.c:201:6: error: invalid type argument of unary '*' (have 'int')

Suggestions?

Other libraries that I will need to either work around or make work include: SoftwareSerial, PS2X_LIB.

Thanks Kurt


KM6VV

Sun, 20 Nov 2011 23:03:05 +0000

Hi Kurt,

Maybe the Wiring lib?

Not all of the LIBs have been translated.

Need MsTimer(), for example...

Alan KM6VV


KurtE

Sun, 20 Nov 2011 23:50:45 +0000

I looked at the file that was complaining and it looked like some of the needed header files have been commented out...

//#include	<peripheral/adc10.h>


#include "wiring_private.h"
//#include "pins_arduino.h"

I belive that NOT_A_PIN is defined in pins_arduino.h, but if I then try to include it, I get other errors.

As you said, it looks like there is more work to be done to get some of the libraries compiling and working.

Kurt


KurtE

Tue, 22 Nov 2011 15:03:05 +0000

Quick question: What build do you recommend using? I tried the last released build and I was getting all of the build issues I mentioned above.

So yesterday I downloaded a recent beta build: ...1119 Windows running on Win7 32 bit.

It appears to have taken care of the compile issues, so I started porting over the PS2X_LIB library to this build. Got it to build, but before I try it out and debug it, I decided to try out something simple so I tried the simple Blink sketch. It compiled and downloaded fine to my UNO32... But the LED was not flashing on and off, it was stuck on...

So I added some outputs to the serial port. Something like: Serial.println("Got here"); at the end of the loop. The program successfully downloaded and I received these messages.

So for the fun of it, I thought I would try adding blinking of the 2nd LED, which by UNO32 docs is on 43. Added pinMode(43, OUTPUT); Added a the digitalWrite(43, HIGH) and likewise LOW. The program compiled and downloaded and I believe hung or faulted in the added pinMode...

Suggestions? Kurt


Jacob Christ

Tue, 22 Nov 2011 23:17:10 +0000

The program compiled and downloaded and I believe hung or faulted in the added pinMode... Suggestions?

This is a silly question, but what board is selected? The Uno32, Max32 or something all together different. I often fool myself by picking the wrong board (especially since I have both).

Jacob


KurtE

Tue, 22 Nov 2011 23:42:58 +0000

Thanks Jacob,

I do have the Uno32 selected. I am trying the next step and that is a clean install of the last official release, maybe something got screwed up in the previous one. I often find myself confused as well, as I am playing with so many different boards like: Arduino Uno, Lynxmotion Botboarduino, Seeeduino Mega, Lynxmotion BB2 with Basic Atom Pro 28, Basic Micro Arc32, sometimes Propeller...

Right now waiting for zip file to finish downloading...

Thanks Kurt


KurtE

Wed, 23 Nov 2011 00:02:00 +0000

:) I deleted the whole directory structure, reinstalled the current released build and now it compiles and both LEDs blink! :D

Kurt

Sorry about that, not sure what happened to my first install.