Ok i tried my code above and it worked fine.
I then went back and Al's code with tile[0] replaced with tile[1], here's the code
Code: Select all
#include <xs1.h>
#include <platform.h>
#include <timer.h>
on tile[1] : out port p = XS1_PORT_8B;
int main(void){
par{
on tile[1]:{
while(1){
p <: 1;
delay_milliseconds(200);
p <: 0;
delay_milliseconds(200);
}
}
}
return 0;
}
I get these errors:
Compiling LED_Test1.xc
../src/LED_Test1.xc:12: error: `tile' undeclared here (not in a function)
../src/LED_Test1.xc:12: error: 'on' expression not of type tileref
The source file XR-USB-AUDIO-2.0.xn has these lines that I think are as Al described, "the old way..."
Code: Select all
<Core Number="0" Reference="stdcore[1]">
<Port Location="XS1_PORT_8B" Name="PORT_LEDS"/>
</Core>
That line "stdcore[1]" troubles me in the .xn file. Tried replacing the references to stdcore[x].
Heres the code, sorry long
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
<Type>Device</Type>
<Name>USB Audio 2.0 Multichannel Board</Name>
<BoardId>0006021X</BoardId>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
</Declarations>
<Nodes>
<Node Id="0" Type="XS1-L1A" oscillator="13Mhz" systemfrequency="500Mhz" referencefrequency="100MHz">
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO"/>
<Port Location="XS1_PORT_1B" Name="PORT_SPI_SS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK"/>
<Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI"/>
<Port Name="UIFM_INT_CLK_PORT" Location="XS1_PORT_1I"/>
<Port Name="UIFM_USB_CLK_PORT" Location="XS1_PORT_1H"/>
<Port Name="UIFM_REG_WRITE_PORT" Location="XS1_PORT_8C"/>
<Port Name="UIFM_REG_READ_PORT" Location="XS1_PORT_8D"/>
<Port Name="UIFM_FLAG_0_PORT" Location="XS1_PORT_1N"/>
<Port Name="UIFM_FLAG_1_PORT" Location="XS1_PORT_1O"/>
<Port Name="UIFM_FLAG_2_PORT" Location="XS1_PORT_1P"/>
<Port Name="UIFM_TX_DATA_PORT" Location="XS1_PORT_8A"/>
<Port Name="UIFM_RX_DATA_PORT" Location="XS1_PORT_8B"/>
<Port Name="UIFM_STP_SUS_PORT" Location="XS1_PORT_1E"/>
<Port Name="UIFM_LS_PORT" Location="XS1_PORT_4D"/>
</Tile>
<Boot>
<Source Location="SPI:bootFlash"/>
<Bootee NodeId="1"/>
</Boot>
</Node>
<Node Id="1" Type="XS1-L1A" oscillator="13Mhz" systemfrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="XMOSLINK"/>
</Boot>
<Tile Number="0" Reference="tile[1]">
<Port Location="XS1_PORT_8B" Name="PORT_LEDS"/>
</Tile>
</Node>
</Nodes>
<Links>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="4"/>
<LinkEndpoint NodeId="1" Link="7"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="5"/>
<LinkEndpoint NodeId="1" Link="6"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="6"/>
<LinkEndpoint NodeId="1" Link="5"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="7"/>
<LinkEndpoint NodeId="1" Link="4"/>
</Link>
</Links>
<Packages>
<Package ID="0" Type="XS1-L2A-QF124">
<Component NodeId="0" InPackage="0"/>
<Component NodeId="1" InPackage="1"/>
</Package>
</Packages>
<ExternalDevices>
<Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="AT25DF041A">
<Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO"/>
<Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS"/>
<Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK"/>
<Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
<JTAGDevice NodeId="1"/>
</JTAGChain>
</Network>
Changes include:
<Declaration>tileref tile[2]</Declaration>
<Tile Number="0" Reference="tile[0]">
<Tile Number="0" Reference="tile[1]">
This .xn file worked with Al's code. So I think I get it now. I just wonder if i'm going to screw something up working with the board/chip I have and using the new code style. I guess I'll find out and post other issues if they come up.
So I hope this discussion is helpful to newbies, like me, just getting started with an older kit.
Thanks everyone for your help
MAC