Reply by empresst007 July 6, 20082008-07-06
Ok, I stripped down to a single external interrupt and then realized I
just had all sorts of wrong initialization things happening. This is
a skeleton of what I've down - and it works!

----------------------------------

//***Pin selections for UART and interrupt
PINSEL0 = 0x00050000;
//set pin0.9 for UART 1 as RxD1 to receive in to Terminal
//set pin 0.8 for UART1 as TxD1 to transmit into Terminal
PINSEL1 = 0x00000001;
//set pin 0.16 as EINT0 for signal B low and B2 pushbutton

//***Initialize UART1
U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit, Divisor
Latch enabled (DLAB = 1 to set baud rate)
U1DLL = 0x00000030; //pclk = 14Mhz, VPBDIV = 0x04, 19200 baud
U1DLM = 0x00;
U1LCR = 0x00000003; //DLAB = 0

//***Initialize Interrupt
EXTMODE = 0x00; //level sensitivity for all
EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
VICVectCntl0 = 0x0000002E; //priority slot for EINT0 - dec 14
VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ into VIC
slot
VICIntEnable = 0x00004000; //EINT0 is enabled for interrupt requests
(bit 14)

---------------------------------

I will get the second external interrupt going and then incorporate
this all into a position counter program. Wish me luck!

Thanks!
Trish
--- In l..., "Keith Gravlin" wrote:
>
> Trish,
>
> By "did as you said" I assume you mean filled in the VIC control and
> address registers with valid info for the two interrupts you intend
> to have. You can't comment out the VICIntEnable line because then
> you 'won't' get any interrupts. Just change the line to:
> VICIntEnable = 0x0000C000; //EINT0 & EINT1 are enabled...
>
> Send me your code if you'd like and I'll see what's what.
>
> Keith
> --- In l..., "empresst007" wrote:
> >
> > Keith,
> >
> > I did as you said and I still have nothing showing up in Terminal.
> If
> > I physically comment out the VICIntEnable line, I can see characters
> > in Terminal, but then I won't be able to interrupt.
> >
> > I'm using Eclipse with the Olimex lpc2138 development board.
> >
> > Trish
> >
> > --- In l..., "Keith Gravlin" wrote:
> > >
> > > Trish,
> > >
> > > You will still need to fill the control and vector slot for each
> > > interrupt (14 for EINT0, 15 for EINT1).
> > >
> > > Your code also shows you enabling the interrupt for UART1. If
> you
> > > don't intend to get interrupts from that you need to clear d7 in
> the
> > > value you are sending to VICIntEnable else it will surely cause
> > > problems.
> > >
> > > You should also be initializing the U1DLM for your baudrate
> unless
> > > you are counting on the reset value (haven't calulated if it
> would be
> > > correct but not really a good idea anyway).
> > >
> > > Let me know how much further you get.
> > >
> > > Btw what dev environment are you using?
> > >
> > > Keith
> > >
> > >
> > >
> > > --- In l..., "empresst007" wrote:
> > > >
> > > > Hi Keith,
> > > >
> > > > I think I was a bit too ambiguous, but I'm not trying to
> interrupt
> > > > from UART1. The ultimate goal is to send my position counter
> value
> > > to
> > > > Terminal. I'll have a massive while loop that continuously
> spits
> > > out
> > > > my position counter to Terminal (whether or not the shaft is
> > > actually
> > > > moving). I have two interrupts that will kick in (for signal A
> and
> > > > signal B) once the encoder shaft moves.
> > > >
> > > > And that is really all I have for initializing everything. So
> it is
> > > > possible that I completely left out other init and handler
> items.
> > > > What else am I missing?
> > > >
> > > > And I made sure I to clear the interrupt flag.
> > > >
> > > > Thanks!
> > > > Trish
> > > >
> > > > --- In l..., "Keith Gravlin" wrote:
> > > > >
> > > > > Trish,
> > > > >
> > > > > I can't say I checked every line of your code for proper init
> > > values
> > > > > but the interrupt setup below that is missing alot.
> > > > >
> > > > > You need to set up the control and vector slot for each
> interrupt
> > > (7
> > > > > for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the
> > > watch
> > > > > dog).
> > > > >
> > > > > I'm not sure from your msg how you are 'transmitting' but
> with
> > > out
> > > > > vectors in place (at least) you will continuously receive
> > > unhandled
> > > > > interrupts.
> > > > >
> > > > > Don't forget to clear the int flag for each interrupt
> (different
> > > ways
> > > > > depending on the interrupting device) during the handler and
> > > > > acknowledge by writing a 0 to the VICADDRESS register.
> > > > >
> > > > > There are a number of other init and handler items that don't
> > > seem to
> > > > > be in your msg but I couldn't figure out how much you left
> out to
> > > > > keep the message short.
> > > > >
> > > > > Hope this helps,
> > > > > Keith
> > > > >
> > > > >
> > > > > --- In l..., "empresst007"
> wrote:
> > > > > >
> > > > > > Hi All!
> > > > > >
> > > > > > I am setting up an interrupt to read encoder signals (EINT0
> and
> > > > > EINT1)
> > > > > > and then displaying my position on UART. I was able to
> create
> > > an
> > > > > echo
> > > > > > UART, and thanks to Robert, I'm able to read encoder
> signals.
> > > > > >
> > > > > > There is an interrupt initialization line of code that
> prevents
> > > > > > transmitting to Terminal through UART1. When the
> VICIntEnable
> > > is
> > > > > > commented out, I can send to Terminal.
> > > > > >
> > > > > > This is the initialization. It's the last line, the
> > > VICIntEnable,
> > > > > > that prevents me from transmitting.
> > > > > > ------------------------
> ----
> > > ----
> > > > > -
> > > > > >
> > > > > > //***Pin selections for UART and interrupt
> > > > > > PINSEL0 = 0x000500C0;
> > > > > > //set pin0.9 for UART 1 as RxD1 to receive in to
> Terminal
> > > > > > //set pin 0.8 for UART1 as TxD1 to transmit into
> Terminal
> > > > > > //set pin 0.3 as EINT1 for signal A low
> > > > > >
> > > > > > //***Initialize UART
> > > > > > U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit,
> > > Divisor
> > > > >
> > > > > > Latch enabled (DLAB = 1 to set baud rate)
> > > > > > U1DLL = 0x000000C0; //4800
> > > > > > U1LCR = 0x00000003;
> > > > > >
> > > > > > //***Initialize Interrupt
> > > > > > PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B
> low
> > > > > > EXTMODE = 0x00; //level sensitivity for all
> > > > > > EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> > > > > > VICVectCntl0 = 0x0000002F; //select priority slot for a
> > > given
> > > > > > interrupt
> > > > > > VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of
> IRQ
> > > into
> > > > > VIC
> > > > > > slot
> > > > > > VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are
> enabled
> > > for
> > > > > > interrupt requests (bit 15 & 14)
> > > > > > ------------------------
> ----
> > > ----
> > > > > --
> > > > > >
> > > > > > Whether or not I set the UART1 bit or not, I can't transmit.
> > > > > >
> > > > > > Has anyone encountered this problem? Did I forget to set
> > > another
> > > > > > register?
> > > > > >
> > > > > > Thanks!
> > > > > > Trish
> > > > > >
> > > > >
> > > >
> > >
>

