New users

Let us know if there are categories or topics to add, or what we need to do to improve these forums!
gadjet
Posts: 8
Joined: Thu Jun 09, 2011 7:36 pm

New users

Post by gadjet » Fri Jun 10, 2011 9:51 am

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
Posts: 148
Joined: Wed May 25, 2011 12:17 am

Re: New users

Post by WestfW » Fri Jun 10, 2011 4:23 pm

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
Posts: 8
Joined: Thu Jun 09, 2011 7:36 pm

Re: New users

Post by gadjet » Sat Jun 11, 2011 3:56 pm

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
Posts: 48
Joined: Fri May 27, 2011 7:24 pm

Re: New users

Post by Addidis » Sat Jun 11, 2011 9:45 pm

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
Posts: 8
Joined: Thu Jun 09, 2011 7:36 pm

Re: New users

Post by gadjet » Sat Jun 11, 2011 11:18 pm

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
Posts: 148
Joined: Wed May 25, 2011 12:17 am

Re: New users

Post by WestfW » Mon Jun 13, 2011 5:32 am

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.
Last edited by WestfW on Mon Jun 13, 2011 11:06 am, edited 1 time in total.

Addidis
Posts: 48
Joined: Fri May 27, 2011 7:24 pm

Re: New users

Post by Addidis » Mon Jun 13, 2011 10:57 am

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

gadjet
Posts: 8
Joined: Thu Jun 09, 2011 7:36 pm

Re: New users

Post by gadjet » Mon Jun 13, 2011 12:27 pm

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
Posts: 148
Joined: Wed May 25, 2011 12:17 am

Re: New users

Post by WestfW » Mon Jun 13, 2011 3:25 pm

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
Posts: 8
Joined: Thu Jun 09, 2011 7:36 pm

Re: New users

Post by gadjet » Mon Jun 13, 2011 4:04 pm

WestfW wrote: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.

Post Reply