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

OPAMP

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



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

OPAMP
PostPosted: Fri Nov 12, 2004 8:48 am     Reply with quote

Hi,

Somebody has experience with OPAMP ?
CCS not support OPAMP
Thanks
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Nov 12, 2004 9:33 am     Reply with quote

Well if you are talking about a general purpose OP-AMP then there is nothing to support! They typically only have passive components such as resistors and capacitors connected to them to make them "do" something.
Testadura



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

PostPosted: Fri Nov 12, 2004 10:22 am     Reply with quote

I am talking about OpAmp in the micro.
Somebody has code example for this peripheral ?
Thanks
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Nov 12, 2004 10:23 am     Reply with quote

Comparator??
Testadura



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

PostPosted: Fri Nov 12, 2004 10:27 am     Reply with quote

In the PIC16C781 existes an Operational Amplifier
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Nov 12, 2004 11:05 am     Reply with quote

What are you trying to do?

Code:

#define OPAMP_ON            0b10000000
#define OPAMP_OFF           0b00000000
#define FAST_MODE           0b00000001
#define SLOW_MODE           0b00000000

#byte OPACON = 0x11C
#byte CALCON = 0x110
#byte DAC    = 0x11E
#byte DACON0 = 0x11F

#define setup_opamp(x) OPACON = x


BOOLEAN calibrate_opamp_internal(void)
{

  // Turn on the opamp 2MHz GBWP
  OPACON = OPAMP_ON | FAST_MODE;

  // Set reference to 1.2V
  bit_clear(CALCON, 5);   

  // Start the calibration
  bit_set(CALCON, 7);     

  // Wait on the calibration
  while( bit_test(CALCON, 7) );

  // Check for an error
  if (bit_test(CALCON, 6))
    return(false);
  else
    return(true);
   
}

BOOLEAN calibrate_opamp_dac(int value)
{

  // Turn on the opamp 2MHz GBWP
  OPACON = OPAMP_ON | FAST_MODE;

  // Set reference to DAC
  bit_set(CALCON, 5);   

  // Set the DAC voltage
  DAC = value;

  // Enable DAC
  DACON0 = 0b10000000;

  // Start the calibration
  bit_set(CALCON, 7);     

  // Wait on the calibration
  while( bit_test(CALCON, 7) );

  // Check for an error
  if (bit_test(CALCON, 6))
    return(false);
  else
    return(true);
   
}
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Fri Nov 12, 2004 3:05 pm     Reply with quote

Microchip's AN823 has loads of good aplication information for the C78x parts.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
JK
Guest







Try
PostPosted: Sat Nov 13, 2004 11:59 am     Reply with quote

Try use external MSP6S2X by Micrichip.
Testadura



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

PostPosted: Mon Nov 15, 2004 3:10 am     Reply with quote

OK
I'am starting to work with your helping
Thanks
Testadura



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

PostPosted: Mon Nov 15, 2004 7:41 am     Reply with quote

Delete me
Testadura



Joined: 11 Nov 2004
Posts: 7
Location: ITALY

View user's profile Send private message

PostPosted: Mon Nov 15, 2004 7:43 am     Reply with quote

Mark wrote:
What are you trying to do?


I'am using Opamp and Comparator within circuit inverter
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