Quantcast
Channel: panStamp forum - All Forums
Viewing all articles
Browse latest Browse all 473

Panstamp AVR1 unable to upload sketch

$
0
0
Hello panstamp community,

I am currently experiencing the following problem with the panstamp AVR1 (the old ones):

This particular panstamp was functioning properly, until one day out of the blue I couldn't upload any sketch to it.

I did some of the tests indicated here: http://arduino.stackexchange.com/questio...g-to-board

In particular, I reached the step of the loopback test, which was performed successfully. Any character I entered, was echoed back (both RX and TX leds of the panstick were flashing each time I typed a character).

So I crossed out the comm port, USB cable and the USB interface chip from being the sources of the problem.

I also tested with a multimeter the Vcc pin of the panstamp (while it was attached to the panstick) and it reported the expected 3.3V.

So possible sources of the problem are:
1) Atmega328p broke
2) Problem with the sketch which was last uploaded to the module.

Starting from (1), I strongly believe that I didn't do anything to harm the chip. I used it only for interfacing an IMU and reporting the results back to the master panstamp through UART. There were no high currents involved or shortcircuits that could possibly burn the chip.

Regarding (2), I think the reason that I can't upload is that the current sketch which writes to the UART is interfering with the programming. I dont know why because I remove the panstamp from the circuit to program it and then I place it again. So there are no wires attached to the RX and TX pins that could possibly interfere with the uploading process.

Here is the code snippet that writes to UART:

void loop() {
if (Serial.available() > 0)
{
request = Serial.read();
if (request == 'O') // Orientation
{
// getOrientation.
// Send yaw, pitch and roll
impack.f = yaw;
Serial.write(impack.b, 4);
impack.f = pitch;
Serial.write(impack.b, 4);
impack.f = roll;
Serial.write(impack.b, 4);
}
}
}

Basically what it does, is wait for request for orientation from the master panstamp and when it receives it, it sends through UART the yaw, pitch and roll values.

I must also mention that the code size is rather big, but Arduino IDE does not show any low memory error msg, so this cant be the problem.

Still, for the record the program size is:

Sketch uses 25,998 bytes (80%) of program storage space. Maximum is 32,256 bytes.
Global variables use 809 bytes (39%) of dynamic memory, leaving 1,239 bytes for local variables. Maximum is 2,048 bytes.

I tried holding the reset button (or wiring a jumper cable from RESET to ground) and then releasing the button (or removing the jumper), just when the IDE reported Uploading..., but it did not work.

I also tried pressing and releasing the reset button as soon as the IDE reports "Uploading" but it also didn't work.

So now I think that the only thing that is left, is burning the bootloader again to the panstamp. Because burning the bootloader, will erase the current sketch that is running and hopefully will fix the problem.

To make long story short, I would appreciate If anyone could help me with this issue or suggest any ideas. If burning the bootloader is the only way to fix the problem, what do I need? Do I need an external programmer or can I use an Arduino as an ISP (the thing is that it uses SPI, which is "occupied" by the RF module of the panstamp)? Is it possible to use panstick to burn the bootloader?

Thanks in advance and sorry for the long post!
I would appreciate any quick help, because I need it for my thesis project!

Viewing all articles
Browse latest Browse all 473

Trending Articles