Show Posts
Pages: 1 [2] 3
16  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 02:59:04 pm
Note: I tried removing the void loop() and just putting on() at the end of setup() and that resulted in no clock signal being output on CKOUT. There was a clock signal being output on the source Arduino, however.
17  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 02:57:14 pm
Can you post the sketch you are using to generate the clock signal?

Code:
// Generate a square wave of a given frequency on the OCR1A pin

#define REQUIRED_FREQUENCY  (1000000)
#define REQUIRED_DIVISOR ((F_CPU/REQUIRED_FREQUENCY)/2)

#if (REQUIRED_DIVISOR < 65536)
# define PRESCALER  (1)
# define PRESCALER_BITS  (1)
#elif (REQUIRED_DIVISOR < 8 * 65536)
# define PRESCALER  (8)
# define PRESCALER_BITS  (2)
#elif (REQUIRED_DIVISOR < 64 * 65536)
# define PRESCALER  (8)
# define PRESCALER_BITS  (3)
#elif (REQUIRED_DIVISOR < 256 * 65536)
# define PRESCALER  (8)
# define PRESCALER_BITS  (4)
#elif (REQUIRED_DIVISOR < 1024 * 65536)
# define PRESCALER  (8)
# define PRESCALER_BITS  (5)
#else
# error Bad frequency
#endif

# define TOP        (((REQUIRED_DIVISOR + (PRESCALER/2))/PRESCALER) - 1)

void setup()
{
  pinMode(9, OUTPUT);
  digitalWrite(9, LOW);
  TCCR1A = 0;
  TCCR1B = (1 << WGM12) | PRESCALER_BITS;    // turn on
  TCCR1C = 0;
  OCR1AH = (TOP >> 8);
  OCR1AL = (TOP & 0xFF);
}

void on()
{
  TCNT1H = 0;
  TCNT1L = 0; 
  TCCR1A = (1 << COM1A0);
}

void off()
{
  TCCR1A = 0;
}

void loop()
{
  // Generate a burst 2ms long, then wait 10ms before generating the next one
  on();
  delay(2); 
  off();
  delay(10);
}
18  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 02:43:49 pm
Aakash, are you certain that images 1 and 2 were taken with the sane sketch generating the clock signal?

I'm 100% sure. I just tried it again today and the output was identical.
19  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 01:48:22 pm
dc42 - I set your sketch to run at 1MHz and connected it to XTAL1. Then ran "avrdude -c avrispmkII -p m328p -P usb -B250" but no-go unfortunately. I suppose I'll just inquire about getting rework done to replace the mcu and resonator.

Thanks anyways guys, I really appreciate your help. When I get the board back I'll be sure to ask on this thread what fuses to set to what values. :-)

Thanks,
Aakash
20  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 01:57:59 am
Nick,

It's possible! I'm just trying to find anything I can do before sending off to get rework done to replace the AVR and resonator.

21  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 18, 2012, 01:08:45 am
Nick,

I do have decoupling caps on both. I'll have to buy a hot air gun to remove the resonator. I'll order one and update this thread in a few days.

Thanks,
Aakash
22  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 11:44:34 pm
Nick,

AVR Studio read in the existing fuses, and showed me that only the low fuse had been modified (the field shows up with a notice once you modify it)

So, I'm pretty confident that I didn't change anything except low fuse.

Thanks though. 
Aakash
23  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 11:02:42 pm
Nick,

I installed your sketch and hooked up the ICSP lines and the only serial output I got was "Atmega chip detector." I also tried connecting D9 to XTAL1 through a 1.5K resistor and the same was outputted.

Should I be doing something differently?

Thanks,
Aakash
24  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 03:05:03 pm
@dc42 - I attached various screenshots of logic analyzer outputs. The file names are as follows:

  • RAW_SOURCE: the output of connecting the analyzer directly to Pin 9 of the clock source Arduino, which is running your code, through a 1.5K resistor.
  • XTAL1: The analyzer output on CKOUT due to connecting Pin 9 of source Arduino to XTAL1 pin on m328p through a 1.5K resistor
  • XTAL2: The analyzer output on CKOUT due to connecting Pin 9 of source Arduino to XTAL2 pin on m328p through a 1.5K resistor


I connected both the Arduino, m328p, and the logic analyzer to a common ground throughout these tests.

How should I proceed?

Thanks again!
Aakash
25  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 05:10:53 am
@dc42 Thanks for the suggestion. I'll check for bridging tomorrow. I'll have to order a 100ohm resistor to test out the clock signal feeding. So that'll take a few days. I'll reply back with results then.

Thanks again everyone.
26  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 04:34:28 am
@dc42

I think the output looks the same at 24MHz. I have a 3.3V Arduino, what freq signal should I be generating to feed to XTAL1? Also, should I still try connecting XTAL1 and CKOUT?

And regarding your resonator question: It is a three terminal resonator. I didn't use my own caps as I believe they're built in. http://www.digikey.com/product-detail/en/CSTCE8M00G55-R0/490-1195-1-ND/584632

Thanks,
Aakash

EDIT: And yes, the center terminal is grounded.
27  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 04:13:18 am
Nick,

I tried using -B250:
Code:
avrdude -p m328p -c avrispmkii -P usb -B250 -F

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F


And regarding the high fuse question, I'm pretty sure. All I did was read in the fuse bits from the fresh chip and change the low bit by hand in AVR Studio. Though, I always could be mistaken.


@dc42 - I don't think CKOUT is outputting anything (see attached screenshot)
28  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 03:40:11 am
@Coding Badley - the system runs at 3.3V, when selecting the current limiting resistor should I account for that voltage or a lower one?

@dc42 - I have Saleae Logic analyzer, should I be able to use that to test if there is a signal being outputted?

@Nick - Should I go lower than -B5 rate?

 Thanks for the help everyone!

Aakash
29  Using Arduino / Microcontrollers / Re: Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 03:09:34 am
If by B0 you mean PB0 (ICP), there is nothing connected to it except a male header pin. Should I do something with this pin?

Thanks!
30  Using Arduino / Microcontrollers / [SOLVED] Set Low Fuse Bit, Now Can't Program over ISP on: November 17, 2012, 02:38:16 am
Hey all,

I'm using an ATMEGA328P in one of my projects and am having a slightly big issue. I have an 8MHz resonator attached to the XTALI/O pins of the AVR, the same resonator that's used in the Arduino Pro. I was using the AVR ISP MKII along with AVR Studio and read in the factory set fuse bits. Then I changed the low fuse bit to 0x05, thinking this would set the chip to use the resonator. Boy, was I wrong. AVR Studio then gave me the error that fuse programming failed, and now I can't really do anything with the chip (note, regular .hex flash programming was working fine beforehand)

I read various articles online and tried debugging with avrdude at a slow speed, and below is the output:

Code:
> avrdude -p m328p -c avrispmkii -P usb -B5 -F

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F

avrdude done.  Thank you.

I read that high voltage programming would fix this up, but the ATMEGA328P is soldered professionally on the board in the QFN package, so unsoldering is not really an option. And it was pretty expensive to have the board manufactured and assembled. Also, when I designed the board, I only added an ISP header.

Is there a way I can recover this chip while it's in-circuit?

I greatly appreciate any help.

Thanks a lot,
Aakash

Pages: 1 [2] 3