State Machine on a BLU-100
naxxfish
Posts: 13
Hello all,
Our radio station has just purchased a BLU-100, which is by all counts awesome for what we require. Have already designed myself a nice little web stream audio processing chain so we can split the signal off before FM broadcast, very lovely indeed!
Anyway - currently, we use a Sonifex RB OA3 to do our on air studio switching. This runs on the offer-accept principle. Essentially, we have two buttons on each studio, offer and accept - each with an indictor LED ring.
To put a studio on air, there are two mechanisms depending on what the previous state was. If another studio is currently on air, the person in that studio must press the offer button. Once this button is pressed, the \"offer\" light lights up in all studios. Another studio then can press the accept button to gain control. However, if the sustainer (unmanned playout system) is active, you have to press offer (to basically force an offer) then hold accept to take control.
If you want to make the sustainer active, you have to press the offer button, then press accept and it will switch to the sustainer and go into sustain active mode.
It's a bit complex - but I've got a bubble diagram showing the state changes and such. So what I'd really like to know is if there's a nice way of implementing a state machine in logic which will let us implement this behaviour in the BLU-100.
What I'm currently looking at is using a Truth Table and a Counter/shifter to shift between the states (and using the outputs of the truth table to enable/disable things, depending on the state). The trouble I'm having is working out how to transition between the states. Normally, I'd use something like an AND plane to decode the states and work out the transitions - but this seems a bit intensive.
Is there something better built in that'd let me do this?
Our radio station has just purchased a BLU-100, which is by all counts awesome for what we require. Have already designed myself a nice little web stream audio processing chain so we can split the signal off before FM broadcast, very lovely indeed!
Anyway - currently, we use a Sonifex RB OA3 to do our on air studio switching. This runs on the offer-accept principle. Essentially, we have two buttons on each studio, offer and accept - each with an indictor LED ring.
To put a studio on air, there are two mechanisms depending on what the previous state was. If another studio is currently on air, the person in that studio must press the offer button. Once this button is pressed, the \"offer\" light lights up in all studios. Another studio then can press the accept button to gain control. However, if the sustainer (unmanned playout system) is active, you have to press offer (to basically force an offer) then hold accept to take control.
If you want to make the sustainer active, you have to press the offer button, then press accept and it will switch to the sustainer and go into sustain active mode.
It's a bit complex - but I've got a bubble diagram showing the state changes and such. So what I'd really like to know is if there's a nice way of implementing a state machine in logic which will let us implement this behaviour in the BLU-100.
What I'm currently looking at is using a Truth Table and a Counter/shifter to shift between the states (and using the outputs of the truth table to enable/disable things, depending on the state). The trouble I'm having is working out how to transition between the states. Normally, I'd use something like an AND plane to decode the states and work out the transitions - but this seems a bit intensive.
Is there something better built in that'd let me do this?
0
Comments
Had an excellent conversation with Jerome - turns out someone (Reme Trempe) has written a tool (GenLatt) that turns code (which looks sneakily like VHDL) into magical truth tables which do Stuff (in a much more efficient way than I might be bothered to work out).
Adding a couple of extra bits and bobs (mostly logic delays and things) I have now made a fully functioning offer accept switcher, with sustain active and offer timeout!
If you're interested, here's the code I put into GenLatt:
[code:1]/**
Station switcher based on RB-OA3 behaviour
**/
DESIGN __design_name
(
S1OFFER, S1OFFERHOLD, S1ACCEPT, S1ACCEPTHOLD, S2OFFER, S2OFFERHOLD, S2ACCEPT, S2ACCEPTHOLD, OFFERTIMEOUT : INPUT;
S1ONAIR, S2ONAIR, SUSTAINONAIR, OFFER, OFFERFLASH , TIMEOUTRESET: OUTPUT;
)
RE010[init] = SUSTAINONAIR, OFFERFLASH, TIMEOUTRESET ; // Sustainer Active
RE011 = OFFER ; // Studio 1 coming off sustainer
RE016 = OFFER ; // Studio 2 coming off sustainer
RE012 = S1ONAIR, TIMEOUTRESET ; // Studio 1 On Air
RE015 = S2ONAIR, TIMEOUTRESET ; // Studio 2 On Air
RE013 = OFFER , S1ONAIR ; // Studio 1 Offering
RE014 = OFFER , S2ONAIR ; // Studio 2 Offering
RE010 > RE011 = S1OFFER ; // Studio 1 coming off the sustainer
RE011 > RE012 = S1ACCEPTHOLD ; // Studio 1 on air
RE011 > RE010 = OFFERTIMEOUT ; // timed out
RE010 > RE016 = S2OFFER ; // Studio 2 coming off the sustainer
RE016 > RE015 = S2ACCEPTHOLD ; // Studio 2 on air
RE016 > RE010 = OFFERTIMEOUT ; // timed out
RE012 > RE013 = S1OFFER ; // Switching from studio 1 offering
RE013 > RE012 = S1ACCEPT ; // Switching back
RE013 > RE015 = S2ACCEPT ; // To studio 2
RE013 > RE012 = OFFERTIMEOUT ; // offer timed out
RE015 > RE014 = S2OFFER ; // Switching from studio 2 offering
RE014 > RE015 = S2ACCEPT ; // switching back
RE014 > RE012 = S1ACCEPT ; // to Studio 1
RE014 > RE015 = OFFERTIMEOUT ; // offer timed out
RE013 > RE010 = S1ACCEPTHOLD ; // self accepting to sustainer from offer
RE014 > RE010 = S2ACCEPTHOLD ; // self accepting to sustainer from offer
[/code:1]
And it spat out a truth table CSV, which I then imported into a truth table logic block. Then all I had to do was generate the logic for the button holding (with logic delays) as well as the flashing (pretty easy to do with a logic pulse and an AND gate) and wire them in, and it all works rather nicely!