DAER
I HAVE TRY TO BUILD A PCB ON BASE OF APPLICATION NOTE AVR444
WITH ATMEGA 48 20MHZ
BUT THE PWM OUTPUT IS ONLY 2KHZ NOT 20KHZ
IS CORRECT,OR WOTH SHEL I DO ?
BEST REGARDS
DAER
I HAVE TRY TO BUILD A PCB ON BASE OF APPLICATION NOTE AVR444
WITH ATMEGA 48 20MHZ
BUT THE PWM OUTPUT IS ONLY 2KHZ NOT 20KHZ
IS CORRECT,OR WOTH SHEL I DO ?
BEST REGARDS
Vandi.
You have posted 5 times in different threads on the same topic.
Stay in this thread or you will be banned.
Moderator
WOTH SHEL I DO ?
First thing to do is to TURN OFF CAPS LOCK !!
WOTH SHEL I DO ?
For a start:
Without this information (and maybe more that we will then ask about) there is nothing we can do to help you. We can not guess what your code looks like. We can not guess what clock source you have, and check that you've set it up correctly.
Right now, it if you called a car mechanic and say "My car won't start. Why?". I hope you do realize that with that little information, the car mechanic can do nothing to help you.
And I join in with others: Turn off caps lock when you post here!
Thank for ans ware
The code is the sample avr444
Sorry for caps lock
I attach the project made for IAR compiler
I,m using a atmega48 20AU on pcb I use external crystal clock 20Mhz
but i don't find where setting in iar compiler because is first time for me
I measure the PWM frequency by oscilloscope is about 0.479ms (2.5Khz)
I don't have programmed avr fuses , you are right .Where is it ?
best regards
sorry
I do
Sorry, but I'm not an IAR user. I can probably not be of much help here.
Only this: If the fuses of the AVR never has been programmed they are at their factory default. What the factory defaults are is written in the data sheet for the AVR model you use. I would suspect it says something to the effect of the internal RC oscillator being used, giving an effective frequency of 1 MHz.
Johan
I think you are Right
the command for write the flash is:
C:\Users\vandi\Documents\dude\avrdude.exe
the argumentis:
-p m48 -c usbasp -P usb -U flash:w:"$PROJ_FNAME$.HEX":i
may be I need to change something here?
thank you
I don't know.
You're so confusing..
You said you use IAR, but now you're talking about AVRDUDE. (Depending on what you're using you need to read either the IAR documentation or the AVRDUDE documentation.)
The documentation on the project BLDC project (I hope you've read it!) talks about a clock frequency of 8 MHz, yet you talk about a 20 MHz crystal.
If nothing well structured comes next I'm not interested anymore.
sorry for my confusion
I'm using IAR Assembler for AVR 6.80.1 (6.80.1.1057) for made *.hex file
then avrdude.exe for write device
thank you
Please explain your real life tools and experience.
1. Do you own an IAR licence?
2. Do you want to use the free GCC tools? e.g. that come with AS7
The AVR444 App Note that you posted will only build with obsolete IAR tools.
It is easier to maintain a C program than an ASM program.
It is almost impossible to do anything with a HEX file. (except program the AVR with a fully debugged binary)
David.
You're only getting us more and more confused. Some of what you've said:
You obviously
Whichever it is you
It is completely up to you to describe what you're doing, and formulate good question, in a way that makes us
So far you've done neither.
I won't spend more time here.
You're using IAR, specifically you've said "IAR Assembler
sorry you are right I"' write wrong : I use Iar embedded for generate file .hex .
but one question :is possible to change the code application avr444 to use
atmega48 with external clock of 20 MHZ or isn't possible ?
Is my first application sorry....
I have used the application avr444 for this reason.
I asked whether you had an IAR licence. If you have, that is an excellent reason for using IAR.
There are some but not many IAR licence holders here.
.
But most punters use the free GCC tools.
.
Regardless which tools you use, your atmega48 is never going to run at 20MHz unless you purchase a real-life 20MHz clock module. These normally have 4 or 6 pins and can be bought from Farnell, Digikey etc.
.
David.
thank you
I try to find 20MHZ clock moduls
Regardless which tools you use, your atmega48 is never going to run at 20MHz
Vandi mauro wrote:
I,m using a atmega48 20AU
your atmega48 is never going to run at 20MHz
Why not? It is a 20MHz chip when used from 4.5V-5.5V with external crystal or oscillator (which seems to be what he want to do).
His original intention was to select external clock without buying an external clock.
In #15 he decided that he would try and obtain an external clock.
Yes, of course he could run on a 20MHz external crystal. But he would need to buy a crystal AND set the fuses for external crystal.
.
Life would be a lot easier if we knew about his IAR licence. AVR444 will build with a small chip. Real life projects might need more than a 4kB chip. In which case a paid licence is required. In my humble opinion there is little point in learning how to use IAR unless you are prepared to buy a full licence.
.
David.
According to the datasheet the Clock sources are
1. Internal RC oscillator
2. Crystal oscillator
3. External clock
I use external crystal clock
What should we imagine under this mixture?
@Vandi.
Do you have an IAR licence?
Folks, do you not remember IAR? As far as I recall you do not need a license to use the ASSEMBLER. It is the compiler that you require a license for.
I can't help thinking that the "problem" here is using some very old, out dated app note to get BLDC code. Surely there have been many many BLDC projects for AVR posted on the internet (even the projects section here) that are not tied to using some 15..20 year old build tool?
Just the shortest of Googles, for example, brings me to here:
https://github.com/paulfantom/BL...
That appears to be the algorithm from AVR444 implemented in avr-gcc C code
Never used it.... so just reinforcing the unanswered question(s) above. Will crawl away quietly....
No i don"t have jar licence at the moment
but i use only for generate .hex file from avr444 source code
Thank for the help
I think I need to select well the ardude writer for external clock
I have try for atmega 48 20mhz this argument:
-p m48 -c usbasp -P usb -U flash:w:"$(ProjectDir)Debug\$(TargetName).hex":i lfuse:w:0x66:m -U hfuse:w:0xDF:m
seem work the led flashing
I test for avr444 application and I inform you