debug setup help

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

I was ok in the earlier version of studio.... In the latest version, I'm struggling to find where/how I can set the program counter. Also, I'm struggling to get the dataspace to display what I'm writing.

lds temp, 0x01
sts 0x100,temp

All I get in the dataspace window at 0x100 is FF.
Can someone point me in the rifht direction pls.
TIA.

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

Right click the line where you want PC and "set next statement"

Your code to store 0x01 into 0x100 should be:

ldi temp, 0x01 
sts 0x100,temp

(the ldi opcode can only be used on R16 to R31 so make sure 'temp' is a synonym for one of R16..R31)

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

What processor are you using? I hope that is NOT the only bit of code you have written. Have you set up your project to use the simulator? Have you done a "Build and Run" or Build and the Start debugging. Not much difference between Studio 3.xx and 4.xx

As Cliff is showing you what you are doing with your code is loading up temp from location 0x0001 not immediately with 0x01.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I've got most things running, using a Mega8, having adapted a previous job to do this one ( 4 digit led, now 4 digit RGB). The lds was a typo,( just as an example) I'm using y and z to index into sram to access and update the pwm values for each led.The whole thing is working using cseg data and non pwm......
I now have control over the PC- thanks, but I can't see changes in sram when I write my data.Maybe my indexing routines are screwed. Software is not my strong point, especially AVR.I'm ok with 51 stuff, but have to get into these AVRs....

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

Well can you post some actual code that you THINK should be changing SRAM and we can verify whether it does/doesn't and if not, why not?

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

Quote:
using a Mega8,
So if you want to get really serious, change the M8 to a M88, same pinout and almost code compatible, but you can go down to a cheaper M48 or to larger M168 and eventually M328.

All of them have on chip debug, debugWire, and you can do real time on chip debugging with a $50 Dragon which will also support JTAG debugging for pretty much all newer chips up to 32K of flash. It is also a ISP, JTAG and HVPP programmer with the ability for a chip to be mounted on it for small projects or learning purposes.

Quote:
Maybe my indexing routines are screwed.
Don't be shy, post your code :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly