EmbeddedRelated.com
Forums
Memfault Beyond the Launch

handling multiple interrupt sources?

Started by arhodes19044 March 27, 2005

Tony, do have any experience with the PIC, AVR, or other embedded
controller chips? If so, you can do all that you want with just one
chip and the BX-24 Interrupt line on Pin 11 and a Serial line...
Basically, you read a Status Byte from the Slave controller which
tells you who to respond to.

I'm not sure of your cost requirements but you are looking at $1 to
$3 dollars compared with 'cents' for standard 74x 'glue' logic. If you
go with PLD/GAL/Peel's, you will need developmnet tools, and a
programmer. You will also need tools and a programmer for embedded
controllers but they will far 'out-live' PLD-style devices so it's a
better investment.

- Tom

--- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
>
> I LOVE the idea of PLD's. I had "sort of" a problem when I was
> trying to work out the logic of the interrupt-creating hardware
> before I came on the idea of a pulse detector.
>
[snip]



--- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> I need to latch the signal, then reset the latch, and I may well
> need to be able to reset while the original signal is still high.
> I do not want it to retrigger until the signal goes back to the
> "off" condition. I do not want continued presence of the signal
> to inhibit my ability to the signal latch.

An edge-triggered J-K or D flip-flop meets all the requirements stated
above. The schematic to which I posted a link a day or so ago shows
how to wire a 74HCT109. Wiring a D-flop would be similar - just tie
the D input high. Unfortunately, most of the D-flops ('174, '175)
have a common clear which wouldn't work in your application.

Here's the schematic link. Just delete the one-shots on the left and
clock the flip-flops with your pulse signal.

http://www.kinzers.com/don/BX24/pulseCapture.jpg

Again, depending on the characteristics of your signal you may want to
condition it by running it through a Schmitt input device like the
74HCT14. If the leading edge of your pulse is negative-going you
would want the inversion anyway since the '109 is positive edge triggered.

Don
>
> Originally I had considered two feeding-back latches, but it was not
> that simple.....
>
> -Tony >
>
> --- In basicx@basi..., "Tom Becker" <gtbecker@r...> wrote:
> > > ... the different ways the 4093 can be used...
> > [Dang it! Yahoo insists on including the punctuation, now gone, in
> the
> > links; these should work.]
> >
> > One can also implement very flexible logic in one physical part,
> using a
> > PAL, GAL, PEEL or similar Programmable Logic Device. Common PLDs
> are
> > cheap and easy to program, both logically and electrically. GALS
> and
> > PEELs can be reprogrammed, too, so your hardware logic can change
> just
> > as easily as your firmware can.
> >
> > I started with a 20V8 (20 inputs, 8 outputs, more or less) with a
> simple
> > home-built parallel-port programmer, GALBLAST,
> > http://www.geocities.com/ResearchTriangle/Forum/8070/algo.htm but
> > quickly graduated to an inexpensive USB ZIF-socket programmer,
> then a
> > full-blown and sadly expensive universal device programmer
> > http://www.needhams.com that should last me awhile. Industry-
> standard
> > JEDEC files describe the logic that the programmer burns; JEDEC
> files
> > can be produced by a number of compilers; a free one is WinCUPL.
> > http://www.atmel.com/dyn/products/tools_card.asp?tool_id'59
> >
> > I have grown to love these things and now often think in terms of
> > programmable logic rather than 74- or 4000- series parts.
> Anything that
> > can be built using AND/OR/NOT can be built with PLDs. I
> implemented a
> > quadrature frontend, including multiple BX-24 interrupt handling
> and
> > other logic, in one GAL that sits very neatly against the left
> edge of
> > the BX-24; I used another for motor control along the right edge
> (see
> > photo "GALs for glue logic" in the group Photos). These two
> components
> > do the equivalent work of about 20 74HC DIPs.
> >
> >
> > Tom
> >
> >
> >
> > Tom Becker
> > --... ...--
> > GTBecker@R... www.RighTime.com
> > The RighTime Clock Company, Inc., Cape Coral, Florida USA
> > +1239 540 5700




Yes, in my younger days I could keep all the input/output conditions
in my head, simultaneously with analyzing the circuit diagrams, and
also listening to Led Zappelin blasting on the stereo. Now I am
lucky to do 1/4 of that.

Formally writing down the parameters is just the thing to do. I did
manage to develop the logic table showing the current state of
latches, inputs and desired outputs/new states. Without a pulse
detector it was going to require at least 2 latches, and I was
suspecting three. Along with some XOR, AND, and other functions.

The pulse detector simplified it considerable. Effectively the
trigger signal is momentary and I do not have to worry about trying
to do a reset while the trigger signal is still active. That really
helped!

Don's suggestion using a JK flip-flop in toggle mode and stuff is a
great improvement. I will use it when the chips arrive.

-Tony

--- In basicx@basi..., "raunig2003" <raunig2003@y...> wrote:
>
> It might help to design your circuit if you write down all the
> input signals levels on the left side of the page and what the
> corresponding output signal on the right for each of your trigger
> events.
>
> RR > --- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> >
> > I LOVE the idea of PLD's. I had "sort of" a problem when I was
> > trying to work out the logic of the interrupt-creating hardware
> > before I came on the idea of a pulse detector.
> >
> > The timer or wheel "tick" will be a roughly square wave with a
> > variable frequency and an unknown pulse duration.
> >
> > I need to latch the signal, then reset the latch, and I may well
> > need to be able to reset while the original signal is still
high.
> I
> > do not want it to retrigger until the signal goes back to
the "off"
> > condition. I do not want continued presence of the signal to
> > inhibit my ability to the signal latch.
> >
> > Originally I had considered two feeding-back latches, but it was
> not
> > that simple.....
> >
> > -Tony
> >
> >
> >
> >
> > --- In basicx@basi..., "Tom Becker" <gtbecker@r...>
wrote:
> > > > ... the different ways the 4093 can be used...
> > > [Dang it! Yahoo insists on including the punctuation, now
gone,
> in
> > the
> > > links; these should work.]
> > >
> > > One can also implement very flexible logic in one physical
part,
> > using a
> > > PAL, GAL, PEEL or similar Programmable Logic Device. Common
PLDs
> > are
> > > cheap and easy to program, both logically and electrically.
GALS
> > and
> > > PEELs can be reprogrammed, too, so your hardware logic can
change
> > just
> > > as easily as your firmware can.
> > >
> > > I started with a 20V8 (20 inputs, 8 outputs, more or less)
with a
> > simple
> > > home-built parallel-port programmer, GALBLAST,
> > > http://www.geocities.com/ResearchTriangle/Forum/8070/algo.htm
but
> > > quickly graduated to an inexpensive USB ZIF-socket programmer,
> > then a
> > > full-blown and sadly expensive universal device programmer
> > > http://www.needhams.com that should last me awhile. Industry-
> > standard
> > > JEDEC files describe the logic that the programmer burns;
JEDEC
> > files
> > > can be produced by a number of compilers; a free one is
WinCUPL.
> > > http://www.atmel.com/dyn/products/tools_card.asp?tool_id'59
> > >
> > > I have grown to love these things and now often think in terms
of
> > > programmable logic rather than 74- or 4000- series parts.
> > Anything that
> > > can be built using AND/OR/NOT can be built with PLDs. I
> > implemented a
> > > quadrature frontend, including multiple BX-24 interrupt
handling
> > and
> > > other logic, in one GAL that sits very neatly against the left
> > edge of
> > > the BX-24; I used another for motor control along the right
edge
> > (see
> > > photo "GALs for glue logic" in the group Photos). These two
> > components
> > > do the equivalent work of about 20 74HC DIPs.
> > >
> > >
> > > Tom
> > >
> > >
> > >
> > > Tom Becker
> > > --... ...--
> > > GTBecker@R... www.RighTime.com
> > > The RighTime Clock Company, Inc., Cape Coral, Florida USA
> > > +1239 540 5700




