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;
}
xmos multichannel audio platform sometimes works sometimes not Topic is solved
-
- New User
- Posts: 3
- Joined: Fri Dec 07, 2018 7:09 am
-
- New User
- Posts: 3
- Joined: Sun Dec 09, 2018 9:00 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.
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.
-
- New User
- Posts: 3
- Joined: Sun Dec 09, 2018 9:00 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,
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,
-
- XCore Legend
- Posts: 1913
- Joined: Thu Jun 10, 2010 11:43 am