-
Notifications
You must be signed in to change notification settings - Fork 575
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
TIMER0 Interrupt #2062
Comments
Is the Question how to specifically use an Interrupt or rather how to setup the Timer to be in a specific mode? |
Hi, |
ill try my best to explain how ive accomplished to trigger the interrupt with the timer: Activating the InterruptFirst, obviously, you need a timer with the Irq enabled (Target file):
To enable it inside of my code, i use the following initialization routine irq_setie(0);
timer1_ev_pending_write(timer1_ev_pending_read());
timer1_ev_enable_write(1);
irq_attach(TIMER1_INTERRUPT, uart0Isr);
irq_setmask(irq_getmask() | 1 << TIMER1_INTERRUPT);
irq_setie(1); You will have to include <irq.h> for all irq related function calls and possibly the <generated/csr.h> aswell to get the function, which write into the Register of the timer. Using the TimerFor both modes the Documentation on the timer states this To use the Timer in One-Shot mode, the user needs to:
To use the Timer in Periodic mode, the user needs to:
You should be able to just call the right registers for the Timer, incase you need help you can check the <generated/csr.h> file in ur build directory and also use the --doc flag when running the target file to get a html representation of the Documentation in the build/doc directory. |
Hi everyone,
I try to get the interrupt from the timer0 on vexriscv SOC.
I have read the documentation and on it there is this sentence : "For both modes, the CPU can be advertised by an IRQ that the duration/period has elapsed. (The CPU can also do software polling with update_value and value to know the elapsed duration)"
I searched on the documentation but I didn't found how to set the interrupt in Periodic mode and One Shot mode.
Does anyone know how to activate the IRQ?
Thank in advance,
Gaspard
The text was updated successfully, but these errors were encountered: