Memories vs. Production file

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I program the device, in this case a 1284P, with the "production file" option in studio 6.1 "device programming" then go to "memories" and click "verify" under the "flash" section I get an error. Why? The source file is the the same .elf file for both options.

I'm using the AVRISP mkII and it is able to both set and read the fuse bits, so it seems to be working. Thing is, when I try a simple program to flash some leds on each port, it complies and appears to program with no errors, yet it doesn't work. I must be missing something here...

Here's the code:

#define _XTAL_FREQ 20000000UL
#define F_CPU 20000000UL

#include 
#include 

 int main(void)
 {
	 // set SFRs
	 MCUCR=0b00010000;											//disable pull ups
	 ADCSRA=0b00000000;                                         //disable ADC
	 ACSR=0b10000000;											//disable comparator
	 DIDR0=0b00000000;                                          //enable digital input buffer
	 DIDR1=0b00000000;											//enable digital input buffer
	 DDRA = 0b00000000;											//set port a in/out pins
	 DDRB = 0b00000000;                                         //set port b in/out pins
	 DDRC = 0b00000000;                                         //set port c in/out pins
	 DDRD = 0b00000000;


	 unsigned char on = 0b00000010;
	 while ( 1 ) {
		 PORTA = on;
		 PORTB = on;
		 PORTC = on;
		 PORTD = on;
		 _delay_ms( 200 );
		 on = ! on;
		 _delay_ms( 200 );
		 PORTA=0;
		 PORTB=0;
		 PORTC=0;
		 PORTD=0;
		
	 }
	 return 0;
 }
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think that the files are the same. Memories works on .hex and .eep files and not .elf so there maybe something in one file and not in the other which confuses the programmer.

So if you want to use Memories and Verify you have to select the .hex or .eep files instead.

Also please use the CODE button when posting code. I have fixed the above.

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And now looking at your code you are setting all ports as input not outputs.

Also note that PORTC has pins C2-C5 as the JTAG pins and you have no control over them unless you turn JTAG off via the fuse or in firmware.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly