CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC 12C508

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PIC 12C508
PostPosted: Wed Sep 14, 2005 11:43 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 12:12 pm     Reply with quote

There could be a bug. Do you want to post the portion of the .LST
file for the setup_counters() function ?

Or,

This thread gives an alternate method of loading the OPTION register:
http://www.ccsinfo.com/forum/viewtopic.php?t=23899&highlight=macro+option
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 12:32 pm     Reply with quote

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?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 12:42 pm     Reply with quote

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".
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 1:26 pm     Reply with quote

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?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 1:46 pm     Reply with quote

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.
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 2:00 pm     Reply with quote

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 ....................
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 2:02 pm     Reply with quote

Looks like its not really the TRIS instruction.
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 2:06 pm     Reply with quote

Sorry I just one more thing to add

Ver 3.234

Thanks
You Pointed me in the right direction!!!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 2:09 pm     Reply with quote

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.
danspage



Joined: 14 Sep 2005
Posts: 8

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 2:16 pm     Reply with quote

Ver: 3.234

Thanks so much Very Happy

Just got it 2 days ago
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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