View previous topic :: View next topic |
Author |
Message |
danspage
Joined: 14 Sep 2005 Posts: 8
|
PIC 12C508 |
Posted: Wed Sep 14, 2005 11:43 am |
|
|
I noticed that when I was using the set_counters method to
disable and enable the pull up resistors that an older version used the option instruction. Now the latest version uses TRIS ,
Could someone send some light on whats going on with TRIS,
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 12:32 pm |
|
|
First the old compilier .lst file
.................... setup_counters(69,RTCC_DIV_64);
*
001A: MOVLW 45
001B: MOVWF 07
001C: BTFSS 07.3
001D: GOTO 022
001E: MOVLW 07
001F: CLRF 01
0020: MOVLW 0F
0021: OPTION
0022: CLRWDT
0023: MOVF 07,W
0024: OPTION
.................... // 69
.................... // bit 7 Set Disable pullups
.................... // bit 6 Clr Enable wake from sleep
.................... // bit 5
.................... // bit 4
.................... // bit 3 RTCC internal
.................... // bit 2,1,0 DIVIDER Set to 5 = DIV_64
Second the new compiler .lst file
.................... setup_counters(69,RTCC_DIV_64);
*
001A: MOVLW 45
001B: MOVWF 07
001C: BTFSS 07.3
001D: GOTO 022
001E: MOVLW 07
001F: CLRF 01
0020: MOVLW 0F
0021: TRIS 2
0022: TRIS 4
0023: MOVF 07,W
0024: TRIS 2
.................... // 69
.................... // bit 7 Set Disable pullups
.................... // bit 6 Clr Enable wake from sleep
.................... // bit 5
.................... // bit 4
.................... // bit 3 RTCC internal
.................... // bit 2,1,0 DIVIDER Set to 5 = DIV_64
....................
Is the second just a better way? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 14, 2005 12:42 pm |
|
|
In the 2nd listing, can you post a version that shows the hex opcodes ?
I would like to see if it's really doing TRIS instructions.
In MPLAB, you can enable this format by going to the Project menu,
and then Build Options, and then select "MPASM format". |
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 1:26 pm |
|
|
Sorry I'm not using MPLAB
I just have the command line editor.
not sure how to have it output the hex in the lst? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 14, 2005 1:46 pm |
|
|
I don't have PCB, so I can't compile and files for you. In case somebody
else has PCB (or PCW or PCWH), and they want to help, what is the
compiler version that's causing the problem ? This will be a number
like 3.191, or 3.234, etc.
-----------------------------------
If you have the "command line" version of the compiler, it can be
integrated with MPLAB. I do that with PCM and PCH. |
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 2:00 pm |
|
|
I was able to get it to output hex it was a command line switch.::
Thanks
Here's the results:
00155 .................... setup_counters(69,RTCC_DIV_64);
001A 0C45 00156 MOVLW 45
001B 0027 00157 MOVWF 07
001C 0767 00158 BTFSS 07.3
001D 0A22 00159 GOTO 022
001E 0C07 00160 MOVLW 07
001F 0061 00161 CLRF 01
0020 0C0F 00162 MOVLW 0F
0021 0002 00163 TRIS 2
0022 0004 00164 TRIS 4
0023 0207 00165 MOVF 07,W
0024 0002 00166 TRIS 2
0000 00167 .................... // 69
0000 00168 .................... // bit 7 Set Disable pullups
0000 00169 .................... // bit 6 Clr Enable wake from sleep
0000 00170 .................... // bit 5
0000 00171 .................... // bit 4
0000 00172 .................... // bit 3 RTCC internal
0000 00173 .................... // bit 2,1,0 DIVIDER Set to 5 = DIV_64
0000 00174 .................... |
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 2:02 pm |
|
|
Looks like its not really the TRIS instruction. |
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 2:06 pm |
|
|
Sorry I just one more thing to add
Ver 3.234
Thanks
You Pointed me in the right direction!!!!! |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 14, 2005 2:09 pm |
|
|
Right. The 12C508 data sheet shows that 0002 is the opcode for OPTION
and 0004 is the opcode for CLRWDT.
So it appears to be just a cosmetic bug in the symbolic list file output.
You didn't say what version you have, but if you have the latest version
then you could report this to CCS and maybe they'll fix it. |
|
![](templates/subSilver/images/spacer.gif) |
danspage
Joined: 14 Sep 2005 Posts: 8
|
|
Posted: Wed Sep 14, 2005 2:16 pm |
|
|
Ver: 3.234
Thanks so much
Just got it 2 days ago |
|
![](templates/subSilver/images/spacer.gif) |
|