XCore RSS Feed

Last visit was: It is currently Wed Sep 08, 2010 11:00 pm



Post new topic Reply to topic  [ 12 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Need help with XC-1A Concurrent tutorial
PostPosted: Wed Jun 16, 2010 12:19 am 
Member
User avatar

Joined: Fri Dec 18, 2009 8:05 am
Posts: 10
Are you sure your doing the tutorials for the XC-1A and not the XC-1? Also make sure your opening the example projects for the 1A and not the 1. The XC-1 has similar tutorials and I made the mistake of opening the 1 , not the 1A examples when called to do so when I started.

I wish I could provide more guidance!


Top
Offline Profile View all posts by this user  
 
 Post subject: Still need help with XC-1A Concurrent LED Tutorial
PostPosted: Thu Jun 17, 2010 1:21 am 
New User

Joined: Fri Jun 04, 2010 12:40 am
Posts: 2
Hi,

I am sure I am opening the xc-1a. Here is the code generated by the wizard for the concurrent led project, as you can see it is for the xc-1a. However the previous errors pointed out are there.


/*
============================================================================
Name : xc1a-concurrent-led.xc
Description : Illuminate multiple LEDs concurrently on the XC-1A board
============================================================================
*/

#include <platform.h>
#define PERIOD 20000000

out port cled0 = PORT_CLOCKLED_0;
out port cled1 = PORT_CLOCKLED_1;
out port cled2 = PORT_CLOCKLED_2;
out port cled3 = PORT_CLOCKLED_3;
out port cledG = PORT_CLOCKLED_SELG;
out port cledR = PORT_CLOCKLED_SELR;

void flashLED (out port led, int period);

int main (void) {
par {
on stdcore [0]: { cledG <: 1;
flashLED (cled0 , PERIOD);
}
on stdcore [1]: flashLED (cled1, PERIOD);
on stdcore [2]: flashLED (cled2, PERIOD);
on stdcore [3]: flashLED (cled3, PERIOD);
}
return 0;
}

Here is the code that I copied from the last post that is supposed to work, but only works once and does
not continue.


/*
============================================================================
Name : xc1a-concurrent-led.xc
Description : Illuminate multiple LEDs concurrently on the XC-1A board
============================================================================
*/
#include <platform.h>
#define PERIOD 100000000
#define PERIODA 20000000
#define PERIODB 300000000
#define PERIODC 400000000

on stdcore [0] : out port cled0 = PORT_CLOCKLED_0;
on stdcore [1] : out port cled1 = PORT_CLOCKLED_1;
on stdcore [2] : out port cled2 = PORT_CLOCKLED_2;
on stdcore [3] : out port cled3 = PORT_CLOCKLED_3;
on stdcore [0] : out port cledG = PORT_CLOCKLED_SELG;
on stdcore [0] : out port cledR = PORT_CLOCKLED_SELR;

void flashLED (out port led, int timeout){
timer tmr;
unsigned t;
unsigned isOn = 0b01110000;
while(1){
tmr :> t;
led <: isOn;
t += timeout;
tmr when timerafter (t) :> void;
isOn = !isOn;
}
}

int main (void) {
par {
on stdcore [0]: { cledR <: 1;
flashLED (cled0 , PERIOD);
}
on stdcore [1]: flashLED (cled1, PERIODA);
on stdcore [2]: flashLED (cled2, PERIODB);
on stdcore [3]: flashLED (cled3, PERIODC);
}
return 0;
}

Again any help from anyone would be appreciated. It looks like it should work... Also would like answers to the other questions I posted previously.

Thanks.


Top
Offline Profile View all posts by this user  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: