Hello from Baltimore

First time on the site? Say hello here!
gothed
Junior Member
Posts: 7
Joined: Wed Nov 06, 2013 1:50 am

Hello from Baltimore

Postby gothed » Wed Nov 06, 2013 2:08 am

Hi everybody,

Most of my experience falls into the AVR cores, however I am still a novice. I loved the idea of XMOS when I first heard of it. My Dev kit had been collecting dust ever since.

I would like to describe my plan very briefly: I will be generating interrupts based on the zero crossing of a 1kHz sine wave. I want to toggle 32 pins at the same frequency as the sine wave. 16 of these pins would have a 90 degree phase shift. In other words they go high and low exactly a quarter of the period later. If I don't use the XMOS for this task I will use an 8 bit AVR. Can you comment on the strengths of the XCore for this particular application? The cost of the XMos is not an issue.

Thanks
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Wed Nov 06, 2013 11:58 am

Hello, welcome to the forums.

Are you using external circuitry to detect the phase changes and generates the interrupt?
In any case it sounds like an easy job for an XMOS chip. The XMOS chips are 32-bit and clocks up to 25 times higher than an AVR microcontroller, so if you deem a AVR fast enough, an XMOS chip can certainly handle it.

Two things to keep in mind: XMOS stimulates to use event-driven programming instead of interrupt-driven programming. The hardware supports interrupts it but support in C and XC lacks (you will need a bit of assembly to set up the interrupts). Both event-driven and interrupt driven programming can handle external interrupts, but in general event-driven should be faster to handle the interrupts because the context does not need to be saved. Also XMOS stimulates the use of message passing instead of shared memory between multiple XCores.
gothed
Junior Member
Posts: 7
Joined: Wed Nov 06, 2013 1:50 am

Postby gothed » Wed Nov 06, 2013 6:29 pm

Thank you for the reply. I don't understand the difference between interrupts and events. I will have an external comparator to detect the zero crossing.

What is the difference between an event and an interrupt?
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Mon Nov 11, 2013 8:27 am

Event-driven in xmos context means that a thread blocks on a resource until the event happens. The thread then resumes execution. This has the advantage that no context need to be saved. Using interrupts will interrupt the regular program flow.
User avatar
Ross
XCore Expert
Posts: 768
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Mon Nov 11, 2013 1:59 pm

Welcome :)
gothed
Junior Member
Posts: 7
Joined: Wed Nov 06, 2013 1:50 am

Postby gothed » Mon Nov 11, 2013 2:55 pm

Bianco wrote:Event-driven in xmos context means that a thread blocks on a resource until the event happens. The thread then resumes execution. This has the advantage that no context need to be saved. Using interrupts will interrupt the regular program flow.
This makes perfect sense. Thanks.

Who is online

Users browsing this forum: No registered users and 0 guests