I have ordered the parts. I will assemble them when they arrive!
I really love your suggestion. Even thought the devices are 1970's
technology, they will work fine and have pretty forgiving voltage
ranges for my dirty applications.

I will see if it works without the schmitt input, but I can do that
if necessary. I think the wheel sensor gives a pretty sharp
transition. I think the 555 has a sharp transition too.

-Tony --- In basicx@basi..., "Don Kinzer" <dkinzer@e...> wrote:
>
> --- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> > I need to latch the signal, then reset the latch, and I may well
> > need to be able to reset while the original signal is still high.
> > I do not want it to retrigger until the signal goes back to the
> > "off" condition. I do not want continued presence of the signal
> > to inhibit my ability to the signal latch.
>
> An edge-triggered J-K or D flip-flop meets all the requirements
stated
> above. The schematic to which I posted a link a day or so ago
shows
> how to wire a 74HCT109. Wiring a D-flop would be similar - just
tie
> the D input high. Unfortunately, most of the D-flops ('174, '175)
> have a common clear which wouldn't work in your application.
>
> Here's the schematic link. Just delete the one-shots on the left
and
> clock the flip-flops with your pulse signal.
>
> http://www.kinzers.com/don/BX24/pulseCapture.jpg
>
> Again, depending on the characteristics of your signal you may
want to
> condition it by running it through a Schmitt input device like the
> 74HCT14. If the leading edge of your pulse is negative-going you
> would want the inversion anyway since the '109 is positive edge
triggered.
>
> Don >
> >
> > Originally I had considered two feeding-back latches, but it was
not
> > that simple.....
> >
> > -Tony
> >
> >
> >
> >
> > --- In basicx@basi..., "Tom Becker" <gtbecker@r...>
wrote:
> > > > ... the different ways the 4093 can be used...
> > > [Dang it! Yahoo insists on including the punctuation, now
gone, in
> > the
> > > links; these should work.]
> > >
> > > One can also implement very flexible logic in one physical
part,
> > using a
> > > PAL, GAL, PEEL or similar Programmable Logic Device. Common
PLDs
> > are
> > > cheap and easy to program, both logically and electrically.
GALS
> > and
> > > PEELs can be reprogrammed, too, so your hardware logic can
change
> > just
> > > as easily as your firmware can.
> > >
> > > I started with a 20V8 (20 inputs, 8 outputs, more or less)
with a
> > simple
> > > home-built parallel-port programmer, GALBLAST,
> > > http://www.geocities.com/ResearchTriangle/Forum/8070/algo.htm
but
> > > quickly graduated to an inexpensive USB ZIF-socket programmer,
> > then a
> > > full-blown and sadly expensive universal device programmer
> > > http://www.needhams.com that should last me awhile. Industry-
> > standard
> > > JEDEC files describe the logic that the programmer burns;
JEDEC
> > files
> > > can be produced by a number of compilers; a free one is
WinCUPL.
> > > http://www.atmel.com/dyn/products/tools_card.asp?tool_id'59
> > >
> > > I have grown to love these things and now often think in terms
of
> > > programmable logic rather than 74- or 4000- series parts.
> > Anything that
> > > can be built using AND/OR/NOT can be built with PLDs. I
> > implemented a
> > > quadrature frontend, including multiple BX-24 interrupt
handling
> > and
> > > other logic, in one GAL that sits very neatly against the left
> > edge of
> > > the BX-24; I used another for motor control along the right
edge
> > (see
> > > photo "GALs for glue logic" in the group Photos). These two
> > components
> > > do the equivalent work of about 20 74HC DIPs.
> > >
> > >
> > > Tom
> > >
> > >
> > >
> > > Tom Becker
> > > --... ...--
> > > GTBecker@R... www.RighTime.com
> > > The RighTime Clock Company, Inc., Cape Coral, Florida USA
> > > +1239 540 5700





