We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am using my LPC2364 at 75Mhz and i am getting maximum i|O frequency upto 13MHz only. Even if i toggle just one bit.
I want upto 16MHz minimum frequency of I\O. Can i do it with Thumb instructions or 13Mhz is the max??
First of all NXP recommends to operate the device to a max of 72 MHZ !
This devices have support for both legacy(slow) I/O and Fast GPIO .What are you using ?
With Fast GPIO an I/O access should take 2 cycles only. So given the addresses of I/O are set you can achieve the required speed.
Suvidh
Use VPBDIV = 0x01
Hi Suvidh,
I have also tried to run my LPC2364 at 72MHz but still I am not getting 16MHz. I tried the maximum speed that it can work upto. I could go upto 75MHz max. After that my LPC2364 stoped working.
As per you have written i should get 72MHz/4 Cycles(2 cycle for on + 2 cycles for off)=18MHz but i am not getting it?
I am using a realview Keil IDE 3.03a. My code is as under
while(1) { FIO2PINL=0x0001; FIO2PINL=0x0002; FIO2PINL=0x0003; FIO2PINL=0x0004; FIO2PINL=0x0005; FIO2PINL=0x0006; FIO2PINL=0x0007; FIO2PINL=0x0008; FIO2PINL=0x0009; FIO2PINL=0x000A; FIO2PINL=0x000B; FIO2PINL=0x000C; FIO2PINL=0x000D; .... and the sequence follows }
In this way i should get I\O at 18MHz at P2.0 But i am getting only 13MHz.
Is it the problem of my compiler?? Should i go to assembly or thumb mode to reduce time??
i have also tried with the statements in assembly as
__asm (mov FIO2PINL,0x0001)
it gives the same output.
Can you figure out the problem?? Please help it is argent.
Hi Viktor,
What is VPBDIV. I searched for the same in the usermanual of lpc2364. This register is not present in my lpc.
Can you give me the details about which lpc u r refering to and what is the use of the statement.
Actualy VPBDIV is for LPC21xx. Sorry for that. Check bit PPCLKSEL1[3:2] for LPC23xx. When set as 01you get PCLK = CCLK . With default value (00) you get PCLK = CCLK/4
The ideal speed of 18MHz will be for something like this
LDR R0,=FIO2PIN0 MOV R1,#0x01 MOV R2,#0x02
STRB R1,[R0] STRB R2,[R0] STRB R1,[R0] STRB R2,[R0] ....
ANY data loading instructions in between the STRB will reduce the speed (say a mov instruction - 1 cycle which will be required in your case) will reduce the speed.
If your requirement is only that a limited sequence output should be fast, then you can hold the data in registers (say R1-R10)and store it to the IO in succession.
Thank you for the explanation. I have to increment the same from 0 to 1024(decimal). and i can not have that many registers. Even if i use the increment then it will waste one cyle.
I have got a way for it. i am using counters for the same. i am using commands
FIOPINSET=0x01; FIOPINCLR=0x01;
this usis the same method that u have written. 0x01 is stored in a register and it gives me 18MHz pulses. I am generating the rest from giving this signal to a counter.
Thank you for the replies.