Reply by r_goncalves2000●February 17, 20122012-02-17
Hello Kevin.
That was inded the problem.
I found that issue in the errata but the first time I analise that I didn't
believe that could be the origin of the problem.
I overlooked this situation because all pheripherals work well.
Even the timer 0 only failed some time.
By looking again to the CMSIS code I found that there is a value for PCLKSEL0
that is set prior to the PLL0 being active.
In the code I couldn't found any comments to warn about this situation.
In my code I set PCLKSEL0/1 bits in the initialization routine of each
peripheral.
Now I changed it and the only time I change PCLKSEL0/1 is in the CMSIS code.
Now the problem does not apear.
In relation to the UART, I believe that was also the problem.
Now I don't have trash and I receive all the debug messages just from the
start of the application.
It seens to me that UART0 is able to correct from the problem but timer 0
not.
Thanks for your help.
Rui
--- In l..., "Kevin" wrote: >
> In the errata there is a problem with the PCLKSEL, I'm not sure if that
is what causing the problem. PCLKSEL must be set before PLL is enabled.
> By how much is the timer of time?
> And is this difference always the same?
>
> --- In l..., "rpsgoncalves@" wrote:
> >
> > Thanks Kevin.
> >
> > PCLKSEL0 register as the same value in both situations.
> > I'm using match 0 interruption, and timer 0 clock equal to
120MHz.
> > I'm setting interruption time to 1ms.
> >
> > I use UART 0 for debug and to change application parameters.
> > When the problem occurs the first debug messages that I send are lost
> > because trash is send.
> > I send debug messages imediatly after UART 0 initialization.
> > But this problem doesn't occur every time a reset occurs.
> >
> > Rui
>
In the errata there is a problem with the PCLKSEL, I'm not sure if that is
what causing the problem. PCLKSEL must be set before PLL is enabled.
By how much is the timer of time?
And is this difference always the same?
--- In l..., "rpsgoncalves@..." wrote: >
> Thanks Kevin.
>
> PCLKSEL0 register as the same value in both situations.
> I'm using match 0 interruption, and timer 0 clock equal to 120MHz.
> I'm setting interruption time to 1ms.
>
> I use UART 0 for debug and to change application parameters.
> When the problem occurs the first debug messages that I send are lost
> because trash is send.
> I send debug messages imediatly after UART 0 initialization.
> But this problem doesn't occur every time a reset occurs.
>
> Rui
>
Reply by "rps...@iol.pt"●February 16, 20122012-02-16
Thanks Kevin.
PCLKSEL0 register as the same value in both situations.
I'm using match 0 interruption, and timer 0 clock equal to 120MHz.
I'm setting interruption time to 1ms.
I use UART 0 for debug and to change application parameters.
When the problem occurs the first debug messages that I send are lost
because trash is send.
I send debug messages imediatly after UART 0 initialization.
But this problem doesn't occur every time a reset occurs.
Rui
Citando Kevin : >
>
>
> Also check if the peripheral clock is set correctly for your timer.
>
> I assume that the garbage on your uart happens only after a
> reset and/or connection of a serial cable. This happens to me also
> and has never caused me any problems. I think that this happens to
> be some spikes on the line during init or connection.
>
> --- In l...[1], "r_goncalves2000"
> wrote:
> >
> > Hello
> >
> > I'm using an LPC1769 and CMSISv2p00_LPC17xx.
> > I use a 12MHz crystal and the CPU is running at 120MHZ.
> > In my board I use the UART0, I2C, watchdog, LCD, etc..
> > I also have timer 0 running.
> >
> > Sometimes after a reset it seens like the timer is running
> without the correct value but much more slower.
> > Everything else seems to work ok (UART, E2PROM access, LCD, etc...)
> > This problem seens to be worst after a software reset (wich
> I make just by writing an invalid feed sequence to the watchdog).
> >
> > I print over the serial UART the values of some timer
> registers when the timer is running ok and when the timer is not
> running ok and the values are the same (CCR, TCR, PR, IR, MR0, MCR).
> > I also print the value of SystemCoreClock and in both
> situations the value is correct.
> > I could not found anything in the errata sheet.
> > Can anybody give me a sugestion to find what's the problem?
> >
> > Another issue (wich I don't know if it's related or not) but
> sometimes the UART sends garbage characters.
> > After some garbage characters the UART starts working OK.
> > Any thoughts about what is hapenning?.
> >
> > Rui
> >
>
>
>
Also check if the peripheral clock is set correctly for your timer.
I assume that the garbage on your uart happens only after a reset and/or
connection of a serial cable. This happens to me also and has never caused me
any problems. I think that this happens to be some spikes on the line during
init or connection.
--- In l..., "r_goncalves2000" wrote: >
> Hello
>
> I'm using an LPC1769 and CMSISv2p00_LPC17xx.
> I use a 12MHz crystal and the CPU is running at 120MHZ.
> In my board I use the UART0, I2C, watchdog, LCD, etc..
> I also have timer 0 running.
>
> Sometimes after a reset it seens like the timer is running without the correct
value but much more slower.
> Everything else seems to work ok (UART, E2PROM access, LCD, etc...)
> This problem seens to be worst after a software reset (wich I make just by
writing an invalid feed sequence to the watchdog).
>
> I print over the serial UART the values of some timer registers when the timer
is running ok and when the timer is not running ok and the values are the same
(CCR, TCR, PR, IR, MR0, MCR).
> I also print the value of SystemCoreClock and in both situations the value is
correct.
> I could not found anything in the errata sheet.
> Can anybody give me a sugestion to find what's the problem?
>
> Another issue (wich I don't know if it's related or not) but
sometimes the UART sends garbage characters.
> After some garbage characters the UART starts working OK.
> Any thoughts about what is hapenning?.
>
> Rui
>
Reply by r_goncalves2000●February 16, 20122012-02-16
Hello
I'm using an LPC1769 and CMSISv2p00_LPC17xx.
I use a 12MHz crystal and the CPU is running at 120MHZ.
In my board I use the UART0, I2C, watchdog, LCD, etc..
I also have timer 0 running.
Sometimes after a reset it seens like the timer is running without the correct
value but much more slower.
Everything else seems to work ok (UART, E2PROM access, LCD, etc...)
This problem seens to be worst after a software reset (wich I make just by
writing an invalid feed sequence to the watchdog).
I print over the serial UART the values of some timer registers when the timer
is running ok and when the timer is not running ok and the values are the same
(CCR, TCR, PR, IR, MR0, MCR).
I also print the value of SystemCoreClock and in both situations the value is
correct.
I could not found anything in the errata sheet.
Can anybody give me a sugestion to find what's the problem?
Another issue (wich I don't know if it's related or not) but sometimes
the UART sends garbage characters.
After some garbage characters the UART starts working OK.
Any thoughts about what is hapenning?.