An Engineer's Guide to the LPC2100 Series

Reply by empresst007 July 4, 20082008-07-04
Keith,

I did as you said and I still have nothing showing up in Terminal. If
I physically comment out the VICIntEnable line, I can see characters
in Terminal, but then I won't be able to interrupt.

I'm using Eclipse with the Olimex lpc2138 development board.

Trish

--- In l..., "Keith Gravlin" wrote:
>
> Trish,
>
> You will still need to fill the control and vector slot for each
> interrupt (14 for EINT0, 15 for EINT1).
>
> Your code also shows you enabling the interrupt for UART1. If you
> don't intend to get interrupts from that you need to clear d7 in the
> value you are sending to VICIntEnable else it will surely cause
> problems.
>
> You should also be initializing the U1DLM for your baudrate unless
> you are counting on the reset value (haven't calulated if it would be
> correct but not really a good idea anyway).
>
> Let me know how much further you get.
>
> Btw what dev environment are you using?
>
> Keith
>
> --- In l..., "empresst007" wrote:
> >
> > Hi Keith,
> >
> > I think I was a bit too ambiguous, but I'm not trying to interrupt
> > from UART1. The ultimate goal is to send my position counter value
> to
> > Terminal. I'll have a massive while loop that continuously spits
> out
> > my position counter to Terminal (whether or not the shaft is
> actually
> > moving). I have two interrupts that will kick in (for signal A and
> > signal B) once the encoder shaft moves.
> >
> > And that is really all I have for initializing everything. So it is
> > possible that I completely left out other init and handler items.
> > What else am I missing?
> >
> > And I made sure I to clear the interrupt flag.
> >
> > Thanks!
> > Trish
> >
> > --- In l..., "Keith Gravlin" wrote:
> > >
> > > Trish,
> > >
> > > I can't say I checked every line of your code for proper init
> values
> > > but the interrupt setup below that is missing alot.
> > >
> > > You need to set up the control and vector slot for each interrupt
> (7
> > > for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the
> watch
> > > dog).
> > >
> > > I'm not sure from your msg how you are 'transmitting' but with
> out
> > > vectors in place (at least) you will continuously receive
> unhandled
> > > interrupts.
> > >
> > > Don't forget to clear the int flag for each interrupt (different
> ways
> > > depending on the interrupting device) during the handler and
> > > acknowledge by writing a 0 to the VICADDRESS register.
> > >
> > > There are a number of other init and handler items that don't
> seem to
> > > be in your msg but I couldn't figure out how much you left out to
> > > keep the message short.
> > >
> > > Hope this helps,
> > > Keith
> > >
> > >
> > > --- In l..., "empresst007" wrote:
> > > >
> > > > Hi All!
> > > >
> > > > I am setting up an interrupt to read encoder signals (EINT0 and
> > > EINT1)
> > > > and then displaying my position on UART. I was able to create
> an
> > > echo
> > > > UART, and thanks to Robert, I'm able to read encoder signals.
> > > >
> > > > There is an interrupt initialization line of code that prevents
> > > > transmitting to Terminal through UART1. When the VICIntEnable
> is
> > > > commented out, I can send to Terminal.
> > > >
> > > > This is the initialization. It's the last line, the
> VICIntEnable,
> > > > that prevents me from transmitting.
> > > > ----------------------------
> ----
> > > -
> > > >
> > > > //***Pin selections for UART and interrupt
> > > > PINSEL0 = 0x000500C0;
> > > > //set pin0.9 for UART 1 as RxD1 to receive in to Terminal
> > > > //set pin 0.8 for UART1 as TxD1 to transmit into Terminal
> > > > //set pin 0.3 as EINT1 for signal A low
> > > >
> > > > //***Initialize UART
> > > > U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit,
> Divisor
> > >
> > > > Latch enabled (DLAB = 1 to set baud rate)
> > > > U1DLL = 0x000000C0; //4800
> > > > U1LCR = 0x00000003;
> > > >
> > > > //***Initialize Interrupt
> > > > PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B low
> > > > EXTMODE = 0x00; //level sensitivity for all
> > > > EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> > > > VICVectCntl0 = 0x0000002F; //select priority slot for a
> given
> > > > interrupt
> > > > VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ
> into
> > > VIC
> > > > slot
> > > > VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are enabled
> for
> > > > interrupt requests (bit 15 & 14)
> > > > ----------------------------
> ----
> > > --
> > > >
> > > > Whether or not I set the UART1 bit or not, I can't transmit.
> > > >
> > > > Has anyone encountered this problem? Did I forget to set
> another
> > > > register?
> > > >
> > > > Thanks!
> > > > Trish
> > > >
> > >
>
Reply by Keith Gravlin July 3, 20082008-07-03
Trish,

By "did as you said" I assume you mean filled in the VIC control and
address registers with valid info for the two interrupts you intend
to have. You can't comment out the VICIntEnable line because then
you 'won't' get any interrupts. Just change the line to:
VICIntEnable = 0x0000C000; //EINT0 & EINT1 are enabled...

Send me your code if you'd like and I'll see what's what.

Keith
--- In l..., "empresst007" wrote:
>
> Keith,
>
> I did as you said and I still have nothing showing up in Terminal.
If
> I physically comment out the VICIntEnable line, I can see characters
> in Terminal, but then I won't be able to interrupt.
>
> I'm using Eclipse with the Olimex lpc2138 development board.
>
> Trish
>
> --- In l..., "Keith Gravlin" wrote:
> >
> > Trish,
> >
> > You will still need to fill the control and vector slot for each
> > interrupt (14 for EINT0, 15 for EINT1).
> >
> > Your code also shows you enabling the interrupt for UART1. If
you
> > don't intend to get interrupts from that you need to clear d7 in
the
> > value you are sending to VICIntEnable else it will surely cause
> > problems.
> >
> > You should also be initializing the U1DLM for your baudrate
unless
> > you are counting on the reset value (haven't calulated if it
would be
> > correct but not really a good idea anyway).
> >
> > Let me know how much further you get.
> >
> > Btw what dev environment are you using?
> >
> > Keith
> >
> >
> >
> > --- In l..., "empresst007" wrote:
> > >
> > > Hi Keith,
> > >
> > > I think I was a bit too ambiguous, but I'm not trying to
interrupt
> > > from UART1. The ultimate goal is to send my position counter
value
> > to
> > > Terminal. I'll have a massive while loop that continuously
spits
> > out
> > > my position counter to Terminal (whether or not the shaft is
> > actually
> > > moving). I have two interrupts that will kick in (for signal A
and
> > > signal B) once the encoder shaft moves.
> > >
> > > And that is really all I have for initializing everything. So
it is
> > > possible that I completely left out other init and handler
items.
> > > What else am I missing?
> > >
> > > And I made sure I to clear the interrupt flag.
> > >
> > > Thanks!
> > > Trish
> > >
> > > --- In l..., "Keith Gravlin" wrote:
> > > >
> > > > Trish,
> > > >
> > > > I can't say I checked every line of your code for proper init
> > values
> > > > but the interrupt setup below that is missing alot.
> > > >
> > > > You need to set up the control and vector slot for each
interrupt
> > (7
> > > > for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the
> > watch
> > > > dog).
> > > >
> > > > I'm not sure from your msg how you are 'transmitting' but
with
> > out
> > > > vectors in place (at least) you will continuously receive
> > unhandled
> > > > interrupts.
> > > >
> > > > Don't forget to clear the int flag for each interrupt
(different
> > ways
> > > > depending on the interrupting device) during the handler and
> > > > acknowledge by writing a 0 to the VICADDRESS register.
> > > >
> > > > There are a number of other init and handler items that don't
> > seem to
> > > > be in your msg but I couldn't figure out how much you left
out to
> > > > keep the message short.
> > > >
> > > > Hope this helps,
> > > > Keith
> > > >
> > > >
> > > > --- In l..., "empresst007"
wrote:
> > > > >
> > > > > Hi All!
> > > > >
> > > > > I am setting up an interrupt to read encoder signals (EINT0
and
> > > > EINT1)
> > > > > and then displaying my position on UART. I was able to
create
> > an
> > > > echo
> > > > > UART, and thanks to Robert, I'm able to read encoder
signals.
> > > > >
> > > > > There is an interrupt initialization line of code that
prevents
> > > > > transmitting to Terminal through UART1. When the
VICIntEnable
> > is
> > > > > commented out, I can send to Terminal.
> > > > >
> > > > > This is the initialization. It's the last line, the
> > VICIntEnable,
> > > > > that prevents me from transmitting.
> > > > > ------------------------
----
> > ----
> > > > -
> > > > >
> > > > > //***Pin selections for UART and interrupt
> > > > > PINSEL0 = 0x000500C0;
> > > > > //set pin0.9 for UART 1 as RxD1 to receive in to
Terminal
> > > > > //set pin 0.8 for UART1 as TxD1 to transmit into
Terminal
> > > > > //set pin 0.3 as EINT1 for signal A low
> > > > >
> > > > > //***Initialize UART
> > > > > U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit,
> > Divisor
> > > >
> > > > > Latch enabled (DLAB = 1 to set baud rate)
> > > > > U1DLL = 0x000000C0; //4800
> > > > > U1LCR = 0x00000003;
> > > > >
> > > > > //***Initialize Interrupt
> > > > > PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B
low
> > > > > EXTMODE = 0x00; //level sensitivity for all
> > > > > EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> > > > > VICVectCntl0 = 0x0000002F; //select priority slot for a
> > given
> > > > > interrupt
> > > > > VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of
IRQ
> > into
> > > > VIC
> > > > > slot
> > > > > VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are
enabled
> > for
> > > > > interrupt requests (bit 15 & 14)
> > > > > ------------------------
----
> > ----
> > > > --
> > > > >
> > > > > Whether or not I set the UART1 bit or not, I can't transmit.
> > > > >
> > > > > Has anyone encountered this problem? Did I forget to set
> > another
> > > > > register?
> > > > >
> > > > > Thanks!
> > > > > Trish
> > > > >
> > > >
> > >
>
Reply by Keith Gravlin June 30, 20082008-06-30
Trish,

You will still need to fill the control and vector slot for each
interrupt (14 for EINT0, 15 for EINT1).

Your code also shows you enabling the interrupt for UART1. If you
don't intend to get interrupts from that you need to clear d7 in the
value you are sending to VICIntEnable else it will surely cause
problems.

You should also be initializing the U1DLM for your baudrate unless
you are counting on the reset value (haven't calulated if it would be
correct but not really a good idea anyway).

Let me know how much further you get.

Btw what dev environment are you using?

Keith

--- In l..., "empresst007" wrote:
>
> Hi Keith,
>
> I think I was a bit too ambiguous, but I'm not trying to interrupt
> from UART1. The ultimate goal is to send my position counter value
to
> Terminal. I'll have a massive while loop that continuously spits
out
> my position counter to Terminal (whether or not the shaft is
actually
> moving). I have two interrupts that will kick in (for signal A and
> signal B) once the encoder shaft moves.
>
> And that is really all I have for initializing everything. So it is
> possible that I completely left out other init and handler items.
> What else am I missing?
>
> And I made sure I to clear the interrupt flag.
>
> Thanks!
> Trish
>
> --- In l..., "Keith Gravlin" wrote:
> >
> > Trish,
> >
> > I can't say I checked every line of your code for proper init
values
> > but the interrupt setup below that is missing alot.
> >
> > You need to set up the control and vector slot for each interrupt
(7
> > for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the
watch
> > dog).
> >
> > I'm not sure from your msg how you are 'transmitting' but with
out
> > vectors in place (at least) you will continuously receive
unhandled
> > interrupts.
> >
> > Don't forget to clear the int flag for each interrupt (different
ways
> > depending on the interrupting device) during the handler and
> > acknowledge by writing a 0 to the VICADDRESS register.
> >
> > There are a number of other init and handler items that don't
seem to
> > be in your msg but I couldn't figure out how much you left out to
> > keep the message short.
> >
> > Hope this helps,
> > Keith
> >
> >
> > --- In l..., "empresst007" wrote:
> > >
> > > Hi All!
> > >
> > > I am setting up an interrupt to read encoder signals (EINT0 and
> > EINT1)
> > > and then displaying my position on UART. I was able to create
an
> > echo
> > > UART, and thanks to Robert, I'm able to read encoder signals.
> > >
> > > There is an interrupt initialization line of code that prevents
> > > transmitting to Terminal through UART1. When the VICIntEnable
is
> > > commented out, I can send to Terminal.
> > >
> > > This is the initialization. It's the last line, the
VICIntEnable,
> > > that prevents me from transmitting.
> > > ----------------------------
----
> > -
> > >
> > > //***Pin selections for UART and interrupt
> > > PINSEL0 = 0x000500C0;
> > > //set pin0.9 for UART 1 as RxD1 to receive in to Terminal
> > > //set pin 0.8 for UART1 as TxD1 to transmit into Terminal
> > > //set pin 0.3 as EINT1 for signal A low
> > >
> > > //***Initialize UART
> > > U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit,
Divisor
> >
> > > Latch enabled (DLAB = 1 to set baud rate)
> > > U1DLL = 0x000000C0; //4800
> > > U1LCR = 0x00000003;
> > >
> > > //***Initialize Interrupt
> > > PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B low
> > > EXTMODE = 0x00; //level sensitivity for all
> > > EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> > > VICVectCntl0 = 0x0000002F; //select priority slot for a
given
> > > interrupt
> > > VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ
into
> > VIC
> > > slot
> > > VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are enabled
for
> > > interrupt requests (bit 15 & 14)
> > > ----------------------------
----
> > --
> > >
> > > Whether or not I set the UART1 bit or not, I can't transmit.
> > >
> > > Has anyone encountered this problem? Did I forget to set
another
> > > register?
> > >
> > > Thanks!
> > > Trish
> > >
>
Reply by empresst007 June 30, 20082008-06-30
Hi Keith,

