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

PIC16C774 A-D Right Justification

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



Joined: 14 Apr 2004
Posts: 12
Location: UK

View user's profile Send private message

PIC16C774 A-D Right Justification
PostPosted: Wed Apr 14, 2004 10:02 am     Reply with quote

I am using a 16C774 with a 12 bit ADC, the results can be Left of Right Justified in assembler.
Is there a setting that can be used, or has it been incorporated in a later version. I am using 3.181
Thanks
Ttelmah
Guest







Re: PIC16C774 A-D Right Justification
PostPosted: Wed Apr 14, 2004 10:17 am     Reply with quote

Jerry712731 wrote:
I am using a 16C774 with a 12 bit ADC, the results can be Left of Right Justified in assembler.
Is there a setting that can be used, or has it been incorporated in a later version. I am using 3.181
Thanks

Try using ADC=16 in the device statement.
On chips with lesser (10 bit) AD converters, you get:
ADC=8 - sets the chip to left justify, and returns the MSB only
ADC=10 - sets the chip to right justify, and returns both bytes.
ADC=16 - sets the chip to left justify, and returns both bytes.
I have not tried this with the 12bit ADC, but it may work. Otherwise use the #bit directive, and control the justify bit yourself.

Best Wishes
Guest








PostPosted: Wed Apr 14, 2004 10:40 am     Reply with quote

ADC = 12 returns a left justified result for both bytes.
Looks like I will have to go the #Bit way
Many thanks
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