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 support@ccsinfo.com

setup_adc_ports generates incorrect assembly codes

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



Joined: 06 Apr 2008
Posts: 16

View user's profile Send private message

setup_adc_ports generates incorrect assembly codes
PostPosted: Tue Apr 20, 2010 3:15 am     Reply with quote

Hi,

setup_adc_ports generates following incorrect assemblies, on target 16F1827.

Compiler version "CCS PCM C Compiler, Version 4.104, 51616"

1. There are no registers at BANK 3 0x10 aka 0x190.

Code:

   0DB    1010     BCF 0x10, 0
   0DC    1090     BCF 0x10, 0x1
   0DD    1110     BCF 0x10, 0x2


2. ADPREF<1:0> is incorrectly selected. 0x1e should have both bit 0 and 1 set.

Code:

   0DF    101E     BCF 0x1e, 0
   0E0    149E     BSF 0x1e, 0x1


However, revising 16F1827.h on following lines helps to fix the ADPREF error.

Code:

#define VSS_1V024            0x1300        //| Range 0-1.024V
#define VSS_2V048            0x2300        //| Range 0-2.048V
#define VSS_4V096            0x3300        //| Range 0-4.096V


Full disassembly:

Code:

174:                  setup_adc_ports(sAN11 | VSS_1V024);   
   0D5    3041     MOVLW 0x41
   0D6    0021     MOVLB 0x1
   0D7    009D     MOVWF 0x1d
   0D8    3010     MOVLW 0x10
   0D9    0023     MOVLB 0x3
   0DA    008D     MOVWF 0xd
   0DB    1010     BCF 0x10, 0
   0DC    1090     BCF 0x10, 0x1
   0DD    1110     BCF 0x10, 0x2
   0DE    0021     MOVLB 0x1
   0DF    101E     BCF 0x1e, 0
   0E0    149E     BSF 0x1e, 0x1
   0E1    3000     MOVLW 0
   0E2    0023     MOVLB 0x3
   0E3    008C     MOVWF 0xc


Please confirm/regress and appreciates early fix on confirmation. Thanks!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 20, 2010 12:50 pm     Reply with quote

See this thread. If you believe you have found additional bugs, you
should also email CCS support:
http://www.ccsinfo.com/forum/viewtopic.php?t=42233
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