chipKIT® Development Platform

Inspired by Arduino™

wire.h

Created Sun, 29 May 2011 20:52:56 +0000 by Ron


Ron

Sun, 29 May 2011 20:52:56 +0000

Wire.h is not compiling for the ChipKits. There are old references to avr/io. The PIC32 "plib" (the all include file for PIC32) has its' own problems. It works, but, is overly complex and very wordy. wire.h for Arduino is very slick in comparison. Ron


Mark

Sun, 29 May 2011 21:57:54 +0000

Ron

You are referring to Wire.h in the Wire library as opposed to "Wiring.h" correct?

The current wire.h is not finished. it should not be included and not compiled. Anything that tries to use I2C at the moment will not work. That should be finished in about a week.

If you are referring to wiring.h in the core files. be more specific, Its working for me.

Mark


deepthought-64

Fri, 10 Jun 2011 21:02:00 +0000

Hi Mark,

so is there no I2C support at all? I just tried to compile a little test-sketch and it ended up with an error (undefined reference to `twi_init').

greetings, deepthought


deepthought-64

Sun, 12 Jun 2011 18:10:48 +0000

Hi Mark,

is there any update on the wire-lib? you said it will be available soon. did I miss anything?


promptcritical

Wed, 15 Jun 2011 01:46:42 +0000

add me in as well.

I specifically purchased three Mega32's for a situation where I could get a notoriously difficult priduct to work with arduino, but needed more memory and horsepower like a Fez Panda II. I saw the ads for "Arduino Compatible" 32bit, 80 mhz and the memory sizes and thought my prayers had been answered.

The product I'm using hinges on a specially modified version of the IC2 library and it now seems after testing, there is no way to make it work without rewriting the library for a PIC. Worse when I looked to salvage my investment by using it for a couple of other projects, but it wouldn't work for those either.

+1 for a great idea a 32 bit Arduino, power and simplicity combined. -3 for forgetting arduino is mostly used for libraries which require hardware access like I2C, SPI, bitblasting, and protyping designs to talk to hardware.

While chipkit32 is advertised as "Arduino compatible" If there is no AVR/IO replacement, any library even slightly related to hardware is useless. For what I use arduino for there is no useful compatibility with arduino without a drop in replacement for AVR/IO.

Maybe I'm being too harsh, it is a new product, but a lot of hype was given being able to select a new board type, press compile and presto it just works. There is even a video posted of someone using a display on a megs, mobing it to a mega32, pressing compile and presto it just works.


jaw174

Sat, 18 Jun 2011 16:02:20 +0000

yep, need that i2c library.


Mr_Fixit

Sat, 18 Jun 2011 23:58:09 +0000

The current wire.h is not finished. it should not be included and not compiled. Anything that tries to use I2C at the moment will not work. That should be finished in about a week.

This is pretty much the same issue I am having here. New Uno32, CMPS09, connected via I2C, JP6/8 set correctly, pins connected, so on and so forth. However, cant compile. Apparently the Wire.h file is still fubar. A few weeks ago this was supposed to be resolved... :x

Anyone know?


promptcritical

Wed, 22 Jun 2011 05:52:54 +0000

This is pretty much the same issue I am having here. New Uno32, CMPS09, connected via I2C, JP6/8 set correctly, pins connected, so on and so forth. However, cant compile. Apparently the Wire.h file is still fubar. A few weeks ago this was supposed to be resolved... :x Anyone know?

This issue has pretty much killed me, I NEED I2C for a lot of my equipment, in some cases I could work around by using serial ports but I'd need at least four serial ports, and port 3 and 4 don't work(Yet).


Mr_Fixit

Wed, 22 Jun 2011 15:40:31 +0000

promptcritical - I considered the same options, and came to the same conclusion. We could use some of the IO lines and build our own serial, but I am not inclined to pursue that.

From my perspective, this board was purchased due to its functionality, compatability, performance, I2C, and the PWM capabilities built in. But, what I am seeing is rather disappointing. In my humble opinion, this product should not have been released until it was ready. It is not ready. I am about to send my board back and get something else that actually works.


Toley

Wed, 22 Jun 2011 20:54:02 +0000

Wire master examples compile with the new test release (mpide-0022-chipkit-win-20110619).

But I did not test if it works with real hardware.


Mr_Fixit

Wed, 22 Jun 2011 20:58:32 +0000

Where is this update at? I do not see it on the download page.


Toley

Wed, 22 Jun 2011 21:24:30 +0000

http://www.chipkit.org/forum/viewtopic.php?f=20&t=115

There is a place where prerelease are stored. Look at this page often and you will see more update than for the official release.

Please tell me if the library works !


Mark

Thu, 23 Jun 2011 01:17:25 +0000

From my perspective, this board was purchased due to its functionality, compatibility, performance, I2C, and the PWM capabilities built in. But, what I am seeing is rather disappointing. In my humble opinion, this product should not have been released until it was ready. It is not ready. I am about to send my board back and get something else that actually works.

Mr Fixit

We apologize that all the libraries were not ready on the day of release. The I2C (wire) library was finished and posted on Jun 19th.

There are alot of people all over the world working very hard on getting this all going. Some of them at Micochip and Digilent are getting paid, many of them, like myself and Rick, are not. The next one on the list to get finished is Ethernet. After that USB. We are hoping for July for both of them. SPI is also real close to being finished.

Mark


Toley

Thu, 23 Jun 2011 02:17:27 +0000

Hi Mark thanks for all the good work, do you think SD will work soon?


Mr_Fixit

Thu, 23 Jun 2011 02:25:54 +0000

Mark and all others,

Sorry about the complaint session there. Your efforts are greatly appreciated.


KM6VV

Thu, 23 Jun 2011 02:50:46 +0000

Hi Mark,

Any estimate when Servo and MsTimer might be done?

Thanks!

Alan KM6VV


Mr_Fixit

Thu, 23 Jun 2011 06:12:46 +0000

All,

I ran some tests on an Uno32 over the I2C bus with a Devantech CMPS09 pan/tilt/compass and a SRF08 ultrasonic ranger. My test was with only one device at a time, but everything worked flawlessly. Tests also did not even remotely attempt to demonstrate high bit rates. But, this does show that the fundamentals are there and working well.


KM6VV

Thu, 23 Jun 2011 19:18:58 +0000

Probably fine then! After I got my code running (PIC18F2620) to talk to one SRF08, I had no problem adding five more SRF08's, one CMPS03, and even a TPA81!

You might (maybe you have already) include a function to "remap" the addresses of the SRF08's.

Alan KM6VV

All, I ran some tests on an Uno32 over the I2C bus with a Devantech CMPS09 pan/tilt/compass and a SRF08 ultrasonic ranger. My test was with only one device at a time, but everything worked flawlessly. Tests also did not even remotely attempt to demonstrate high bit rates. But, this does show that the fundamentals are there and working well.


Mr_Fixit

Thu, 23 Jun 2011 20:15:55 +0000

Alan (KM6VV),

Pinging works well. I am having some issues with multiple echos though. Any tips on that? I posted the raw data on the general forum.


KM6VV

Fri, 24 Jun 2011 00:43:12 +0000

I probably responded on the general forum as well. I haven't tried the multiple pings.

Alan KM6VV


Mark

Fri, 24 Jun 2011 00:55:40 +0000

The latest test release does have the finished I2C library. It is supposed to be working. I have not tested it.

Mark


deepthought-64

Fri, 24 Jun 2011 06:48:03 +0000

The latest test release does have the finished I2C library. It is supposed to be working. I have not tested it.

Thanks!


deepthought-64

Fri, 24 Jun 2011 08:45:43 +0000

Hm... I was just testing the Wire-lib and it seems not to work for me.

I'm using the linux version (0022-chipkit-linux32-20110619) of mpide and when I try to compile a simple sketch like

#include <Wire.h>
void setup() {
  Wire.begin();
  Wire.beginTransmission(0xc0);
  Wire.send(0x12);
  }

  void loop() { /* empty*/ }

I get the following error:

Wire/Wire.cpp.o: In function `TwoWire::begin()':
Wire.cpp:(.text._ZN7TwoWire5beginEv+0xc): undefined reference to `twi_init'
Wire/Wire.cpp.o: In function `TwoWire::endTransmission()':
Wire.cpp:(.text._ZN7TwoWire15endTransmissionEv+0x18): undefined reference to `twi_writeTo'
Wire/Wire.cpp.o: In function `TwoWire::send(unsigned char)':
Wire.cpp:(.text._ZN7TwoWire4sendEh+0x60): undefined reference to `twi_transmit'
collect2: ld returned 1 exit status

It seems that there are still some depenency to the low-level-avr-functions.

Or do I miss something?


Mr_Fixit

Thu, 30 Jun 2011 16:33:29 +0000

Hi Mark, Any estimate when Servo and MsTimer might be done?

Any news on this at all? :shock: Or would it be best to have a thread for Servo.h?


Mr_Fixit

Fri, 01 Jul 2011 16:38:42 +0000

I2C - Apparently the current I2C (wire.h) library is not quite 100% compatable with Arduino. I was recently trouble shooting an issue with one of my I2C boards when someone recomended I do an I2C Scan using [url]http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/[/url]. This program runs, but is unable to detect any I2C devices that are connected. Apparently there is some deep down technical thing going on that is far beyond me.

My testing included several devices that work perfectly, so I know its not the Uno32, the wiring, or the sensors/effectors, pull up resistors, or any other physical element.

From my perspective, I dont care if I2C Scan works. As long as the devices magically do their thing when told to. However I can assume this indicates a problem inherent in the system that needs to be addressed.


jbogusz

Sat, 02 Jul 2011 20:24:21 +0000

FYI, I downloaded the mpide-0022-chipkit-win-20110619 and tried a simple I2C sketch like:

Wire.beginTransmission(0x23); Wire.send(0xaa); Wire.endTransmission();

talking to a TI PCF8574 I2C expander.

It didn't work on the Uno32, but it did work on the arduino Uno. It could be me, though. SDA->A4 and SCL->A5 with the jumpers tried in both positions. Wish I had a protocol analyzer to see what was happening.


Mark

Mon, 04 Jul 2011 00:04:29 +0000

Hi Mark, Any estimate when Servo and MsTimer might be done?

I put an issue report into github so that all the developers know its still not done. I will try to get someone working on it soon.


Mark

Mon, 04 Jul 2011 00:06:46 +0000

I did some testing on I2C (Wire.cpp) and here is what I found

it works on Uno32 to transmit to a device

the above DOES NOT work on max32

The i2cscan program does not work on either and on the uno32, once I run that command, I can no longer send i2c packets until I hit reset.

I have sent email to the programmer at Digilent that has been working on it.

Mark


Mr_Fixit

Mon, 11 Jul 2011 19:57:40 +0000

Mark,

Any news on an update? You seem to be one of the very few people "In the know" of what is going on in the development side of things. I am just growing concerned because it has been 29 days since the last update, and there has been quite a bit of discussion about several key elements of the Chipkit platforms that are not working, or work partially.

Usually when a new product goes so long without an update, that means support for the product is going away, being defunded, or is in other ways being discontinued.

I know you are not an employee of Digilent, and your efforts ARE appreciated, so please dont take this as a bang on you. Without your help, most of us would be stuck without hope. But, someone needs to ring some bells at Digilent and make them do something effective and pointed VERY soon.


red24dog

Sat, 23 Jul 2011 03:18:46 +0000

With the latest release, mpide-0022-chipkit-win-20110619, I can confirm that the example wire_reader.pde "wire.h" compiles OK! Good work Digilent and keep up the conversions. Will try the HW shortly to talk to a Arduino Uno connected to a "PS2x" Controller which unfortunely does not compile with UNO32. red


Mr_Fixit

Sat, 23 Jul 2011 18:12:01 +0000

With the latest release, mpide-0022-chipkit-win-20110619, I can confirm that the example wire_reader.pde "wire.h" compiles OK! Good work Digilent and keep up the conversions. Will try the HW shortly to talk to a Arduino Uno connected to a "PS2x" Controller which unfortunely does not compile with UNO32. red

Red24dog - The basic functionality does work, but only compiles on a couple platforms, and not for all Chipkit products. However, there are some underlying problems with the I2C communications that come to light when you attempt to use I2CScanner. So, overall, it really is not working.