Steve, I do have the x1xx family user guide.
It turns out the CA1 does not have .5*VCC,
but is really just what a 10k resistor will do to 3v...
I thought perhaps the .5*vcc trigger was not meet,
I changed to .25*Vcc, but still no interrupt, and still 1.6v on CA1.
I want to use C instead of assembly, and have tried to figure out
adapt the two assembly code examples, I must be failing somewhere..
Here is the setup assembly from the example (fet110_ca_temp1.S)
SetupCA: mov.b #CARSEL+CAREF0+CAON,&CACTL1 ; -Comp = 0.25*Vcc on
mov.b #P2CA0,&CACTL2 ; +Comp = P2.3
SetupTA: mov.w #TASSEL1+TACLR,&TACTL ; SMCLK, clear TAR
eint ; Enable interrupts
Here is my corresponding C code (but I use CA1 instead of CA0)
CACTL1 = CARSEL | CAREF_025 | CAIE | CAON; // -neg, Ref is .25*Vcc,
interrupts, enable
CACTL2 = P2CA1 | CAF; // Select CA1 +pos, and Filter
TACTL = TASSEL_SMCLK | TACLR | TAIE; // TimerA uses SMCLK, clear
TAR, interrupts
Here is a question, is putting this code below sufficient to
have the Compare interrupt handler defined?
The assembly defines it as
.section .vectors
.org 0x10,0xFF ; Timer_AX Vector
.word TAX_ISR ;
// Timer A0 interrupt service routine
interrupt (TIMERA0_VECTOR)
atimer(void)
{
trigger = 1;
}
Steve Underwood wrote:
Hi Kelly,
I don't think you have described what you are doing in enough detail for
me to make much sense of what you said. What is Timer A doing, and at
what time do you see 1/2 rail on the CA1 pin?
The 11x1 user guide is just the datasheet. The real detail about the
peripherals is in the MSP430x1xx family user;s guide (slau049d).
Regards,
Steve
Kelly Murray wrote:
Hi Steve,
It did look like there are two inputs, thanks for confirmation.
I do have a 11x1 user guide.
When I run the program, I don't get a timer_A interrupt,
the CA1 terminal has a 1.5v on it (.5*VCC), that doesn't seem
to make sense, it should have 3.0V on it once the cap charges,
which is as far as my code goes as yet.
Steve Underwood wrote:
Hi Kelly,
I think Fig 16-1 in the MSP430x1xx family user's guide (slau049d) is
pretty explicit. It shows there are genuinely two comparator inputs,
and the register bits you need to control to make use of them. Do you
have that document, or are you struggling with just the datasheet for
the 1121 itself? You really must have that user's guide to understand
most of the peripherals properly.
Regards,
Steve
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users