Simulator - Debug - Variables

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

Hello,

I`m new here.

What is the reason I cannot see the correct Content of patternQPI in Watchwindow?

thanks Ellen

 

/*
 * MyFirstProg.c
 *
 * Created: 07.03.2019 15:25:11
 * Author : User2 
 *
 */ 

#define F_CPU 160000000
#include <avr/io.h>


uint8_t QPI[] = { 0x51, 0x50, 0x49, 0xBE, 0x0A, 13 };	// Life request to device

char patternQPI[] = "(PI30";     // (PI30 <crc> 0D  > Response */
int val1 = 0xff00;

int main(void)
{al1 = QPI[2];
    while (1) 
    {
	val1 = val1 << 1;
	if (val1 < 0) val1 = 0xeeee;
	}
return(0);
}

Appendix sreenshot

Attachment(s): 

This topic has a solution.
Last Edited: Fri. Mar 15, 2019 - 01:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Change char to uint8_t

Jim

Edit: welcome to AVRFreaks!

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

Last Edited: Thu. Mar 14, 2019 - 08:25 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

No, don't change to uin8_t, use an expression formatter.

 

(TL;DR watch patternQPI,s for a string representation, or patternQPI,c as a char)

Also, note that this data is already erased from your program due to the linker garbage collecting it. Either use the array, or turn of garbage collection in the Project Propertes/Toolchain/Linker/Optimization/Garbage Collect unused sections.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

Last Edited: Thu. Mar 14, 2019 - 08:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Now it works.

Thank You

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

... just remember to turn the garbage collection back on... You really want it to remove dead code and data.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)