xmos multichannel audio platform sometimes works sometimes not
Posted: 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;
}
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;
}