Page 1 of 1

xmos multichannel audio platform sometimes works sometimes not

Posted: Fri Dec 07, 2018 7:35 am
by feima0011
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;
}

Re: xmos multichannel audio platform sometimes works sometimes not

Posted: Fri Dec 28, 2018 7:51 am
by hydrazine
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.

Re: xmos multichannel audio platform sometimes works sometimes not

Posted: Fri Dec 28, 2018 8:05 am
by hydrazine
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,

Re: xmos multichannel audio platform sometimes works sometimes not

Posted: Sat Dec 29, 2018 7:07 pm
by mon2
This topic has been discussed to death...

http://www.xcore.com/viewtopic.php?f=3& ... e50#p31562