This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
subdevices [2020/06/09 16:35] – [PPWA] ursgraf | subdevices [2023/11/20 17:13] – Added IRQ Functions to GPIO patrickgood | ||
---|---|---|---|
Line 10: | Line 10: | ||
|0x0c|PWM|pulse width modulated output| | |0x0c|PWM|pulse width modulated output| | ||
|0x0d|PPWA|period and pulse width measurement| | |0x0d|PPWA|period and pulse width measurement| | ||
+ | |0x0f|UART|serial communication| | ||
|0x10|Watchdog|watchdog timer| | |0x10|Watchdog|watchdog timer| | ||
|0x11|Sensor|various sensors (inductive, acceleration)| | |0x11|Sensor|various sensors (inductive, acceleration)| | ||
+ | |0x15|Stepper Motor|To run a stepper motor directly| | ||
+ | |0x18|IRQ Muliplexer|To multiplex the flink IRQ lines| | ||
===== Subdevice Specific Registers ===== | ===== Subdevice Specific Registers ===== | ||
Line 53: | Line 56: | ||
===== GPIO ===== | ===== GPIO ===== | ||
- | This function realizes digital inputs and outputs. | + | This function realizes digital inputs and outputs. |
+ | Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because debouncing is derived from that clock. | ||
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
- | |0x20|4|dir_0|r/ | + | |0x20|4|base_clk|r|yes|base clock in Hz| |
- | |0x24|4|dir_1|r/ | + | |0x24|4|dir_0|r/ |
+ | |0x28|4|dir_1|r/ | ||
|..|4|..|r/ | |..|4|..|r/ | ||
|0xyy|4|val_0|r/ | |0xyy|4|val_0|r/ | ||
|0xyy+4|4|val_1|r/ | |0xyy+4|4|val_1|r/ | ||
+ | |..|4|..|r/ | ||
+ | |0xzz|4|irq_debounce_0|r/ | ||
+ | |0xzz+4|4|irq_debounce_1|r/ | ||
|..|4|..|r/ | |..|4|..|r/ | ||
A value of ' | A value of ' | ||
Line 76: | Line 84: | ||
Used to output pulse with modulated output signals. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the frequency setting is derived from this clock. | Used to output pulse with modulated output signals. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the frequency setting is derived from this clock. | ||
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
- | |0x20|4|base_clk|r|no|base clock in Hz| | + | |0x20|4|base_clk|r|yes|base clock in Hz| |
|0x24|4|ptime_0|r/ | |0x24|4|ptime_0|r/ | ||
|0x28|4|ptime_1|r/ | |0x28|4|ptime_1|r/ | ||
Line 88: | Line 96: | ||
This function realizes period and pulse width measurements. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the time measurement is derived from that clock. | This function realizes period and pulse width measurements. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the time measurement is derived from that clock. | ||
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
- | |0x20|4|base_clk|r|no|base clock in Hz| | + | |0x20|4|base_clk|r|yes|base clock in Hz| |
|0x24|4|ptime_0|r|no|channel 0: period in multiples of base clock| | |0x24|4|ptime_0|r|no|channel 0: period in multiples of base clock| | ||
|0x28|4|ptime_1|r|no|channel 1: period in multiples of base clock| | |0x28|4|ptime_1|r|no|channel 1: period in multiples of base clock| | ||
Line 96: | Line 104: | ||
|..|4|..|r|no|..| | |..|4|..|r|no|..| | ||
The status register in the subheader is unused with this function. Setting the bit 0 in the configuration register will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel. | The status register in the subheader is unused with this function. Setting the bit 0 in the configuration register will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel. | ||
+ | |||
+ | ===== UART ===== | ||
+ | This function implements one or more serial communication interfaces. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the baud rate is derived from that clock. | ||
+ | ^Offset^Size [byte] ^Name^r/ | ||
+ | |0x20|4|base_clk|r|yes|base clock in Hz| | ||
+ | |0x24|4|devider_0|rw|no|uart 0: clock divider for baud rate| | ||
+ | |0x28|4|devider_1|rw|no|uart 1: clock divider for baud rate| | ||
+ | |..|4|..|rw|no|..| | ||
+ | |0xyy|4|tx_0|rw|no|uart 0: transmit register| | ||
+ | |0xyy+4|4|tx_1|rw|no|uart 1: transmit register| | ||
+ | |..|4|..|rw|no|..| | ||
+ | |0xzz|4|rx_0|r|no|uart 0: receive register| | ||
+ | |0xzz+4|4|rx_1|r|no|uart 1: receive register| | ||
+ | |..|4|..|r|no|..| | ||
+ | |0xuu|4|stat_0|r|no|uart 0: status register| | ||
+ | |0xuu+4|4|stat_1|r|no|uart 1: status register| | ||
+ | |..|4|..|r|no|..| | ||
+ | Both the transmit and receive path contain a 1024 entry FIFO memory. \\ | ||
+ | The devider register will devide the base clock and the resulting frequency is the baudrate of the UART. The status register in the subheader is unused with this function. Setting the bit 0 in the configuration register will reset the subdevice. The status register of each channel contains the following information | ||
+ | | 31...26 | 25...16 | 15...7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | ||
+ | | unused | number of active entries in rx FIFO |unused|tx FIFO full|tx FIFO half full|tx FIFO empty|unused|rx FIFO full|rx FIFO half full|rx FIFO empty|\\ | ||
+ | This subdevice uses a pair of pins (rx / tx) on the FPGA device for each uart (channel). | ||
+ | |||
===== Watchdog ===== | ===== Watchdog ===== | ||
- | The watchdog is a decrementing counter which will fire as soon as it reaches 0. The counter decrements with every clock cycle. Is has to be set periodically to a desired value to prevent the watchdog of running out. This preset value determines the watchout time. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the watchdog timer is derived from that clock. | + | The watchdog is a decrementing counter which will fire as soon as it reaches 0. The counter decrements with every clock cycle. Is has to be set periodically to a desired value to prevent the watchdog of running out. This preset value determines the watchout time. Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because the watchdog timer is derived from that clock. The field '' |
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
|0x20|4|base_clk|r|yes|base clock in Hz| | |0x20|4|base_clk|r|yes|base clock in Hz| | ||
- | |0x24|4|status_conf|r/ | + | |0x24|4|counter|r/ |
- | |0x28|4|counter|r/ | + | |
- | === status_conf === | + | The last bit in the status |
- | | 31 | ... | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 | | + | The last bit in the configuration register holds the rearm bit. When the watchdog has fired (timed out), it has to be reset by setting the rearm bit. Write ' |
- | | | | | | | | | |rearm|status| | + | counter: |
- | status: | + | |
- | rearm: When the watchdog has fired (timed out), it has to be reset with this signal. Write ' | + | |
- | counter: before the watchdog | + | |
=== Outputs === | === Outputs === | ||
+ | This subdevice uses two pins on the FPGA device. The two output are as follows | ||
+ | * watchdog_pwm: | ||
+ | * granted: outputs logic ' | ||
===== Sensor ===== | ===== Sensor ===== |