PWM pins in jumpers

All technical discussions and projects around startKIT
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

Code: Select all


out port p_out = XS1_PORT_8A;
out port p_clock_out = XS1_PORT_1A;
clock clk = XS1_CLKBLK_1; /*identifier for clock named clk*/


int main(void)
{
configure_clock_rate(clk, 100, 8); /*configures clock to 100/8 =12.5Mhz*/
configure_out_port(p_out, clk, 0);/* configures outputport p_out with 0*/
configure_port_clock_output(p_clock_out , clk);
start_clock(clk);

while(1)
{
 for (int i=0; i<20; i++)
   p_out <: i;
}

}
Exactly!I use external oscilloscope.Please have a look.Thanks
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

You will need to probe physical pin X0D02 to monitor activity of bit #0 of your 8 bit port.

Please confirm that you are testing on this pin.
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

Yes i am testing
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

As i said before ,with no success ..I am using probes on D0 pin .
but when you say specifically XODO2 pin ,i cannot find that on board. In the data sheet says for XODO2 port is P4A0 with GPIO J1 55.
I am sorry i could not find it.
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

D0 pin will not work. There is no activity on that CPU pin.

You must use X0D02 on the XMOS CPU. Which kit do you have for this testing?

XCORE-200 Explorer Kit? Let me review the schematics.

Please see below. You can probe your Port8A_Bit0 using connector J1_Pin 55 on this kit. Test and post your results.

xmos_J1_pinout.png
xmos_explorer_bit0_Port8A.png

Also, more code examples that are relevant to your PWM experiments:

https://www.element14.com/community/gro ... e-programs
You do not have the required permissions to view the files attached to this post.
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

Hi there!
Thats right.Now i can see signal for Port8A_Bit0 using pin 55 (on kit its J1 -D2(55) ).Thanks for the link once again.
I will update more in the coming days.
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

Code: Select all



out port d1 = XS1_PORT_1A;
clock clk = XS1_CLKBLK_1;

PORT 1A..here there is no mention of GPIO PIN .i attach below the screenshot of datasheet for XODOO. On which pin can i see the signal generated.Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi.

1) To view which port pin you are required to physically monitor with your probe, always review the most LEFT column. For your P1A0, this is physical port X0D00. Then review the datasheet of the CPU to locate this definition for the TQFP128 CPU package. This results in physical pin # 30. However, this pin is only bonded out to a test point # TP30. At this time, no idea on where this is on the PCB layout but you could review the PCB gerbers to locate TP30. Suspecting it is very close to Pin 30 on the CPU itself.

This is option # 1.

xmos_x0d00_pin30.png
xmos_x0d00.png
xmos_x0d00_pin30_IC.png
So you can attempt to probe on TP30 (Test Point 30 on the kit - wherever that is). You could download the PCB gerbers for the kit -> review in a PCB gerber viewer tool and highlight TP30 and/or X0D0 Pin 30 on the CPU to locate this pad.

2) Option # 2 is a wiser choice and that is to move this pin inside the source code to one that is a SINGLE BIT port pin AND also is available on J1 connector that you are already probing.

Why a SINGLE BIT port pin you may ask? This is because the port pin is a clock OUTPUT. On XMOS CPUs you MUST use a single bit port pin when the pin is used for a clock output.

So the approach here is to:

a) review your CPU datasheet and locate other single bit ports. This is any port with a label of "P1" prefix. Then see if that port pin is available on the kit as a "free" port for your use without conflict with other hardware on this same kit.

b) In following the above scan,

P1B0? No cannot use since this is X0D01 and the kit schematic states this is being used as SPI Flash CS port pin. While you could use this but as you toggle this pin, the FLASH will ENABLE / DISABLE with each toggle. Skip this port pin.

P1C0? No ->X0D10 is mapped to SPI Flash CLK port pin.
P1D0? This is X0D11. Appears to be free but a pain to locate TP27. Is not available on J1 for our simple probing.

P1E0? This is X0D12 and maps to J1_Pin 39. This looks to be a winner.

So proceed to change your code as follows and then view the results on J1_Pin_39 of the kit.


Code: Select all

out port p_out = XS1_PORT_8A;
out port p_clock_out = XS1_PORT_1E;  // changed so we can monitor on J1_Pin_39 on kit
clock clk = XS1_CLKBLK_1; /*identifier for clock named clk*/


int main(void)
{
configure_clock_rate(clk, 100, 8); /*configures clock to 100/8 =12.5Mhz*/
configure_out_port(p_out, clk, 0);/* configures outputport p_out with 0*/
configure_port_clock_output(p_clock_out , clk);
start_clock(clk);

while(1)
{
 for (int i=0; i<20; i++)
   p_out <: i;
}

}
You do not have the required permissions to view the files attached to this post.
Last edited by mon2 on Thu Jan 23, 2020 2:48 pm, edited 1 time in total.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

More details on the above post:

xmos_free_1bit_port_pin.png

xmos_X0D12.png

Hope this makes sense. Write back it does not.
You do not have the required permissions to view the files attached to this post.
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

I proceeded to do with second option of changing the pins .I made it to either 1F( D13 on kit) and 1E (D12).Both were free to probe and i can see the signal there.Thanks and will update more soon.