Super beginner: S32K144 48MHz GPIO performance?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Super beginner: S32K144 48MHz GPIO performance?

926 Views
bananium
Contributor I

Hi

A super beginner here, just starting with S32K1 series, and ARM to be honest.

I am trying to make a simple proof of concept, producing a square wave with the following:

 

for (;;) {
  PINS_DRV_SetPins(PTD, 1 << 15U);
  PINS_DRV_ClearPins(PTD, 1 << 15U);
}

 

It works but the "problem" I have is that it's only 1.80MHz, which seems oddly slow when I read that with a 16MHz AVR I should be expecting over 2MHz.

What might I be doing wrong? Or is this the performance to be expected?

If I check CORE_CLK, BUS_CLK and PORTD_CLK with CLOCK_DRV_GetFreq I get 48MHz for all of them. Also the clocks to best of my beginner understanding are configured likewise.

I'm using the internal 48MHz FIRC.

0 Kudos
Reply
3 Replies

883 Views
bananium
Contributor I

With more direct register manipulation I am able to get 4.8MHz, which is more in line with the supposed AVR performance, so perhaps it is working as it is supposed to work.

PORTD->PCR[15] = 256;
PTD->PDDR = (1 << 15);

for (;;) {
  PTD->PCOR |= 1 << 15;
  PTD->PSOR |= 1 << 15;
}

 

0 Kudos
Reply

885 Views
bananium
Contributor I

The signal is very clean with 6ns rise and fall times, so I don't believe it's related to loading or drive strength.

0 Kudos
Reply

907 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @bananium 

The speed of GPIOs depends on the type of pad used. The rise and fall times of the output, for different drive strength settings and capacitive loads, are shown in Table 21 (AC electrical specifications at 3.3V for the S32K1xx series) and Table 23 (AC electrical specifications at 5V for the S32K1xx series) of the S32K1xx Data Sheet, Rev. 14.

The following are the available pad types for GPIOs:
- GPIO: Standard General Purpose I/O Pad
- GPIO-HD: General Purpose I/O Pad with high drive capability (Strong drive)
- GPIO-FAST: General Purpose I/O Pad supporting high-speed operation (applicable only for S32K148)

These specifications detail the rise and fall times based on the drive strength and capacitive load of the respective pad types.

 

BR, VaneB

0 Kudos
Reply