- Started working on fpga4fun.com tutorials, implementing
test05a
:- 25-bit counter attached to 50MHz clock.
- Divides down (at bit 16) to about 381Hz, fed out to loudspeaker in series with 1kΩ resistor.
- Divides down (at bit 24) to about 1.5Hz, which blinks
LED_Left
. - Also sets
LED_Right
to logical OR of the pushed states of both pushbuttons. - Demonstrates
test05a
top module which uses all of the board's nets, and links withmusic
module. - It works!
- NOTE: Standard 8Ω speaker is connected to FB2-3 (pin 58) in series with a 1kΩ resistor.
- Made
test05b
:- Based on 2nd part of the above tutorial.
- Uses
define
statements. - Uses ternary operators.
- Lets the frequency be controlled to 1 of 4 defined notes via push-buttons.
- Left LED is unused (will be dimly lit due to
KPR
). - Right LED is
AND
of pressed state of left and right buttons. - Implements pushbutton states as a 2-bit signal and compares with integers.
- It works!
- Made
test05c
:- 1st part of tutorial part 2.
- Plays alternating 440Hz and 880Hz tones, switching at 1.5Hz.
- Makes use of "dot-named module arguments" to help identify them more clearly.
- Also treats the 2 buttons and 2 LEDs as "vectors" (is that the correct term?), mapped via the UCF.
- It works!
- NOTE: As of this example, the speaker/resistor is now connected to FB2-2 (pin 60) because it is available on all XC9572XL package sizes.
- Made
test05d
:- 2nd part of tutorial part 2.
- Plays a tone that ramps up and down from about 766Hz to 1526Hz, at about 3Hz.
- Now it's prescaling the clock in the top module.
- It works!
- Made
test05e
:- Last part of tutorial part 2.
- Plays a tone that ramps up and down from about 766Hz to 1526Hz, at about 3Hz for 16 up/down cycles, and then at about 1/8th the speed for 2 up/down cycles.
- Also, the right-hand button will force slow mode.
- It works!
- What happens if assigning a big value to a too-small counter?
- Evidently, synthesis/fit doesn't care. It won't raise any warnings that I can see. It must just use the bits that fit.