Hello from Baltimore

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

Hello from Baltimore

Post by gothed »

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
Contact:

Post by Bianco »

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

Post by gothed »

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
Contact:

Post by Bianco »

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: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

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

Post by gothed »

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.
Post Reply