xmos multichannel audio platform sometimes works sometimes not Topic is solved

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
feima0011
New User
Posts: 3
Joined: Fri Dec 07, 2018 7:09 am

xmos multichannel audio platform sometimes works sometimes not

Postby feima0011 » Fri Dec 07, 2018 7:35 am

I am working an active noise control problem using the xmos board.
But I got confused. Sometimes the xmos board seems to work sometimes it does not.
I do not know why.

I tried to compile and the run the following code on the xmos board. But nothing happend.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014-2016, XMOS Ltd, All rights reserved
#include <platform.h>
#include <xs1.h>
#include <stdio.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <dsp.h>
#include "i2s.h"
#include "i2c.h"
#include "gpio.h"

in port p_sw = on tile[0] : XS1_PORT_4B; /* the switch */
out port p_leds_row = on tile[0] : XS1_PORT_4C; /* the led row */
out port p_leds_col = on tile[0] : XS1_PORT_4D; /* the led column */

/////////////////////////////////////////
/// flash the led
void my_led_matrix(void)
{
while (1)
{
p_leds_row <: 0x9; // enable all row
p_leds_col <: 0x6; // 0111 row 1
delay_milliseconds(500);
p_leds_col <: 0x0; // 0111 row 1
delay_milliseconds(500) ;
}/// while end
}/// function end
////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(void )
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
par {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
on tile[0] : my_led_matrix();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
return 0;
}
View Solution
User avatar
hydrazine
New User
Posts: 3
Joined: Sun Dec 09, 2018 9:00 am

Postby hydrazine » Fri Dec 28, 2018 7:51 am

From schematic, led_row_[0..3] and led_col_[0..3] ports are located in Tile 1. So change your port definition to:

in port p_sw = on tile[1] : XS1_PORT_4B; /* the switch */
out port p_leds_row = on tile[1] : XS1_PORT_4C; /* the led row */
out port p_leds_col = on tile[1] : XS1_PORT_4D; /* the led column */

and also:

par {
on tile[1] : my_led_matrix();
}

will make it work. The switch's i/o pins are also located in Tile 1.
User avatar
hydrazine
New User
Posts: 3
Joined: Sun Dec 09, 2018 9:00 am

Postby hydrazine » Fri Dec 28, 2018 8:05 am

Some how my last reply was not posted...

The LED_ROW_[0..3] and LED_COL_[0..3] ports are located in Tile 1. So change all the tile[0] to tile[1] in your code will work. Remember to change the tile[0] to tile[1] inside the par {} statement too,
User avatar
mon2
XCore Legend
Posts: 1315
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Postby mon2 » Sat Dec 29, 2018 7:07 pm


Who is online

Users browsing this forum: No registered users and 182 guests