Begging for code....

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI,

I need a code to capture and compare pwm signals of 50 hz frequency. I'm using xmega a3bu xplained board and I'm new to this xmega family.

Could anyone please help me in finding out the solution. 

 

Chethan kumar

Last Edited: Thu. Nov 23, 2017 - 08:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to the Forum.

 

"Begging for code..." won't get you very far.

 

The way this Forum works is that you explain, very carefully, what you want to do, show what you have tried, explain who what you did failed to work, and then others will likely give you some guidance in the right direction.

 

If you are, instead, just asking for a completed, debugged, program then you can post your request in the "Marketplace" Sub-Forum, and hire an embedded designer.

 

Next, assuming you wish to work on this yourself:

How much experience do you have with microcontrollers?

What language are you using?

What have you tried so far?

"Compare" means measure the PWM signal and compare it to something else, what else? (another PWM signal, a threshold, etc.)

What is the output of the system?

What else does the micro have to do, (displays, user interface push buttons, etc.).

 

Lastly, the Xmegas have Timer/Counter hardware modules, and these can be useful for measuring pulse widths.

Start by reviewing that section of the Xmega manual.

 

Also, know that there are TWO manuals for each Xmega chip, one for the Xmega Family, and one for the specific chip.

You will need both in order to complete your project.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The original post was appended to another thread and was split, some moderator must have chosen the appropriate title......

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could someone explain (or just speculate about) why we've had an influx of "I need code for measuring frequency and/or duty cycle" lately. What are the applications? I'm guessing it's not school work because there has been so many now that a solution should be "on the market".

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

100 or more companies/individuals competing for the same project? Maybe they have quoted a rent-a-coder project?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

still think it is school project.

and the questions are again showing that the students do not attend classes, or do not pay attention.

and inline with that are way to lazy to either read a datasheet, or so a simple search on the subject and find a solution that is getting close and then tweaking it a bit to make it work for them.

 

It is all in line with what I see at my work today, youngsters that are just plain lazy and do whatever they need to do to get on with the next thing as fast as possible.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:
still think it is school project.

Yeah - it's just the time of year that the projects are handed out

 

way to lazy to ... so a simple search on the subject

As illustrated here - in a recent similar thread: https://www.avrfreaks.net/comment...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:

 

It is all in line with what I see at my work today, youngsters that are just plain lazy and do whatever they need to do to get on with the next thing as fast as possible.

 

 

Well, many employers just want the product marketed as fast as possible. So they end up with people being sloppy, hammering a few random libraries together until things seem to work.