chipKIT® Development Platform

Inspired by Arduino™

FubarinoSD and Wire Library

Created Wed, 07 Nov 2012 18:57:57 +0000 by MarioV


MarioV

Wed, 07 Nov 2012 18:57:57 +0000

Hi,

i was just testing my new FubarinoSD by uploading an old sketch, which uses i2c via the orignal wire library, from my arduino to it and i cant get it to work.

is it possible that the wire library doesnt work (yet) on the faburinoSD ?? and if thats the case, is there a list of libraries that work on the faburinoSD ??

im a bit confused with that, because i dont know how to get the i2c to work on the faburinoSD...

Any suggestions ??


MarioV

Sat, 10 Nov 2012 15:13:04 +0000

Ok. After some research i finally found a solution and got it to run!

ANSWER: Wire library works on the FubarinoSD just the same as on my arduino UNO/MEGA.

FubarinoSD is brillant...


EmbeddedMan

Sat, 10 Nov 2012 17:18:13 +0000

MarioV,

That's really great that you got it to work. Can you let us know what was wrong the first time you tried it? What did you do differently to get it to work? Other people will probably have the same problem, and documenting the fix here is important.

*Brian


MarioV

Sun, 11 Nov 2012 07:16:00 +0000

Ok. No Problem!

When i tried it with the unmodified MPIDE just nothing happens. No Reaction on the I2C-Pins (1/2) at all.

Then i found out that my FubarinoSD is one of the first 100 boards, which uses the PIC32MX795F512 instead of the PIC32MX440F256H. Probably MPIDE will work with that, but not with mine. So i modified the boards.txt, which can be found in /hardware/pic32/ and finally it worked perfect!

this my FubarinoSD-Part from boards.txt:

############################################################ fubarino_sd.name=FubarinoSD

new items

fubarino_sd.platform=pic32 fubarino_sd.board=BOARD_FUBARINO_SD fubarino_sd.board.define=-D_USE_USB_FOR_SERIAL_ fubarino_sd.ccflags=ffff fubarino_sd.ldscript=chipKIT-MAX32-application-32MX795F512L.ld

end of new items

fubarino_sd.upload.protocol=stk500v2 fubarino_sd.upload.maximum_size=520192 fubarino_sd.upload.speed=115200

fubarino_sd.bootloader.low_fuses=0xff fubarino_sd.bootloader.high_fuses=0xdd fubarino_sd.bootloader.extended_fuses=0x00 fubarino_sd.bootloader.path=not-supported fubarino_sd.bootloader.file=not-supported fubarino_sd.bootloader.unlock_bits=0x3F fubarino_sd.bootloader.lock_bits=0x0F

fubarino_sd.build.mcu=32MX795F512L fubarino_sd.build.f_cpu=80000000L fubarino_sd.build.core=pic32 fubarino_sd.build.variant=fubarino_sd_v11

BTW. Are there level-shifters needed to protect the pic32 from 5v ??

i have tried this (page 10):

http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf

My FubarinoSD works with, using different mosfet-types, as well as without them. Normally the pins are 5v tolerant and i cant see the point of using level-shifters.

Any ideas ?


EmbeddedMan

Sun, 11 Nov 2012 14:18:00 +0000

Well, that's very interesting. Thanks for digging into it and figuring it out. We need to do a little research on our own and figure out exactly why it doesn't work unless you make that change - maybe the I2C registers are in different places between the two processors? Hmm. Anyway, much appreciated.

About the level shifting - the I2C pins on PIC32s are 5V tolerant. So I believe you can use it with a 5V I2C device without a level shifter (just make sure you have your pull-ups to 5V).

*Brian


MarioV

Sun, 11 Nov 2012 20:30:59 +0000

We need to do a little research on our own and figure out exactly why it doesn't work unless you make that change

heres some more from today:

its actually the 32MX795F512H on my board, so i changed one line in boards.txt again:

fubarino_sd.build.mcu=32MX795F512H

...reading in the datasheets i found out, that it has 5 i2c-ports from which 4 are available AND (!) working on my board. Probably its a good choice for the owners of the first FubarinoSD-Boards to write their own documentation anyway, because it is a bit different to the one that i found...

Furthermore i modified the LiquidCrystal-Library for an 40x4-LCD-Display today and voila it works, just like on the arduino!

Overall im so impessed from the FubarinoSD. In fact i will get another one with the PIC32MX440F256H, once the first 100 are sold. :geek:


EmbeddedMan

Sun, 11 Nov 2012 22:18:59 +0000

That's just great! Feel free to write up your findings on the SeeedStudio FubarinoSD page if you'd like : [url]http://www.seeedstudio.com/depot/fubarino-sd-p-1265.html?cPath=132_133[/url]

*Brian