View previous topic :: View next topic |
Author |
Message |
Guest
|
CCS and MPLAB |
Posted: Sun Mar 12, 2006 10:37 am |
|
|
hi all,
My program has an array of struct and I'm using a ccs plugin to compile straight from mplab, like this for example:
Code: |
#include <18F4525.h>
typedef struct
{
int8 ns[8];
char tipo;
int credito;
int contador;
}bt;
bt button[3];
void main()
{
button[0].credito = 20;
}
|
The problem is that i can't see this array of struct in the watch window, cause it says unsupported structure.
Does anyone have a clue of why this is happening?
Thanks a lot |
|
|
kastrup_carioca
Joined: 12 Mar 2006 Posts: 1
|
|
Posted: Sun Mar 12, 2006 10:39 am |
|
|
it was me who wrote the previous post, but i forgot to log in.
sorry about that.... |
|
|
bayWeiss
Joined: 01 Mar 2007 Posts: 2
|
|
Posted: Thu Mar 01, 2007 10:27 am |
|
|
What is the solution to the problem? I know that MPLAB will show the array of structs under C18.
cheers! |
|
|
john.ma
Joined: 19 Nov 2012 Posts: 23
|
|
Posted: Wed Feb 20, 2013 6:27 am |
|
|
I know this was quite a while ago but I bumped into this issue today and noticed there is a workaround. It works in my case any how...
So for instance you have a structure or union such as:
Code: |
union DataBuffer {
int8 SPI[bufferSize];
int1 RAW[8*bufferSize];
} SignalData;
|
You may get an "unsupported structure" message in the simulator window when simulating in MPLAB. This is probably because MPLAB doesn't support these datatypes formats by default...
By appending a structure it forces the simulator to interpret the data differently:
Code: |
union DataBuffer {
int8 SPI[bufferSize];
int1 RAW[8*bufferSize];
struct myStruct AUX;
} SignalData;
|
In the case above I'm using a union thus each element in the union structure have to be the same size. In my case I used 13B therefore my struct is 13B.
The simulator watch window will display the first element in the struct... e.g. SPI array.
Not sure anyone else has found a resolution to this, but this may help
Regards,
John |
|
|
|