Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Programming Problem with BAscom HEX file and AVR Studio

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
robpar

Bascom Member



Joined: 18 Feb 2005
Posts: 32
Location: Vancouver BC

PostPosted: Thu May 19, 2005 5:59 am    Post subject: Programming Problem with BAscom HEX file and AVR Studio Reply with quote

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
View user's profile
robpar

Bascom Member



Joined: 18 Feb 2005
Posts: 32
Location: Vancouver BC

PostPosted: Thu May 19, 2005 6:05 am    Post subject: Reply with quote

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
View user's profile
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Fri May 20, 2005 7:48 pm    Post subject: Reply with quote

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
View user's profile
robpar

Bascom Member



Joined: 18 Feb 2005
Posts: 32
Location: Vancouver BC

PostPosted: Fri May 20, 2005 8:00 pm    Post subject: Reply with quote

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 Embarassed
Back to top
View user's profile
chr-mt

Bascom Member



Joined: 25 Feb 2005
Posts: 128

blank.gif
PostPosted: Sat May 21, 2005 8:34 am    Post subject: Reply with quote

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
View user's profile
robpar

Bascom Member



Joined: 18 Feb 2005
Posts: 32
Location: Vancouver BC

PostPosted: Tue May 24, 2005 4:46 am    Post subject: Reply with quote

Hello Chris:

I think that I do, but I will check for sure and let you know.

Bob
Back to top
View user's profile
robpar

Bascom Member



Joined: 18 Feb 2005
Posts: 32
Location: Vancouver BC

PostPosted: Mon May 30, 2005 4:23 pm    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum