![]() ![]() ![]() This outputs and formats the time and alarm time on the screen. The update_oled() function starting at line 286 is then called. I had an interesting time figuring out that the scanf function was needed for two digit/character serial port reads instead of the read function which is for one character inputs. This is where the clock and alarm times are set. The function display_menu() starting at line 91 is then called. The main function sets up the platform, outputs a welcome message over the serial port, and then sets up the oled via OLEDrgb_begin, which requires #include "PMODOLEDrgb.h" Not the ideal situation, but considering this is the first program I have made on an ARM processor, please excuse the mess. There are several variables for holding values of the time and alarm. For more info on the timer interrupt code, see Adam Taylor's MicroZed Chronicles Part 15. With regards to the timer and interrupts, the only thing I changed from Adam's baseline was Line 15 from 100 Hz to 1Hz for the TICK_TIMER_FREQ_HZ and what the interrupt function does once triggered (more on that later). When the time equals the alarm time, the motor runs and rings the bell(s).Ī vast majority of the code is setting up the timer and/or interrupts. ![]() Using the MiniZed motor control code as a baseline and Digilent's IP as a guide, the software (in attachements) changes the timer to serve as a 1Hz update for the clock. Then, add the oled Pmod to the Pmod 2 connector with the screen side up. By default it is 50MHz on the MiniZed.Īdd the HB3 Pmod to the top row of the Pmod 1 connector exactly how Adam Taylor setup the original project. FCLK_CLK0 needs to be 50MHz for the Pmod IP to work correctly. The all of the interfaces pins to the display are inputs (outputs of the MiniZed). ![]()
0 Comments
Leave a Reply. |