lancaster-university / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
254 stars 130 forks source link

Free interrupts #352

Closed Lithimlin closed 4 years ago

Lithimlin commented 6 years ago

What interrupts from the microprocessor can still be used and are not yet occupied by anything from the microbit-dal library? I need to be able to check for events that occur with a rate of 2kHz.

zfm076 commented 4 years ago

What interrupts from the microprocessor can still be used and are not yet occupied by anything from the microbit-dal library? I need to be able to check for events that occur with a rate of 2kHz.

Hi,I also want to know the answer. Have you solved it?

Lithimlin commented 4 years ago

What interrupts from the microprocessor can still be used and are not yet occupied by anything from the microbit-dal library? I need to be able to check for events that occur with a rate of 2kHz.

Hi,I also want to know the answer. Have you solved it?

It cannot be solved since all interrupts are abstracted to events and events are only polled every millisecond. Ended up going with an Arduino.

jamesadevine commented 4 years ago

@Lithimlin Not sure that's entirely true :smile:

It highly depends on what interrupts you're referring to. For the most part, interrupt handlers are defined in the mbed layer and so you could use any of the mbed classes to achieve your aims. For timing, Ticker and TimeOut are great classes to use.

Though the DAL aims to cater to most applications, some may have to directly access hardware peripherals in order to meet tight timing requirements, for example. In this case it is better to go for something that offers little abstraction (as @Lithimlin highlights) or override interrupt handlers defined in mbed to decrease interrupt latency .

Perhaps it would be better if you describe your project aims @zfm076?

zfm076 commented 4 years ago

@Lithimlin Not sure that's entirely true

It highly depends on what interrupts you're referring to. For the most part, interrupt handlers are defined in the mbed layer and so you could use any of the mbed classes to achieve your aims. For timing, Ticker and TimeOut are great classes to use.

Though the DAL aims to cater to most applications, some may have to directly access hardware peripherals in order to meet tight timing requirements, for example. In this case it is better to go for something that offers little abstraction (as @Lithimlin highlights) or override interrupt handlers defined in mbed to decrease interrupt latency .

Perhaps it would be better if you describe your project aims @zfm076?

Hi, I need a timer interrupt events to do something(Like Serial port sends compass data to computer regularly) I don't know how to implement this timer interrupt by using the bit library. Is there an example of that? Is it possible to do that with this function: class MicroBitSystemTimerCallback : MicroBitComponent ? I've been thinking about it for days.Can you give me some ideas?Thanks