|
|
View previous topic :: View next topic |
Author |
Message |
tipoldo
Joined: 01 Feb 2006 Posts: 14 Location: Palma Mallorca
|
mplab problems with .COF files |
Posted: Wed Feb 01, 2006 5:11 am |
|
|
Hi to all,
i'm using CCS to program in C, and MPLABSIM to debug my programs. Normally it runs well, but sometimes the MPLABSIM loses the relation between the ASM line and de C line. It happens normally in the modules files. Looking the dissambler file it show a full function implemetation code, and next the corresponding ASM code (together), but it shoud show the ASM code of each C line code.
For example:
BOOLEAN integrarActualizarEntrada(struct S_estadoActualEntrada *estadoActualEntrada,
15: BOOLEAN entradaPin)
16: {
17:
18: //Integramos la entrada
19:
20: if (entradaPin)
21: {
22: estadoActualEntrada->analogica += MOD_I_INT_K_INCREMENTO;
23: //Chequeamos que no nos hemos pasado de 255
24: if (BIT_C)
25: {
26: estadoActualEntrada->analogica = 255;
27: }
28: }
29: else
30: {
31:
32: estadoActualEntrada->analogica -= MOD_I_INT_K_DECREMENTO;
33: //Chequeamos que no hayamos restado menos que 0
34: if (!BIT_C) //En la resta el carry = !borrow, es decir, la lógica es al reves, si se pasa se pone a 0
35: //si no se pasa se pone a 1. Mirar Datasheet.
36: {
37: estadoActualEntrada->analogica = 0;
38: }
39:
40: }
41:
42: //Devolvemos el valor de la entrada en digital según el criterio.
43: //Tiene una histeresis en el cambio de valor:
44:
45: if (estadoActualEntrada->analogica > MOD_I_INT_LIMITE_ON)
46: {
47: estadoActualEntrada->digital = 1;
48: }
49: else if (estadoActualEntrada->analogica < MOD_I_INT_LIMITE_OFF)
50: {
51: estadoActualEntrada->digital = 0;
52: }
53:
54: return estadoActualEntrada->digital; //Si no esta ni por encima ni por debajo no modificamos
55:
56: }
57:
58:
59:
60:
61:
62:
04F 1683 BSF 0x3, 0x5
050 08C3 MOVF 0x43, F
051 1903 BTFSC 0x3, 0x2
052 2861 GOTO 0x61
053 3001 MOVLW 0x1
054 0742 ADDWF 0x42, W
055 0084 MOVWF 0x4
056 3007 MOVLW 0x7
057 0700 ADDWF 0, W
058 0080 MOVWF 0
059 1C03 BTFSS 0x3, 0
05A 2860 GOTO 0x60
05B 3001 MOVLW 0x1
05C 0742 ADDWF 0x42, W
05D 0084 MOVWF 0x4
05E 30FF MOVLW 0xff
05F 0080 MOVWF 0
....... continue
Somebody has had a similar problem?
Another problem is that in the wach tool from MPLAB, it show 8 bit pointers like 16 bit pointers?? why?? how can I change that??
Thank's and reggards from Spain!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 01, 2006 1:46 pm |
|
|
In the Watch window, right-click with your mouse on the symbol name.
In the pop-up menu, select Properties. There is a drop down box
to set the size to 8, 16, 24 or 32 bits.
If there's a problem with the .COF file, then report it to CCS support. |
|
|
tipoldo
Joined: 01 Feb 2006 Posts: 14 Location: Palma Mallorca
|
|
Posted: Tue Feb 07, 2006 12:13 pm |
|
|
Hello "PCM programmer",
First, thank you for your answer.
- Also, about the problem of the 8 bit pointer, I knowed this drop down box in the properties window, but the problem is that when I add a pointer variable with the "Add symbol" from the watch tool. In this case, the drop down box from the properties of the pointer variable is disable, and always shows this pointer variable with 16 bit (and my pic has only 8 ). I think that is a MPLAB problem, and therefor perhaps this is not the correct forum.
- About the cod file problem, I have got still this problem. Then, I will send a sample code to CCS support. I you want this sample file, say to me pleas and will I add a copy to you. My email is tipoldo+ccs@gmail.com.
Best Regards and sorry for my bad english!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 07, 2006 12:43 pm |
|
|
Quote: | About the cod file problem, I have got still this problem |
In the title of your original post you said it's a COF file problem.
Now you say it's a COD file problem. Those are not the same.
I think CCS should handle the problem. I don't want to exchange
files with board users. |
|
|
tipoldo
Joined: 01 Feb 2006 Posts: 14 Location: Palma Mallorca
|
|
Posted: Wed Feb 08, 2006 2:58 am |
|
|
Sorry, I have wrong wrotten. It has to be .cof file. Thank you for all. |
|
|
tipoldo
Joined: 01 Feb 2006 Posts: 14 Location: Palma Mallorca
|
|
Posted: Fri Feb 10, 2006 3:22 am |
|
|
Up to now, what I have seem is that, when I finish the main file with the includes of the .c file of the modules (due CCS hasn't a linker), it have to finish with a EOL. In the case that I don't put this EOL, the compiler doesn't show any errors, but the .cof doesn't include the code including in the corresponding .c file. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|