I think I was a bit too ambiguous, but I'm not trying to interrupt
from UART1. The ultimate goal is to send my position counter value to
Terminal. I'll have a massive while loop that continuously spits out
my position counter to Terminal (whether or not the shaft is actually
moving). I have two interrupts that will kick in (for signal A and
signal B) once the encoder shaft moves.

And that is really all I have for initializing everything. So it is
possible that I completely left out other init and handler items.
What else am I missing?

And I made sure I to clear the interrupt flag.

Thanks!
Trish

--- In l..., "Keith Gravlin" wrote:
>
> Trish,
>
> I can't say I checked every line of your code for proper init values
> but the interrupt setup below that is missing alot.
>
> You need to set up the control and vector slot for each interrupt (7
> for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the watch
> dog).
>
> I'm not sure from your msg how you are 'transmitting' but with out
> vectors in place (at least) you will continuously receive unhandled
> interrupts.
>
> Don't forget to clear the int flag for each interrupt (different ways
> depending on the interrupting device) during the handler and
> acknowledge by writing a 0 to the VICADDRESS register.
>
> There are a number of other init and handler items that don't seem to
> be in your msg but I couldn't figure out how much you left out to
> keep the message short.
>
> Hope this helps,
> Keith
> --- In l..., "empresst007" wrote:
> >
> > Hi All!
> >
> > I am setting up an interrupt to read encoder signals (EINT0 and
> EINT1)
> > and then displaying my position on UART. I was able to create an
> echo
> > UART, and thanks to Robert, I'm able to read encoder signals.
> >
> > There is an interrupt initialization line of code that prevents
> > transmitting to Terminal through UART1. When the VICIntEnable is
> > commented out, I can send to Terminal.
> >
> > This is the initialization. It's the last line, the VICIntEnable,
> > that prevents me from transmitting.
> > --------------------------------
> -
> >
> > //***Pin selections for UART and interrupt
> > PINSEL0 = 0x000500C0;
> > //set pin0.9 for UART 1 as RxD1 to receive in to Terminal
> > //set pin 0.8 for UART1 as TxD1 to transmit into Terminal
> > //set pin 0.3 as EINT1 for signal A low
> >
> > //***Initialize UART
> > U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit, Divisor
>
> > Latch enabled (DLAB = 1 to set baud rate)
> > U1DLL = 0x000000C0; //4800
> > U1LCR = 0x00000003;
> >
> > //***Initialize Interrupt
> > PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B low
> > EXTMODE = 0x00; //level sensitivity for all
> > EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> > VICVectCntl0 = 0x0000002F; //select priority slot for a given
> > interrupt
> > VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ into
> VIC
> > slot
> > VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are enabled for
> > interrupt requests (bit 15 & 14)
> > --------------------------------
> --
> >
> > Whether or not I set the UART1 bit or not, I can't transmit.
> >
> > Has anyone encountered this problem? Did I forget to set another
> > register?
> >
> > Thanks!
> > Trish
>
Reply by Keith Gravlin June 30, 20082008-06-30
Trish,

