I'm using all 16 match interrupts of 4 timers to generate 16 square wave
signals.. I'm getting square waves from timer2 and timer3 i.e 8 waves are
good....but timer0 and timer2 are not working when timer2 and 3
active...
what can be done
Arun
________________________________
From: rtstofer
To: l...
Sent: Monday, 1 April 2013 12:23 AM
Subject: [lpc2000] Re: square wave generation
--- In l..., arun wrote: >
> what I'm trying to say is, the smaller version of the program works... it
is only the complete program thats not working
>
> Â
> Arun
So, cut the code back to the part that works and then add the new stuff in very
small pieces until you see what makes it fail.
Even if half of the code worked, it's still too much to deal with in a
forum like this. Most of the problems that get resolved here start out around
20 to 30 lines.
Add diagnostic outputs: LEDs or printf(). Try to make it easy to see what is
happening. Printf() won't be helpful inside timing loops or interrupt
handlers but toggling an IO pin works well when viewed with a scope. By
definition, only one function (or interrupt handler) is running at any given
time. Assign each a unique number and put it out on some IO pins when the
function starts. You can look at it with a logic analyzer if one is available.
When you enter an ISR, you want to save the function number that was running,
output the new function number and then, just before returning, restore the
previous number. This will give you a perfect trace of the code execution.
Make sure you store the previous function number in a variable that is local to
the ISR. That way if the function is invoked recursively, the trace won't
be lost. Or create a stack like structure and just stack the function
numbers.
--- In l..., arun wrote: >
> what I'm trying to say is, the smaller version of the program works... it
is only the complete program thats not working
>
>
> Arun
So, cut the code back to the part that works and then add the new stuff in very
small pieces until you see what makes it fail.
Even if half of the code worked, it's still too much to deal with in a
forum like this. Most of the problems that get resolved here start out around
20 to 30 lines.
Add diagnostic outputs: LEDs or printf(). Try to make it easy to see what is
happening. Printf() won't be helpful inside timing loops or interrupt
handlers but toggling an IO pin works well when viewed with a scope. By
definition, only one function (or interrupt handler) is running at any given
time. Assign each a unique number and put it out on some IO pins when the
function starts. You can look at it with a logic analyzer if one is available.
When you enter an ISR, you want to save the function number that was running,
output the new function number and then, just before returning, restore the
previous number. This will give you a perfect trace of the code execution.
Make sure you store the previous function number in a variable that is local to
the ISR. That way if the function is invoked recursively, the trace won't
be lost. Or create a stack like structure and just stack the function
numbers.
Richard
Reply by arun●March 31, 20132013-03-31
what I'm trying to say is, the smaller version of the program works... it
is only the complete program thats not working
Arun
________________________________
From: arun
To: "l..."
Sent: Sunday, 31 March 2013 11:51 AM
Subject: [lpc2000] Re: square wave generation
ok..
but
the program with 8 square wave output (which is about half the size of this
program) works....
though this is just an extension of the same program which uses 4 timers instead
of 2 does not work...
Arun
Reply by arun●March 31, 20132013-03-31
ok..
but
the program with 8 square wave output (which is about half the size of this
program) works....
though this is just an extension of the same program which uses 4 timers instead
of 2 does not work...
Arun
Reply by rtstofer●March 30, 20132013-03-30
--- In l..., arun wrote: >
> Some one please help..
>
> Arun You posted a file containing 773 lines of code (including blank lines and
comments). NOBODY is going to try to wade through that much code!
If you posted something like 20 lines of code, maybe someone would dig through
it. For example, why bother with code for all the motors when none of the
motors work? Why have several interrupt handlers when none of them work?
Nowhere in all of that code is there any comment about what is supposed to
happen. There are quite a few low level comments but nothing describing the
'big picture'.
I'm not sure anybody wants to put that much time into understanding your
project. Cut it down to the bare minimum. Twenty or thirty lines MAX. BTW,
programs are usually written that way as well. First you get a little thing to
work, then you get a bigger thing to work.
Richard
Reply by arun●March 30, 20132013-03-30
Some one please help..
Arun
________________________________
From: arun
To: "l..."
Sent: Saturday, 30 March 2013 12:42 AM
Subject: Re: [lpc2000] Re: square wave generation
Hi
I included all the PINSEL's and tried but still no output.
Arun
________________________________
From: Kevin
To: l...
Sent: Monday, 18 March 2013 6:56 PM
Subject: [lpc2000] Re: square wave generation
I took a quick look at the code you uploaded and I think you forgot to do some
PINSEL's.
And never trust a simulator.
--
Kevin
--- In l..., "arun" wrote: >
> Hi,
>
>
> I am using LPC2368 to generate 16 square waves of independent frequency. The
program works well in simulation but there are no square waves generated in
hardware. UART0 is used to get values which determines frequency of each wave.
Please help. I'll upload the program file named 4timers.c
>
Reply by arun●March 29, 20132013-03-29
Hi
I included all the PINSEL's and tried but still no output.
Arun
________________________________
From: Kevin
To: l...
Sent: Monday, 18 March 2013 6:56 PM
Subject: [lpc2000] Re: square wave generation
I took a quick look at the code you uploaded and I think you forgot to do some
PINSEL's.
And never trust a simulator.
--
Kevin
--- In l..., "arun" wrote: >
> Hi,
>
>
> I am using LPC2368 to generate 16 square waves of independent frequency. The
program works well in simulation but there are no square waves generated in
hardware. UART0 is used to get values which determines frequency of each wave.
Please help. I'll upload the program file named 4timers.c
>
Reply by arun●March 21, 20132013-03-21
This code can generate signals of different duty cycle....
But i need different frequencies, and i need 16 such outputs...
Thanks anyway...
Arun
________________________________
From: Dan Abc
To: "l..."
Sent: Thursday, 21 March 2013 6:20 AM
Subject: Re: [lpc2000] square wave generation
email list test
________________________________
From: Dimitriy irtos
To: l...
Sent: Wednesday, March 20, 2013 2:07:25 PM
Subject: Re: [lpc2000] square wave generation
Please look at this
linkand
reply Do you need this example working on LPC?!
I can compile it with gcc for you for LPC2368 and give a project.
2013/3/18 arun
> **
> Hi,
>
> I am using LPC2368 to generate 16 square waves of independent frequency.
> The program works well in simulation but there are no square waves
> generated in hardware. UART0 is used to get values which determines
> frequency of each wave. Please help. I'll upload the program file
named
> 4timers.c
>
> -- CMake build environment project
for micro-controllers (use
it or
addyou
favorite MCU )
Reply by arun●March 21, 20132013-03-21
Thanks for the response...
I can access the chip only after few days..
I'll test and then post about the output..
Arun
________________________________
From: Kevin
To: l...
Sent: Monday, 18 March 2013 6:56 PM
Subject: [lpc2000] Re: square wave generation
I took a quick look at the code you uploaded and I think you forgot to do some
PINSEL's.
And never trust a simulator.
--
Kevin
--- In l..., "arun" wrote: >
> Hi,
>
>
> I am using LPC2368 to generate 16 square waves of independent frequency. The
program works well in simulation but there are no square waves generated in
hardware. UART0 is used to get values which determines frequency of each wave.
Please help. I'll upload the program file named 4timers.c
>
Reply by Dan Abc●March 21, 20132013-03-21
email list test
________________________________
From: Dimitriy irtos
To: l...
Sent: Wednesday, March 20, 2013 2:07:25 PM
Subject: Re: [lpc2000] square wave generation
Please look at this
linkand
reply Do you need this example working on LPC?!
I can compile it with gcc for you for LPC2368 and give a project.
2013/3/18 arun
> **
> Hi,
>
> I am using LPC2368 to generate 16 square waves of independent frequency.
> The program works well in simulation but there are no square waves
> generated in hardware. UART0 is used to get values which determines
> frequency of each wave. Please help. I'll upload the program file
named
> 4timers.c
>
> -- CMake build environment project
for micro-controllers (use
it or
addyou
favorite MCU )