View previous topic :: View next topic |
Author |
Message |
robpar
Joined: 18 Feb 2005 Posts: 32 Location: Vancouver BC
|
Posted: Thu May 19, 2005 5:59 am Post subject: Programming Problem with BAscom HEX file and AVR Studio |
|
|
I am looking for help with a programming error that I am getting
from Studio 4.10 build 356.
I am trying to write a HEX file that has been produced by Bascom AVR to my
Mega 162. The error I get is as follows:
Erasing Device OK
Programming FLASH using block mode OK
Reading FLASH using block mode OK
WARNING: FLASH contents differ from file: FAILED
Leaving Programming Mode OK
I don't understand how the Flash contents can be different from the file
so I really do not know where to go from here.
Thank You for the Help
Bob Parry |
|
Back to top |
|
|
robpar
Joined: 18 Feb 2005 Posts: 32 Location: Vancouver BC
|
Posted: Thu May 19, 2005 6:05 am Post subject: |
|
|
Opps forgot to post the code:
This is just a little something to test and understand PWM and
BASCOM .
'A test of the PWM features of an Mega 162
'Using Bascom
'Coping sample code from the Samples Directory
$regfile = "m162def.dat"
$crystal = 7372800
'And the TIMER can be used in PWM mode
'You have the choice between 8,9 or 10 bit PWM mode
'Also you can specify if the counter must count UP or down after a match
'to the compare registers
'Note that there are two compare registers A and B
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Down , Prescale = 1
'to set the PWM registers, just assign a value to the compare A and B registers
'Compare1a = 100
'Compare1b = 200
'Or for better reading :
Pwm1a = 0
Pwm1b = 200
Pwm_loop:
For Pwm1a = 0 To 150
Waitms 250
Next
For Pwm1a = 150 To 0
Waitms 250
Next
Goto Pwm_loop
End |
|
Back to top |
|
|
chr-mt
Joined: 25 Feb 2005 Posts: 128
|
Posted: Fri May 20, 2005 7:48 pm Post subject: |
|
|
Hi,
what kind of programmer do you use ?
If it's the Atmel AVRISP programmer, you may have to update it's firmware, because newer Versions of AVR Studio do not work with older firmware.
If so, be careful when you update the AVRISP.
Only connect VCC and GND.
If the controller sends data within the update process, the firmware maybe will be messed up and you can't use your programmer any more.
If that happened, it can be fixed.
You can find informations about that on the web.
Christopher |
|
Back to top |
|
|
robpar
Joined: 18 Feb 2005 Posts: 32 Location: Vancouver BC
|
Posted: Fri May 20, 2005 8:00 pm Post subject: |
|
|
I though after I posted that I should have mentioned that.
I am using the Atmel STK 500 board with AVR Studio 4.10
Bob Parry |
|
Back to top |
|
|
chr-mt
Joined: 25 Feb 2005 Posts: 128
|
Posted: Sat May 21, 2005 8:34 am Post subject: |
|
|
Hi,
As fa as i know the STK 500 uses the same firmware as the AVRISP.
Do you have same settings for "Chip" (MEGA162) in Bascom and AVR Studio ?
Christopher |
|
Back to top |
|
|
robpar
Joined: 18 Feb 2005 Posts: 32 Location: Vancouver BC
|
Posted: Tue May 24, 2005 4:46 am Post subject: |
|
|
Hello Chris:
I think that I do, but I will check for sure and let you know.
Bob |
|
Back to top |
|
|
robpar
Joined: 18 Feb 2005 Posts: 32 Location: Vancouver BC
|
Posted: Mon May 30, 2005 4:23 pm Post subject: |
|
|
Chris:
I upgraded AVR Studio to 4.11 and all is well. There apparently was a
bug in Studio when using similar parts such as MEGA 16, MEGA162 and
similar parts.
All seems to be working now.
Bob |
|
Back to top |
|
|
|