Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4072

General • Re: PIO hardware bug: Instruction-dependent sub-cycle jitter?

$
0
0
The C program sets up the GPIO pin, PIO, and starts execution of the PIO. Then, in an infinite loop, it pushes into the TXFIFO 30-bit words whose 5-bit groups are: 0b10000 for 6 seconds, then 0b01111 for 6 seconds, then 0b00000 for 6 seconds.
Are you sure ?

Code:

const uint32_t PushVal = 0x84210840uL; // set all 6 bits with duration value 8const uint32_t Vals[3] = {PushVal,  // 1633 mV~PushVal, // 1621 mV0,        //    0 mV};
Your 'PushVal' seems correct, gives a repeating 0b10000 ...

Code:

0x842108408    4    2    1    0    8    4    01000 0100 0010 0001 0000 1000 0100 000010000 10000 10000 10000  10000 10000 00
But, when it comes to '-PushVal', for a desired repeating 0b01111 ...

Code:

0x84210840 ^ 0xFFFFFFFF = 0x7BDEF7BF + 1 = 0x7BDEF7C0

Code:

0x7BDEF7C07    B    D    E    F    7    C    00111 1011 1101 1110 1111 0111 1100 000001111 01111 01111  01111 01111 10000 00                               ^^^^^
Seems to me that instead of '-PushVal' you need to use 0x7BDEF7DC ...

Code:

0x7BDEF7DC7    B    D    E    F    7    D    C0111 1011 1101 1110 1111 0111 1011 110001111 01111 01111  01111 01111 01111 00

Statistics: Posted by hippy — Tue Feb 20, 2024 2:51 pm



Viewing all articles
Browse latest Browse all 4072

Trending Articles