I have no experience with the PIC/AVR devices, but they look very
interesting. This morning as I was driving, I was thinking about
the Basic language, and the BasicX implementation. With such strong
typing, it forces the user to really think about the data types,
which when I was learning "C" was slightly tough. I eventually got
to REALLY REALLY like C, but I never got to love "objects" too
much. My applications never really needed complex objects anyway.
I still try to increment counters and stuff with "+= 1"!

So, I was wondering if there is a "CX" device similar to the BX.

Then I figured that I might as well just get some high horsepower
AVR device and do it myself. I like the Basic-X devices because all
the connecting of the various parts is done for me into one very
user-friendly 24+ pin device. Are there similar (i.e. preassembled like the BX-24), but lower
level devices around?

While PAL's are great, just for simplicity (to me), I'd rather stay
relatively discrete....

BTW, the real rally computer I have uses a Zilog-80 running at
6Mhz. Written in ASM, though I presume written in C with hand-tuned
ASM sections, but NO floating point functions. All that was
synthesized by the programmer.

He did a nice job. I just wish I could do a couple of tweaks on
some of the code, and have a couple of optional changes
(compensation for the rally master's rounding errors).

-Tony

--- In basicx@basi..., "tombhandley" <gr13tbs@c...> wrote:
>
> Tony, do have any experience with the PIC, AVR, or other embedded
> controller chips? If so, you can do all that you want with just
one
> chip and the BX-24 Interrupt line on Pin 11 and a Serial line...
> Basically, you read a Status Byte from the Slave controller which
> tells you who to respond to.
>
> I'm not sure of your cost requirements but you are looking at $1
to
> $3 dollars compared with 'cents' for standard 74x 'glue' logic. If
you
> go with PLD/GAL/Peel's, you will need developmnet tools, and a
> programmer. You will also need tools and a programmer for embedded
> controllers but they will far 'out-live' PLD-style devices so it's
a
> better investment.
>
> - Tom
>
> --- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> >
> > I LOVE the idea of PLD's. I had "sort of" a problem when I was
> > trying to work out the logic of the interrupt-creating hardware
> > before I came on the idea of a pulse detector.
> >
> [snip]




--- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> Don's suggestion using a JK flip-flop in toggle mode ...

Just so no one is confused, the circuit that I suggested doesn't have
the J-K flip flop wired as a toggle. When a standard J-K FF is
clocked, one of four things happens depending on the state of the J
and K inputs.

J K Q output
0 0 no change
0 1 0
1 0 1
1 1 toggle

Note, however, that the '109 has its K input complemented. It is a
J-K/ flop. This means that the table above needs to have the K column
complemented.

Since my circuit had the J and K/ inputs tied high, it is wired in
"Set" mode. The toggling action comes from resetting the FF with an
output signal form the BX24.

Don



--- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> I really love your suggestion [of using a J-K flip flop]. Even
> though the devices are 1970's technology ...

The only thing that is '70s about this idea is if you choose to use
74LS series logic. It functions perfectly well and is less static
sensitive than MOS based technologies. The 74HC and 74HCT series are
more modern and have wider operating voltage ranges as well as lower
power consumption. As a bonus, they are functionally and pin
compatible with the 74LS series.

The 74HCT series can be intermixed with 74LS series devices. The same
is not true for the 74HC series. All three will work quite well with
the BX-24.

Don



Tony, you can get free or very expensive C/C++ compilers for both
chips. In the PIC case, I use CCS's C compiler but I normally just
use the assembler since I have a lot of experince with it and I have
a little more control of the generated code though Compilers like CCS
and HiTech are 'blurring' the difference as they now generate very
efficient code.

While the previous 74x or CMOS 'glue' suggestions are fine, why add
the 'glue' when you can do it with one chip? As far as GALs, PLDs,
PEELs, they are going down the same path as dinosaurs... Embedded
contollers are so much easier to deal with at this level. The tools
are free and, depending on the device, you can build a programmer for
a few bucks. In my case, I spent lot's of bucks on tools and a
programmer but you don't have to.

- Tom

--- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
>
>
> I have no experience with the PIC/AVR devices, but they look very
> interesting. This morning as I was driving, I was thinking about
> the Basic language, and the BasicX implementation. With such
strong
> typing, it forces the user to really think about the data types,
> which when I was learning "C" was slightly tough. I eventually got
> to REALLY REALLY like C, but I never got to love "objects" too
> much. My applications never really needed complex objects anyway.
> I still try to increment counters and stuff with "+= 1"!
>
> So, I was wondering if there is a "CX" device similar to the BX.
>
> Then I figured that I might as well just get some high horsepower
> AVR device and do it myself. I like the Basic-X devices because
all
> the connecting of the various parts is done for me into one very
> user-friendly 24+ pin device. > Are there similar (i.e. preassembled like the BX-24), but lower
> level devices around?
>
> While PAL's are great, just for simplicity (to me), I'd rather stay
> relatively discrete....
>
> BTW, the real rally computer I have uses a Zilog-80 running at
> 6Mhz. Written in ASM, though I presume written in C with hand-
tuned
> ASM sections, but NO floating point functions. All that was
> synthesized by the programmer.
>
> He did a nice job. I just wish I could do a couple of tweaks on
> some of the code, and have a couple of optional changes
> (compensation for the rally master's rounding errors).
>
> -Tony
[snip]



OK, I think I see. I was confused. I had thought that it was
toggling, but Like I said, I will have to assemble the circuit and
see what it does... I am sure it will work really well.

Oh, by the way, the 4000 series inverter I am currently using has a
50ns delay, so the three together end up creating a 150ns wide pulse
out of the AND gate. This seems quite adequately long to trigger
the toggle relably on the bench. I just wonder how it ould perform
in the noisier(?) real world. Since I will be using the
74HCT123/74HCT109 circuit you have recommended, I may never have to
find out.

-Tony
--- In basicx@basi..., "Don Kinzer" <dkinzer@e...> wrote:
>
> --- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> > Don's suggestion using a JK flip-flop in toggle mode ...
>
> Just so no one is confused, the circuit that I suggested doesn't
have
> the J-K flip flop wired as a toggle. When a standard J-K FF is
> clocked, one of four things happens depending on the state of the J
> and K inputs.
>
> J K Q output
> 0 0 no change
> 0 1 0
> 1 0 1
> 1 1 toggle
>
> Note, however, that the '109 has its K input complemented. It is a
> J-K/ flop. This means that the table above needs to have the K
column
> complemented.
>
> Since my circuit had the J and K/ inputs tied high, it is wired in
> "Set" mode. The toggling action comes from resetting the FF with
an
> output signal form the BX24.
>
> Don




I am glad about the compatibility because I could not get the 74HCT123
from Jameco, but got instead the 74HC123. I looked pretty hard at the
datasheets and I could not really find the operational difference
between the HC and HCT models. I am sure there is some basic family-
wide difference.

The 109 I could order was a CD74AC109E Which seemed the same as the
74HCT109. I guess I will find out if they are not sufficiently
compatible.... Thanks again!
-Tony
--- In basicx@basi..., "Don Kinzer" <dkinzer@e...> wrote:
>
> --- In basicx@basi..., "arhodes19044" <spamiam@c...> wrote:
> > I really love your suggestion [of using a J-K flip flop]. Even
> > though the devices are 1970's technology ...
>
> The only thing that is '70s about this idea is if you choose to use
> 74LS series logic. It functions perfectly well and is less static
> sensitive than MOS based technologies. The 74HC and 74HCT series are
> more modern and have wider operating voltage ranges as well as lower
> power consumption. As a bonus, they are functionally and pin
> compatible with the 74LS series.
>
> The 74HCT series can be intermixed with 74LS series devices. The
same
> is not true for the 74HC series. All three will work quite well with
> the BX-24.
>
> Don




Memfault Beyond the Launch