I can't say I checked every line of your code for proper init values
but the interrupt setup below that is missing alot.

You need to set up the control and vector slot for each interrupt (7
for UART1, 14 for EINT0, 15 for EINT1, 0 is actually for the watch
dog).

I'm not sure from your msg how you are 'transmitting' but with out
vectors in place (at least) you will continuously receive unhandled
interrupts.

Don't forget to clear the int flag for each interrupt (different ways
depending on the interrupting device) during the handler and
acknowledge by writing a 0 to the VICADDRESS register.

There are a number of other init and handler items that don't seem to
be in your msg but I couldn't figure out how much you left out to
keep the message short.

Hope this helps,
Keith
--- In l..., "empresst007" wrote:
>
> Hi All!
>
> I am setting up an interrupt to read encoder signals (EINT0 and
EINT1)
> and then displaying my position on UART. I was able to create an
echo
> UART, and thanks to Robert, I'm able to read encoder signals.
>
> There is an interrupt initialization line of code that prevents
> transmitting to Terminal through UART1. When the VICIntEnable is
> commented out, I can send to Terminal.
>
> This is the initialization. It's the last line, the VICIntEnable,
> that prevents me from transmitting.
> --------------------------------
-
>
> //***Pin selections for UART and interrupt
> PINSEL0 = 0x000500C0;
> //set pin0.9 for UART 1 as RxD1 to receive in to Terminal
> //set pin 0.8 for UART1 as TxD1 to transmit into Terminal
> //set pin 0.3 as EINT1 for signal A low
>
> //***Initialize UART
> U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit, Divisor

