chipKIT® Development Platform

Inspired by Arduino™

New users

Created Fri, 10 Jun 2011 08:51:28 +0000 by gadjet


gadjet

Fri, 10 Jun 2011 08:51:28 +0000

Hi, I've just got my Uno32, after using both Arduino Uno and Jeenodes for a while, it's a bit of a steep learning curve with the new platform.

I have loads of questions, mostly they will be stupid questions with easy answers, so would it be possible to start an area for new users of the chipkit boards and maybe an FAQ with all the answers to the silly questions, and more.

With the Arduino I found there was a lot of support from the Arduino.cc but I don't see the same level of information there for the chipkit.

I need help climbing the steep learning curve! :?

Regards, Phil


WestfW

Fri, 10 Jun 2011 15:23:39 +0000

Part of the requirements for building a "community" seems to be a significant number of people willing to post "stupid questions." So just start asking...


gadjet

Sat, 11 Jun 2011 14:56:48 +0000

Ok here goes.

The onboard LED LD4 is connected to pin13 (as arduino Uno) but it flashes during boot after reset and sometimes it flashes along with the serial LEDs, Why does it do this, is the output13 also toggling.

Using Blink sketch, after a reset it seems to take 4/5 seconds for the sketch to take control, during this time the LD4 is flashing away at a different rate. Is this normal and why.

The LD5 LED how do you control that, from the schematic, it doesn't seem to connect to a I/O pin.

If I wanted to use output 39 (next to 13) do I just address it the same as all the other pins on the Arduino, i.e. 'digitalWrite(39, HIGH);'

Libraries: -

  • Is there a Onewire library, I want to use a DS18B20.
  • I assume an Arduino library has to be rewritten to be used with the Uno32 so existing libraries like the 'Dallas Temperature' library for the DS18B20 wouldn't work with mpide.

Cheers.


Addidis

Sat, 11 Jun 2011 20:45:04 +0000

  1. OK this confused me too. The answer I came down to was the bootloader for the arduino does some stuff when it boots perhaps checks to see if something is programming it ?

  2. see above I didn't hunt down the proper answer because I assumed it was the bootloader it looks eerily similar to programming the board .

  3. I have to look at the schematics for this one , trying to avoid that (i have a migrane atm )

  4. yep but you should be sure to set the pin up properly.

  5. Libraries are a good question , I havent looked at the new release and dont think we have a status page yet. (as far as I am aware the spi and i2c libs are not working yet. but dont quote me because a new mpide came out last night and I just got in.)

Im sure some one will clear up 3 and 5 for ya better then i can at the moment. I would also like a solid answer to the weird start up sequence.


gadjet

Sat, 11 Jun 2011 22:18:54 +0000

My main concern is what is the output on 13 doing, if it's toggling like the LED then my relay I have on pin 13 will be toggling as wel !!!


WestfW

Mon, 13 Jun 2011 04:32:47 +0000

The onboard LED LD4 is connected to pin13 (as arduino Uno) but it flashes during boot after reset and sometimes it flashes along with the serial LEDs, Why does it do this, is the output13 also toggling. Using Blink sketch, after a reset it seems to take 4/5 seconds for the sketch to take control, during this time the LD4 is flashing away at a different rate. Is this normal and why.

The arduino bootloader blinks the pin13 LED several times at startup to show that it is running, and has an option to blink during serial activity as well. It looks like the chipKit bootloader blinks the LED the whole time the bootloader is running (which is not unreasonable, IMO.) Yes, this means that you can't really use pin13 for functions other than the LED.

The current AVR bootloader has a "fast start" option that starts the application immediately after poweron, or after the sketch has finished loading. In detects the reset reason (BOR, PWR, WDT, or RST) and ONLY runs the bootloader on RST. The PIC32 bootloader doesn't seem to have this feature; I don't know whether it's possible on a pic32 (the older ARV bootloader also lacked this feature.)

The AVR bootloader works by setting the watchdog timeout and then looking for bootloader commands. If it gets no commands, it never resets the WDT, and after the appropriate time the WDT fires, resets the chip, and thus starts the app. So in the absence of a quick-start, the bootloader will usually run for a couple of seconds looking for commands even if a sketch is present. I think this explains the 4-5 second pause.

The LD5 LED how do you control that, from the schematic, it doesn't seem to connect to a I/O pin.

It's on "pin 43" (see .../hardware/pic32/cores/pic32/pins_arduino_pic32_uno.cxx )

If I wanted to use output 39 (next to 13) do I just address it the same as all the other pins on the Arduino, i.e. 'digitalWrite(39, HIGH);'

Yep.

I assume an Arduino library has to be rewritten to be used with the Uno32 so existing libraries like the 'Dallas Temperature' library for the DS18B20 wouldn't work with mpide.

It depends. If a library is itself based on top of the "Arduino abstraction layer", it might work fine. If it uses direct port manipulation or interfaces to one of the hardware peripherals in the chip, then it will need re-written. For instance, I'd think a onewire library would be more likely to work than an I2C library, because the AVR doesn't have any tempting one-wire peripheral hardware, and the protocol isn't fast enough to tempt one to direct port manipulation. But I haven't actually looked at it.


Addidis

Mon, 13 Jun 2011 09:57:53 +0000

tyvm west. That is exactly what I was looking for.


gadjet

Mon, 13 Jun 2011 11:27:26 +0000

Wouldn't it be a better idea to use the other led to indicate activity like this then existing arduino sketches would be compatible.


WestfW

Mon, 13 Jun 2011 14:25:32 +0000

existing arduino sketches already blink the pin13 LED "randomly" during the bootloader, so it's not like doing so in chipKit as well makes it any less compatible.

But yeah, it's nice to have an LED to flash that is NOT connected to any external IO pin.


gadjet

Mon, 13 Jun 2011 15:04:06 +0000

existing arduino sketches already blink the pin13 LED "randomly" during the bootloader, so it's not like doing so in chipKit as well makes it any less compatible.

Hmmm, I didn't notice that on my Arduino but I'll check, it may be just that the Arduino boots a lot more quickly and one of the first things I do is switch off the output pin 13.


Jermcb

Fri, 17 Aug 2012 02:13:36 +0000

I am with the original poster. I would really like a new users section... It is far easier for new users to just ask the simplest of questions in a section they know is dedicated to easy questions... I would be one of them.

Thanks,