• 0
dvg

BASYS 3 interrupts to functions

Question

Hi,

I'm building a simple c program for the basys mx3,

I'm trying to have the screen blink every second, but with the ability to change operate in the meantime, for example blinking screen + hitting buttons for change letters on the screen.

Because i don't want the device to 'freeze' during the waiting period (blink each second) i don't want to use "sleep(1)"

 

Can i use the interrupts in the MX3 for this cause?

can i somehow tell the device to send an interrupt every second, and create an "interrupt handler" that does XYZ operations?

I've read the programming documentation, but without any example on that matter (callback functions for interrupts, etc.)

thanks a lot for the help.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @dvg,

I do not see a reason you that you can not have an interrupt every second, and create an "interrupt handler" that does XYZ operations? Here is course work on the resource center here that covers interrupts that should help you with this task. Here is microchip interrupt reference manual for reference as well.

cheers,

Jon

Share this post


Link to post
Share on other sites
  • 0
13 hours ago, jpeyron said:

 

Hi!

I have read the Documentation, but could not understand how can i "catch" and interrupt, without a busy loop on it.

Can i attach a timer to a function? sort of 'callbacks'?

I see that some timers are connected to specific elements in the X3, but i'me looking to catch the interrupt in any global function.

 

I think that i'm missing something basic about the using of the API,

any help would be much appreciated, thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now