Please don't create a new thread everytime, just add the picture here. Maybe you can just drag-and-drop it into the editor?
There was a bug IIRC that the debugger showed values in the watch windows only after execution of the line. So it might be that the first image (3.jgp) just shows the wrong value anyways, and only the second one is correct. I think Bob knows more about that...
Apart from that, there is a waring in Creator which affects how function calls during interrupts are handled (one method is not made re-entrant), maybe thats the issue?
(And the code in question is rather pointless and show be removed by the compiler anyway...)
I just saw that you always show the same line in your screenshots. Are these from different runs of the project, or did you just stop multiple times and looked at the value? Like said before, I would expect the compile to optimize the line in question from the program altogether, so the value of the variable should never be touched.
Can you post your example project showing this behaviour? (Use the 'archive project' function of Creator).
I just stop multiple times and looked at the value.
I can certainly this variable is not used anywhere in the remote.c
I try to add other variables
This phenomenon occurs only in the same address
This is a programming error:
slaveaddress = slaveaddress; is not what you want!
should look something like slaveaddress = slaveid;
But this was not the question. Why does the value of slaveaddress change when it is only assigned to itself?
SorryI own mistakesDMA at playToo careless
So you had slaveaddress as target of a DMA process? How does this come to be? (It is something which could be found with a full text search over the whole project, btw. This is sometimes really helpful...)
I enable the DMA but it seems that there are some problems
The enable DMA would have been changed 02000000H (.map file) address value
Close DMA no longer occurs
I changed Enable DMA after an error occurs
(Thanks to google translation)
#define DMA_BYTES_PER_BURST 2
#define DMA_REQUEST_PER_BURST 1
#define DMA_SRC_BASE (CYDEV_PERIPH_BASE)
#define DMA_DST_BASE (CYDEV_SRAM_BASE)
DMA_Chan = DMA_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST,
DMA_TD = CyDmaTdAllocate();
CyDmaTdSetConfiguration(DMA_TD, 16, DMA_INVALID_TD, TD_TERMIN_EN | DMA__TD_TERMOUT_EN | TD_INC_DST_ADR);
CyDmaTdSetAddress(DMA_TD, LO16((uint32)ADCINC_DEC_SAMP_PTR), LO16((uint32)0));
"The enable DMA would have been changed 02000000H (.map file) address value"
But 0x02000000 is the address of your slaveAddr variabl - look at the comment in your source file (the excerpt from the map file). It seems to be the first variable located in the sRAM, and the sRAM is the target base address for the DMA. And since you set the offset of the target to 0, you write to this variable...
The CyDmaTdSetAddress() call should set a proper address for the target - normally it should be the address of an array in RAM.
(I suspect you did not properly copy the DelSig-ADC example from the AppNote :)