Hello All,
I am using FPB-RA4E1 board with FSP v4.2. I know that I can enable GPT output pins but I am trying to get a PWM output from a different pin (P015). I used the GPT module and set up a periodic timer with 1MHZ. During the callback function I toggle the output pin. Though I should get a 500kHz output the maximum value I saw is 360kHz. Is there a maximum limit to frequency of I/O pins? What is the reason for not getting the frequency I want?
Thanks
İrem
Hello,
Thanks for reaching out to Renesas Engineering Community.
I think that what you are trying to do cannot succeed for high frequencies.
With a timer frequency of 1 MHz and clock source = 200MHz, I achieved a pin output frequency of 446 KHz (still away from 500 KHz) with very simple software.
If I reduce the timer frequency to 100KHz the result can be achieved:
So you need to lower the frequency to output the timer in this way because after a point the software routine is not fast enough.
Hope it helps.
Best regards
AZ
It may look like simple software, but just look on the disassembly panel and see how many instructions it takes!
Why didn't you put it in the interrupt service routine? That would save quite a bit of time.
You should be able to write it in half a dozen assembler instruction which would execute in about 100ns.
set up "level" to be 0x404
Interupt service routine:
LDR R1,=level
LDR R2,=R_PFS_BASE
LDR R0,[R1]
EORS R0,R0,#1
STR R0,[R2,<portaddress>
BX LR
Executes in 55ns plus the time it takes to stack and unstack R0-R3 and R12