module P302703A title 'Display Board' "Version 3: Original version, does not assign any function to the SHOW and CHANGE buttons" "other than to turn on the DF1 and DF2 lamps." "Version 4: We make sure the UPLOAD lamp is off during RESET. Add the SHOW and HIDE functions" "to show all the white lamps and to hide them all if they are too bright. The hide function is" "a toggle on the front pannel with the DF2 switch. The show function turns on the lamps when you" "press the button only." declarations DCK pin 39; "Data Clock 40 MHz" DBC pin 50 istype 'reg'; "Display Board Code" MRC pin 44; "Message Router Code" MDC pin 47; "Message Detector Code" ARCK pin 49; "Asynchronous Reference Clock 32.768 kHz." !RST pin 48 istype 'com'; "Hardware Reset" !RSTSW pin 78; "Reset Switch" !SHOW pin 29; "Show" !HIDE pin 30; "Hide" !LUP pin 72 istype 'com'; "Upload Lamp" !LEY pin 53 istype 'com'; "Empty Lamp" !LRST pin 70 istype 'com'; "Reset Lamp" !DF1,!DF2 pin 28, 31 istype 'com'; "Display Flash Lamps" LA1..LA8 pin 22,21,20,19,17,16,15,14 istype 'com'; "Antenna Lamps" LC1..LC15 pin 100,99,97,94,92,86,84,3,4,5,6,8,9,10,11 istype 'com'; "Channel Lamps" equations declarations RCK node istype 'reg'; MDCR0..MDCR3 node istype 'reg'; mdcr = [MDCR3..MDCR0]; CID0..CID3 node istype 'reg'; cid = [CID3..CID0]; MSEL0..MSEL2 node istype 'reg'; msel = [MSEL2..MSEL0]; FLASH node istype 'reg'; "Flash State" RESET node istype 'com'; indicator interface (CK, FLASH -> ON); LAC1..LAC8 functional_block indicator; LCC1..LCC15 functional_block indicator; MRCR0..MRCR2 node istype 'reg'; mrcr = [MRCR2..MRCR0]; DS,AE node istype 'reg'; UPC7..UPC0 node istype 'reg'; upc = [UPC7..UPC0]; HS0..HS1 node istype 'reg'; hs = [HS1..HS0]; "Hide State" OFF node istype 'com'; "Turn OFF the Indicator Lamps" SCK0..SCK3 node istype 'reg'; "Slow Clock Bits" sck = [SCK3..SCK0]; equations RST.oe = RSTSW; RST = 1; RESET = RST.pin; RCK.clk = DCK; RCK := ARCK; DF1 = SHOW; sck.clk = RCK; sck := sck + 1; hs.clk = SCK3; hs.aclr = RESET; state_diagram hs; state 0:if HIDE then 1 else 0; state 1:if !HIDE then 2 else 1; state 2:if HIDE then 3 else 2; state 3:if !HIDE then 0 else 3; equations; OFF = (hs == 1) # (hs == 2); DF2 = OFF; mdcr.clk = DCK; mdcr.aclr = RESET; when mdcr==0 then { when MDC then mdcr := 1 else mdcr := 0; } when (mdcr >= 1) & (mdcr <= 9) then { mdcr := mdcr + 1; } when (mdcr >= 10) then mdcr := 0; FLASH.clk = !DCK; FLASH := (mdcr == 10); cid.clk = DCK; when mdcr==1 then CID3:=MDC else CID3:=CID3; when mdcr==2 then CID2:=MDC else CID2:=CID2; when mdcr==3 then CID1:=MDC else CID1:=CID1; when mdcr==4 then CID0:=MDC else CID0:=CID0; msel.clk = DCK; when mdcr==6 then MSEL2:=MDC else MSEL2:=MSEL2; when mdcr==7 then MSEL1:=MDC else MSEL1:=MSEL1; when mdcr==8 then MSEL0:=MDC else MSEL0:=MSEL0; LAC1.FLASH = FLASH & (msel == 0); LAC1.CK = RCK; LA1 = LAC1.ON & !OFF # SHOW; LAC2.FLASH = FLASH & (msel == 1); LAC2.CK = RCK; LA2 = LAC2.ON & !OFF # SHOW; LAC3.FLASH = FLASH & (msel == 2); LAC3.CK = RCK; LA3 = LAC3.ON & !OFF # SHOW; LAC4.FLASH = FLASH & (msel == 3); LAC4.CK = RCK; LA4 = LAC4.ON & !OFF # SHOW; LAC5.FLASH = FLASH & (msel == 4); LAC5.CK = RCK; LA5 = LAC5.ON & !OFF # SHOW; LAC6.FLASH = FLASH & (msel == 5); LAC6.CK = RCK; LA6 = LAC6.ON & !OFF # SHOW; LAC7.FLASH = FLASH & (msel == 6); LAC7.CK = RCK; LA7 = LAC7.ON & !OFF # SHOW; LAC8.FLASH = FLASH & (msel == 7); LAC8.CK = RCK; LA8 = LAC8.ON & !OFF # SHOW; LCC1.FLASH = FLASH & (cid == 1); LCC1.CK = RCK; LC1 = LCC1.ON & !OFF # SHOW; LCC2.FLASH = FLASH & (cid == 2); LCC2.CK = RCK; LC2 = LCC2.ON & !OFF # SHOW; LCC3.FLASH = FLASH & (cid == 3); LCC3.CK = RCK; LC3 = LCC3.ON & !OFF # SHOW; LCC4.FLASH = FLASH & (cid == 4); LCC4.CK = RCK; LC4 = LCC4.ON & !OFF # SHOW; LCC5.FLASH = FLASH & (cid == 5); LCC5.CK = RCK; LC5 = LCC5.ON & !OFF # SHOW; LCC6.FLASH = FLASH & (cid == 6); LCC6.CK = RCK; LC6 = LCC6.ON & !OFF # SHOW; LCC7.FLASH = FLASH & (cid == 7); LCC7.CK = RCK; LC7 = LCC7.ON & !OFF # SHOW; LCC8.FLASH = FLASH & (cid == 8); LCC8.CK = RCK; LC8 = LCC8.ON & !OFF # SHOW; LCC9.FLASH = FLASH & (cid == 9); LCC9.CK = RCK; LC9 = LCC9.ON & !OFF # SHOW; LCC10.FLASH = FLASH & (cid == 10); LCC10.CK = RCK; LC10 = LCC10.ON & !OFF # SHOW; LCC11.FLASH = FLASH & (cid == 11); LCC11.CK = RCK; LC11 = LCC11.ON & !OFF # SHOW; LCC12.FLASH = FLASH & (cid == 12); LCC12.CK = RCK; LC12 = LCC12.ON & !OFF # SHOW; LCC13.FLASH = FLASH & (cid == 13); LCC13.CK = RCK; LC13 = LCC13.ON & !OFF # SHOW; LCC14.FLASH = FLASH & (cid == 14); LCC14.CK = RCK; LC14 = LCC14.ON & !OFF # SHOW; LCC15.FLASH = FLASH & (cid == 15); LCC15.CK = RCK; LC15 = LCC15.ON & !OFF # SHOW; LEY = AE # RESET; mrcr.clk = DCK; mrcr.aclr = RESET; when mrcr==0 then { when MRC then mrcr := 1 else mrcr := 0; } when (mrcr >= 1) & (mrcr <= 9) then { mrcr := mrcr + 1; } when (mrcr >= 10) then mrcr := 0; DS.clk = DCK; when mrcr==1 then DS:=MRC else DS:=DS; AE.clk = DCK; when mrcr==2 then AE:=MRC else AE:=AE; LRST = RST.pin; upc.clk = RCK; upc.ap = DS; when upc == 0 then upc := 0; else upc := upc - 1; LUP = (upc > 0) & !RESET; end