xmos multichannel audio platform sometimes works sometimes not Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
feima0011
New User
Posts: 3
Joined: Fri Dec 07, 2018 7:09 am

xmos multichannel audio platform sometimes works sometimes not

Post 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;
}


View Solution
User avatar
hydrazine
New User
Posts: 3
Joined: Sun Dec 09, 2018 9:00 am

Post 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.
User avatar
hydrazine
New User
Posts: 3
Joined: Sun Dec 09, 2018 9:00 am

Post 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,
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

This topic has been discussed to death...

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