Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Embedded development / Setting AVR Fuses in C code
« Last post by mikejp56 on April 11, 2024, 01:37:27 am »
Hi All,
I am pretty new to CodeBlocks and Atmega 328P programming.
I have a simple code that blinks and LED and uses the default fuse settings for the 3 fuses in fuse.c. I would like to change the lfuse setting from 0x62 to 0xFF so I can use a crystal. How would I change ".low=LFUSE_DEFAULT" to use 0xFF? I have tried multiple things; .low=0xFF, etc. and I keep getting errors for the setting. I can change the lfuse setting in AVRDUDESS and AVRDude and the crystal setting works. I just cannot figure out the syntax for CodeBlocks.
By the way this is an awesome program for a non-programmer to learn on!
Thanks and regards.
mikejp56

PS Sorry if this is a cross post. I was advised that the original post was in the wrong place (General).
42
Hi Miguel,
Thanks, I'll post future questions like this in the Embedded Forum.
43
Plugins development / Re: Code completion using LSP and clangd
« Last post by kakas on April 10, 2024, 11:23:55 pm »
I should be the one thanking you for this amazing plugin ;D

In the coming Nightly, you will also be able to Alt-LeftMouseClick on the red/green warning/error box in the margin to apply any suggested fix.
Hmmm... I might have to keep an eye out for nightly build after this.
44
The "Embedded development" subforum is more suitable, but your question should receive more answers in an AVR-specific forum.
45
Hi Miguel,
In which section would AVR programming not be OT?
And thanks again for the prompt response.
Regards,
mikejp56.
46
AVR programming is OT here.

Atmel datasheets are very complete, read the "Memory programming" section of your micro. Do not mess with lock bits.
47
Hi all,

Please forgive me if this message is posted to the wrong forum, or if it has been asked before.

My searching of this site turned up nothing concerning Windows 11, console apps, and CodeBlocks 20.03

I'm doing tiny, little, console apps for an EDX course I want to complete. Like really, really small, nothing bigger than a couple of functions, no big numbers or huge files or anything big.

Code compiles with no complaints.

When I run the program the Windows console pops up but my program does not appear sometimes for seconds but increasingly its more like minutes. One app (about 16 calculations) tooks 3 seconds to run one time and 720 seconds to run the next time.

When I browse into the debug folder and try to run the app from there I get mostly similiar results. Or worse, Windows tells me it doesn't trust my program.

Obviously the solution to my problem would be a nice, neat, compact Linux Distro that is familliar with a newish notebook that has AMD chips. But its not my computer so I can't go changing things like that.

Any help, advice?

If I am being fantastically stupid, please let me know.

regards
Frank Scrooby

That delay sounds like the windows virus defense system is grabbing the program and scanning it for malware.
You might want to instruct your system to ignore the directory containing your projects.
48
Hi Miguel,
Thanks for your response. Is there a document that shows the different settings for each fuse? As I said I am pretty new to AVR and I only have a limited supply of ICs. I don't want to brick them if I can avoid it!
Thanks again for your response!
Regards,
mikejp56
49
What happens if you open a console and run your program from it?
50
Using Atmel Studio with the ATmega32U4 I just use this in main.c:
Code
FUSES =
  {
  .low = (FUSE_SUT1 & FUSE_CKDIV8),
  .high = (FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_EESAVE & FUSE_SPIEN & FUSE_JTAGEN),
  .extended = (FUSE_BODLEVEL2 & FUSE_BODLEVEL1 & FUSE_BODLEVEL0)
  };
The 328 should be similar.
Pages: 1 2 3 4 [5] 6 7 8 9 10