The delay is placed behind the GPIOD block. You can place as many "nop\n\t" as you want, as shown in my previous post, to get the delay you want.
You won't get any faster than the 12MHz you already had. That is the upper limit. The delays are used to go slower and reach the timing you had in the measurements. How many 1 'nop' is depends on you clockspeed. I use the 'nop' at 96MHz, where 1 clock cycle takes around 10ns. A Teensy 3.6 running at 180MHz it should be around 5ns of delay.
Code: Select all
byte pinTable[] = {2,14,7,8,6,20,21,5};
void setup()
{
for (int i=0; i<8; i++)
{
pinMode(pinTable[i],OUTPUT);
}
}
void loop()
{
for (int i=0; i<=7; i++)
{
byte b = 1<<i;
GPIOD_PDOR = b;
__asm__("nop\n\t");
}
}