> Latch enabled (DLAB = 1 to set baud rate)
> U1DLL = 0x000000C0; //4800
> U1LCR = 0x00000003;
>
> //***Initialize Interrupt
> PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B low
> EXTMODE = 0x00; //level sensitivity for all
> EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
> VICVectCntl0 = 0x0000002F; //select priority slot for a given
> interrupt
> VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ into
VIC
> slot
> VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are enabled for
> interrupt requests (bit 15 & 14)
> --------------------------------
--
>
> Whether or not I set the UART1 bit or not, I can't transmit.
>
> Has anyone encountered this problem? Did I forget to set another
> register?
>
> Thanks!
> Trish
>

Reply by empresst007 June 29, 20082008-06-29
Hi All!

I am setting up an interrupt to read encoder signals (EINT0 and EINT1)
and then displaying my position on UART. I was able to create an echo
UART, and thanks to Robert, I'm able to read encoder signals.

There is an interrupt initialization line of code that prevents
transmitting to Terminal through UART1. When the VICIntEnable is
commented out, I can send to Terminal.

This is the initialization. It's the last line, the VICIntEnable,
that prevents me from transmitting.
---------------------------------

//***Pin selections for UART and interrupt
PINSEL0 = 0x000500C0;
//set pin0.9 for UART 1 as RxD1 to receive in to Terminal
//set pin 0.8 for UART1 as TxD1 to transmit into Terminal
//set pin 0.3 as EINT1 for signal A low

//***Initialize UART
U1LCR = 0x00000083; //8 bits, no parity bit, 1 stop bit, Divisor
Latch enabled (DLAB = 1 to set baud rate)
U1DLL = 0x000000C0; //4800
U1LCR = 0x00000003;

//***Initialize Interrupt
PINSEL1 = 0x00000001; //set pin 0.16 as EINT0 for signal B low
EXTMODE = 0x00; //level sensitivity for all
EXTPOLAR = 0x00; //Active low for EINT0 & EINT1
VICVectCntl0 = 0x0000002F; //select priority slot for a given
interrupt
VICVectAddr0 = (unsigned)IRQ_Routine; //pass address of IRQ into VIC
slot
VICIntEnable = 0x0000C080; //EINT0 & EINT1 & UART1 are enabled for
interrupt requests (bit 15 & 14)
----------------------------------

Whether or not I set the UART1 bit or not, I can't transmit.

Has anyone encountered this problem? Did I forget to set another
register?

Thanks!
Trish