Here are a few more Schematic examples for the C-M240 CPLD Development Board included with HackerBox #12. Part one of the basic schematics was for a simple circuit hooking-up one of the onboard LEDs. As mentioned in the prior post, there are 8 LEDs that need to be connected to a low output for them to illuminate – PIN_51 – PIN_58. Checking the schematics for the M240 shows that the five onboard push-buttons are similarly setup so that they are normally held high, and when they are pushed, they are connected to ground. The push-buttons are connected to PIN_26 – PIN_29, and PIN_44.
Setting Up the Schematic
So I want to illuminate the LED connected to PIN_53 by pushing the button connected to PIN_26. I know that if I push the button, the signal goes low on PIN_26 (according to the schematics). I need to route that low signal to the output (PIN_53) connected to the LED, and the LED will turn on. Using the same process as in the last post, setup a new project in Quartus Prime Lite. Use the “Symbol Tool” to choose :
- alt_inbuf (from primitives->buffers)
- alt_outbuf (from primitives->buffers)
- input pin (from primitives->pin)
- output pin (from primitives->pin)
Drag the connections together to create a schematic like the one below:
Be sure to go back and set a state for your “Unused Pins” (described in prior post). Save the file, and then compile it.
Setting Up the Pins
The next step is to assign the pins to the different inputs and outputs. We have one input which is the push-button connected to PIN_26, and we want its signal routed to the output at PIN_53 which is connected to our LED. Open up the “Pin Planner”, and set the pins like below:
Compile and Program
Save, compile, and then use the “Programmer” tool to load the schematic onto the EPM240T100C5N. If everything was done correctly, you’ll be rewarded with a LED controlled by the push-button. Yee-haw! 🙂
One More Easy M240 Schematic…
The schematics show the alarm/buzzer for the Dev Board as below:
Schematic and Pins for the Buzzer and LED
Much like the rest of the M240 Development Board, if you want to turn something on, you have to pull a signal low. In this case, the PNP transistor at Q70 is used to turn the buzzer on when the base of Q70 is pulled low relative to the emitter. The schematic shows the base of Q70 connected to PIN_26, however, that seems to be incorrect as the board is printed with PIN_50. I also tested it and PIN_50 works while PIN_26 did not. Below is a push-button circuit that lights the LED and turns the buzzer on:
So, with this circuit schematic, you have:
- PIN_26 – the input pin (the pushbutton) which is normally high, and it goes low when it’s pushed.
- an input buffer and two output buffers for the one input and two outputs (1 alt_inbuf and 2 alt_outbuf)
- PIN_53 – the output pin that connects the LED.
- PIN_50 – the output pin that connects the buzzer.
Use the “Symbol Tool” to place the components and then drag them together. Don’t forget to set your “Unused Pins”. Save. Compile. After compiling, you need to assign your pins, and at this point, you should have a pretty good idea of how to do it. Once you have everything assigned, save, compile again, and then use the “Programmer” tool to move your schematic to the EPM240T100C5N.