Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interesting problem of MSP430

Status
Not open for further replies.

scorrpeio

Full Member level 5
Joined
Dec 26, 2006
Messages
286
Helped
10
Reputation
20
Reaction score
9
Trophy points
1,298
Activity points
3,496
Hello,

I have interfaced 128x64 glcd with MSP430. I am using CCS4 compiler and Embedded C language for programming.

My application runs in standalone mode (Display shows something). But, when tried to debug, display remains blank permanently. I tried to find out why does it not work in debug mode, when I faced a strange issue...

I wrote a function to draw vertical line on the display. This function takes an argument as Starting Row No, End Row No, Column No.

Function compares the row nos with maximum row no (63) available on display. After that it finds the minimum and maximum row no and then no of pixels to be illuminated to draw vertical line.

But, when I tried to debug... I could see that debug pointer doesn't at all start execution from the initialisation of local variables. Rather local variables (u8MinRow, u8MaxRow, u8Pixels etc.) are initialised with garbage values. Further, the watch window shows that the variable u8MaxRow(local to the function) and u8EndRow (Argument of the function) are stored in the same register R8. (Please refer attached image) This is a pathetic behavior of compiler. I have checked the optimisation level of compiler. It is set to '0' .

Can anyone tell me why this is happening?
 

Attachments

  • MSP430Problem.JPG
    MSP430Problem.JPG
    152.9 KB · Views: 69
Last edited:

Hello!

Obviously something changes.
Look at the root of your problem.
Do you have an oscilloscope?
In standalone case, try to record every possible signal. If you have a scope with a fair amount
of memory or an analyzer, it will be a matter of minutes.
Beside this, something that may also happen: if you debug, perhaps your system is powered
from JTAG, in which case power might not be present everywhere...
Also check the power level. If the JTAG power is lower than your standalone power, then
that might also explain that you get nothing.

Have fun!

Dora.
 
I am using CCS4 compiler.

The optimisation level is 0 yet it optimises local variables the way it wants

If initialised value of local variable is not used at its first iteration then, compiler optimises the initialisation and completely skips it.

The only solution which I see here is to change the optimisation settings...but I am scared to modify into it cause I hardly have idea about the optimisation and other fundamentals of compiler
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top