View previous topic :: View next topic |
Author |
Message |
Testadura
Joined: 11 Nov 2004 Posts: 7 Location: ITALY
|
OPAMP |
Posted: Fri Nov 12, 2004 8:48 am |
|
|
Hi,
Somebody has experience with OPAMP ?
CCS not support OPAMP
Thanks |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Nov 12, 2004 9:33 am |
|
|
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
|
|
Posted: Fri Nov 12, 2004 10:22 am |
|
|
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
|
|
Posted: Fri Nov 12, 2004 10:23 am |
|
|
Comparator?? |
|
|
Testadura
Joined: 11 Nov 2004 Posts: 7 Location: ITALY
|
|
Posted: Fri Nov 12, 2004 10:27 am |
|
|
In the PIC16C781 existes an Operational Amplifier |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Nov 12, 2004 11:05 am |
|
|
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
|
|
Posted: Fri Nov 12, 2004 3:05 pm |
|
|
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 |
Posted: Sat Nov 13, 2004 11:59 am |
|
|
Try use external MSP6S2X by Micrichip. |
|
|
Testadura
Joined: 11 Nov 2004 Posts: 7 Location: ITALY
|
|
Posted: Mon Nov 15, 2004 3:10 am |
|
|
OK
I'am starting to work with your helping
Thanks |
|
|
Testadura
Joined: 11 Nov 2004 Posts: 7 Location: ITALY
|
|
Posted: Mon Nov 15, 2004 7:41 am |
|
|
Delete me |
|
|
Testadura
Joined: 11 Nov 2004 Posts: 7 Location: ITALY
|
|
Posted: Mon Nov 15, 2004 7:43 am |
|
|
Mark wrote: | What are you trying to do? |
I'am using Opamp and Comparator within circuit inverter |
|
|
|