EmbeddedRelated.com
Forums
Memfault Beyond the Launch

clock on a GPIO, lpc2387

Started by franciscocantero1 November 19, 2010
Sorry for the confusion,

> You still don't have it right !!
>
> 144 / 37 = 3.8918918918918918918918918918919

for that reason i have to send some bits at 3 clock cycles and the rest at 4 clock cycles.

yes it is an analog devices chip.

I got around it, i think!. I got the timer match output to 27MHz, and fast gpio togling a pin at 27MHZ (assembley), so I will write the required logic in asseambley and hopefully get it working.

Thanks
And sorry for the confusion once again.
--- In l..., "Donald H" wrote:
>
> --- In l..., "franciscocantero1" wrote:
> >
> > Hello,
> >
> > Sorry for the confusion,
> > the requirement is to send:
> >
> > 37 bits in 144 clock cycles.
>
> You still don't have it right !!
>
> 144 / 37 = 3.8918918918918918918918918918919
>
> It would be easier if you just say what your trying to do and be done with it.
>
> Being cryptic only drags this discussion out with no useful results.
>
> don
> >
> >
> >
> > --- In l..., "John S" wrote:
> > >
> > > So in 5 1/3 uS, you want 144 clock cycles, and 360 data bits?
> > > that puts the data rate up at 67.5 Mhz which isn't possible with this processor.
> > > The best I think you can do for data out is going to be with the SSP at 1/2 of PCLK. (bit banging will be much slower)
> > > To produce a fast clock that isn't the data clock, you'd have to use the timer or PWM and use automatic counter resetting. With external Xor gates you might be able to get the PWM to produce a funky clock that has 6 edges over some (not multiple of 6) number of PCLK cycles.
> > >
> > >
> > > --- In l..., "franciscocantero1" wrote:
> > > >
> > > >
> > > > Sorry it isn't 360 bytes, it is 45 bytes that make the 360 but bits.
> > > > And it is in one data line.
> > > >
> > > > --- In l..., "John S" wrote:
> > > > >
> > > > >
> > > > > Maybe, to send 0x55, send 0x0F0F0F0F instead to change data every 4th clock.
> > > > > you shouldn't have trouble making the clock continuous (buffered SSP helps)
> > > > > 360 bytes in 144 clocks ... how many data lines?
> > > > >
> > > > > --- In l..., "franciscocantero1" wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I had the wrong set up for the PLL, at the moment I can only get it to work with:
> > > > > > M
> > > > > > N=0
> > > > > > clksrcsel=1
> > > > > > cclkcfg=3
> > > > > >
> > > > > >
> > > > > > which gives me the output at 27MHz.
> > > > > > But the problem is that timer1 prescaler has to be set to 0,
> > > > > > T1PR=0;
> > > > > >
> > > > > > For some reason I can't get the PLL to go any faster. So I can't do any operation to send data every 3 or 4 27MHz clock cycles.
> > > > > >
> > > > > > I read the PLL problem in the errata for the LPC2387.
> > > > > > but my aim is Fcco)7MHz which doesnt exceeds the 300Mhz from the errata.
> > > > > >
> > > > > > I can't use SPI/SSP since the clock has to be always active, and the data that is send doesnt match the exact clock, I have to send 360 bytes for 144 clock cycles.
> > > > > >
> > > > >
> > > >
> > >
>

An Engineer's Guide to the LPC2100 Series

I still think the SSP is much easier way to do this (just stretch each bit over many bits).
But if you do get this working I'd be interested in how. I think you would have to do one of the following:
1. use timer and interrupts.
2. use timer and poll.
3. count assembly cycles.

I don't think you have enough time to do 1 or 2, and don't think 3 is very easy.

> I got around it, i think!. I got the timer match output to 27MHz, and fast gpio togling a pin at 27MHZ (assembley), so I will write the required logic in asseambley and hopefully get it working.

Hello,

I am trying to do option 3 in assembly.
I will post how i get on.

Rgds.

--- In l..., "John S" wrote:
>
> I still think the SSP is much easier way to do this (just stretch each bit over many bits).
> But if you do get this working I'd be interested in how. I think you would have to do one of the following:
> 1. use timer and interrupts.
> 2. use timer and poll.
> 3. count assembly cycles.
>
> I don't think you have enough time to do 1 or 2, and don't think 3 is very easy.
>
> > I got around it, i think!. I got the timer match output to 27MHz, and fast gpio togling a pin at 27MHZ (assembley), so I will write the required logic in asseambley and hopefully get it working.
>

Hello,
>
>I just join the group, how is everybody doing?
>over this week I try to get some code working with IAR, the project is nearly working, but I need to talk to a chip with an input of 27 MHz and send data at 6.9Mbps.
>
>I would like to know how to get a one of the GPIO pins to be a clock of 27MHz. My crystal is 12MHz. I thought of different ways of doing this:
>
>1- do a PWM, but I dont know what kind of control I will have for being able to send some data in other line with 3 and 4 clock cycles of the 27MHz.
>
>2- change the PLL setings to get a multiple of 27MHz, calculations where:
>M=9
>N=1
>
>3- Do a counter and in the interrupt just toggle an output pin.
>
>This is the first time that I program an arm processor, I read the manual, but the section for timers doesnt specify if i can bring a clock out.
>
>Any help will be much apreciated.
>
>Thanks
>
>
>Hi,
I am new bie, please tell me how to assign PLL clock to particular GPIO pin.What registers are to be set
>
Hello,

I have good news, finally I got the code working.
It was tedious but at the end it is sending data at the rate needed.
I used and assembly function to sends the bits.

Thank you all for the help.

Regards.
--- In l..., "franciscocantero1" wrote:
>
> Hello,
>
> I am trying to do option 3 in assembly.
> I will post how i get on.
>
> Rgds.
>
> --- In l..., "John S" wrote:
> >
> > I still think the SSP is much easier way to do this (just stretch each bit over many bits).
> > But if you do get this working I'd be interested in how. I think you would have to do one of the following:
> > 1. use timer and interrupts.
> > 2. use timer and poll.
> > 3. count assembly cycles.
> >
> > I don't think you have enough time to do 1 or 2, and don't think 3 is very easy.
> >
> > > I got around it, i think!. I got the timer match output to 27MHz, and fast gpio togling a pin at 27MHZ (assembley), so I will write the required logic in asseambley and hopefully get it working.
>


Memfault Beyond the Launch