Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
-SOLVED-[GNU/Linux - Pinguino IDE] - Resetting device... and?
01-10-2013, 12:16 AM, (This post was last modified: 01-10-2013, 06:51 PM by FlacoDev.)
#1
-SOLVED-[GNU/Linux - Pinguino IDE] - Resetting device... and?
Hello,
I'm experiencing some problem while trying to send the AnalogReadSerial code example.
Equipment specs.:
Card: PIC32-Pinguino-MX220
PC: FujitsuSiemens Amilo Si 1520
OS: GNU/Linux
-> Distro: Arch Linux
IDE revision: x.4 (I downloaded it from the svn if I remember correctly).

First of all; I have a little annoying-free-software-lover thing to pin:
On the "README" file we can read:
Quote:...
Pinguino (32 bits) is based on open source software:
- compiler GCC ...
...
Well; I didn't look for the other soft license but, as we can see here the Gnu Compiler Collection is under a GNU GPLv3 license; which means it is a Free(/Libre) software and not an Open Source software. :)

I've tried on all my USB ports (to be sure it wasn't a port-related issue);
The USB cable is totally new.
I selected the (32 bits - USB Bootloader) PIC32 Pinguino 220 in the card selector.
I have tried to follow the same process on a Windows 7 SP2 (Not sure for the SPx though) and I had exactly the same problem (it wasn't on the same computer but on a HP Pavillon dv5 dualbooting a MSWin 7 and a Ubuntu Studio 13.04).

So; here's my problem: I have installed all the Pinguino IDE dependencies and the IDE as well in ~/prog/pinguino
I'm launching a little sudo sh pinguino_start.sh when I'm in the file's directory and everything is okay; I see a splash screen with the Pinguino's ElectroTux and the IDE's main window appears.
I open an existing file: examples/01.Basics/AnalogReadSerial/AnalogReadSerial.pde (I also tried other example codes).
I compile (everything works fine) and then I choose to send (upload?) the running program on my board (which is in bootloader mode).

The compiler standard output gave me this:
(from /home/flaco/prog/pinguino/x.4/source/stdout)
Quote:UBW32 found: 1610633216 bytes free

Erasing...

Writing hex file '/home/flaco/prog/pinguino/x.4/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.hex':...................................................................................................................................................

Resetting device...

And nothing's happening. I have read the other thread about my problem but it didn't helped. It's my first development board and I'm a little bit confused (and sad) since I can't get in the board dev world yet. :(

Oh; another precision; since the "0A" (or "A0", I don't remember) in the original example code is not working for some reason (I'll look for the reason and how to fix it later), I have modified the analogRead() function's input (I've tried with 15 and 5).

AnalogReadSerial.pde:
Code:
This example code is in the public domain.
*/

void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(15);
  Serial.print("input 15 = ");
  Serial.println(sensorValue, DEC);
  Serial.print("\n\r");
}

Thank you,

Flaco :)

EDIT: I also tried other examples (such as blink.pde, etc) and I still have the same problem.

EDIT²: As I could have read in the PIC32-Pinguino-MX220 user's manual the A0 should refer to the analog pin n°0.
I couldn't find a tutorial about the pins & co; how it works, etc... can somebody help me? :)
Is there a proper documentation for the used libs & language, by the way? :)
Reply
01-10-2013, 10:04 AM,
#2
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
I don't have a PIC32 Pinguino, but you can see: http://wiki.pinguino.cc/index.php/I/O_Mapping for a pin number cross-reference for the Olimex PIC32 Pinguino
Reply
01-10-2013, 10:21 AM,
#3
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
Hi Arthur,
Here is some brief information about how the IDE works : http://wiki.pinguino.cc/index.php/How_ca...inguino%3F. It's a simple way to find where is the code that doesn't work.

About pin's name :
They are still in p32/include/pinguino/core/const.h (but they will have to be moved in pin.h just as we did with 8-bit). You will see that A0, A1, ..., are only defined for PIC32_PINGUINO and PIC32_PINGUINO_OTG, so this is still a work to do for PIC32_PINGUINO_220. If you want to do it, you should also have a look at digitalw.c where Pinguino's pin number are defined.

About analogRead() :
You will find the code in analog.c, I think you already know that not all pins are capable of analog input. It seems pins 0, 1, 2, 3, 4, 5, 14, 15, 16, 17, 18 and 19 are the only ones concerned with your board. So if you tried with pins 15 and 5, it should have worked with both.

Just to be sure, try to connect leds to these pins and make them blink.

BTW, you can use :

Serial.printf("input 15 = %d\n\r", sensorValue);

instead of :

Serial.print("input 15 = ");
Serial.println(sensorValue, DEC);
Serial.print("\n\r");

it's up to you.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
01-10-2013, 12:35 PM, (This post was last modified: 01-10-2013, 12:38 PM by FlacoDev.)
#4
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
Good day,
Thanks to you guys for your answers.


(01-10-2013, 10:21 AM)regis Wrote: Hi Arthur,
About analogRead() :
You will find the code in analog.c, I think you already know that not all pins are capable of analog input. It seems pins 0, 1, 2, 3, 4, 5, 14, 15, 16, 17, 18 and 19 are the only ones concerned with your board. So if you tried with pins 15 and 5, it should have worked with both.

Just to be sure, try to connect leds to these pins and make them blink.

The problem is that the IDE freeze on the "Resetting device..." and the leds are "turned off" on my board. After that; nothing. :/

By the way, is there any electronical convention/rule about the negative and positive "side" of a pin? (Ex.: I know a led has a negative and positive "side" but I don't know if I have to put it on the board regarding that rule. I guess yes.)

regis Wrote: BTW, you can use :

Serial.printf("input 15 = %d\n\r", sensorValue);

instead of :

Serial.print("input 15 = ");
Serial.println(sensorValue, DEC);
Serial.print("\n\r");

it's up to you.

Yes, of course. :D
I should code less in C++ hahaha

Thanks,

Flaco

EDIT: I'm gonna read some sources to see if I can help with the libs and the A0, A1, ... macros/pointer/other :)
Reply
01-10-2013, 05:05 PM, (This post was last modified: 01-10-2013, 05:06 PM by pingotg.)
#5
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
Most devices have a specific set of pins, such as your diode, and it's vital to connect them properly. If you don't you risk destroying things.

You should not need to use sudo. Fix the device permissions such as using udev rules.

John
Reply
01-10-2013, 05:07 PM, (This post was last modified: 01-10-2013, 05:08 PM by FlacoDev.)
#6
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
Hi pingotg, thanks for you answer. I'll do that. :)
How can I know for the right pins, etc? User's manual? :)

Also, this resetting problem is really annoying; I installed the IDE on my Ubuntu and still have the same problem (it doesn't matter if I launch the IDE as root or not).

Here's a video of what's happening for my board: (note that the first times I plugged my board, the green LED was automatically turned on).




Sorry for the pseudo-hazardous English. I'm pretty tired actually. ._.

Thanks,

Flaco
Reply
01-10-2013, 05:09 PM,
#7
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
I'm lost. Long confusing post with multiple topics all mixed up.

Suggest you start a short thread with just what you think is wrong.

John
Reply
01-10-2013, 05:11 PM, (This post was last modified: 01-10-2013, 06:30 PM by FlacoDev.)
#8
RE: [GNU/Linux - Pinguino IDE] - Resetting device... and?
Well; at first, I created this thread for that "Resetting device" issue but I talked about the pins as well. :x
Sorry for that.

Edit: I'm a pure noob in electronics and embedded programing so I tend to have a lot of questions. :/
But that's secondary, I can read the manuals, etc.. but for that "Resetting Device" issue I'm completely lost.
Can it be a board-related problem?

EDIT: As I said earlier, the green led (onboard) is not turned on anymore; when I plug my board.
But if I plug a led on the D12 - D13 and touch the leads with my fingers; the green led (onboard) is weakly 'shining'.
Idem if I plug the led on the D8 - D9 but this time this is the red led (onboard), without touching it, that shine.
It shines a little bit harder if I touch it. :(
Reply
01-10-2013, 06:55 PM,
#9
RE: -SOLVED-[GNU/Linux - Pinguino IDE] - Resetting device... and?
Thanks to Régis (in a thread I just lost), my problem is solved (I just had to send the code in 10 seconds max; or something like that, after the device's bootloader mode starts).
Well you see, uh.

Thanks to everyone for the help about the pins as well. Smile Time to have fun.

Flaco
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)