Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add general purpose timer GPTMR #195

Merged
merged 14 commits into from
Nov 3, 2021
Merged

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Nov 2, 2021

This PR adds a general purpose 32-bit timer module GPTMR (feature request). The timer provides three memory-mapped registers CTRL (control and status), THRES (counter threshold) and COUNT (actual counter). It can operate either in single-shot mode (COUNT increments until matching THRES once) or continuous mode (COUNT increments until matching THRES, reset and restarts). Whenever COUNT matches THRES an interrupt request is generated. The timer increment can be controlled by selecting one out of eight clock pre-scalers.

The GPTMR is mapped to the previously unused base address 0xFFFFFF60 and can be enabled for synthesis by the new IO_GPTMR_EN generic (default = false). It uses FIRQ 12 to send interrupt requests to the CPU.

New design files:

  • rtl/core/neorv32_gptmr.vhd
  • sw/lib/include/neorv32_gptmr.h
  • sw/lib/source/neorv32_gptmr.c

@stnolting stnolting added the HW hardware-related label Nov 2, 2021
@stnolting stnolting self-assigned this Nov 2, 2021
@stnolting stnolting marked this pull request as ready for review November 2, 2021 18:18
@stnolting stnolting merged commit a498d66 into master Nov 3, 2021
@stnolting stnolting deleted the add_general_purpose_timer branch November 3, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant