CodeVisionAVR Fuses programming and structures

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

Hello everybody!

I want to know how to read fuse bits in codevisionAVR (need to know, what config is using). Read some topics, but all of this is uncompatible to CV.

And another question is what is the structure like "PORTD.0"? And where can I get file with definition of this structure?

Thank you for answers. 

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

knyazoleg wrote:
And another question is what is the structure like "PORTD.0"?
It's not a "structure" - it's a compiler extension.

 

The closest you can get in "normal" C using bitfields in structures is something like PORTD.b0 but CV simplifies this syntax using an internal type.

 

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

knyazoleg wrote:

I want to know how to read fuse bits in codevisionAVR...

 

Tools > Chip Programmer > Read > Fuses

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

It is kind of a chicken-and-the-egg question, and more information is needed for a full answer.  So tell AVR model and CV version if you want to get pedantic.  In particular, how did you get to this point?  You'd think you would know the fuse settings on your own app.

 

-- If the chip is locked, you may not be able to get a good read of the fuses without a chip-erase.  (that part is hazy in memory)

-- If you are accessing through Serial Program Downloading, then you will not be successful if SPIEN is in the wrong state.

-- There can be other causes for not being able to do a successful Serial Program Downloading session, and all would apply here.  SPI devices attached that interfere.  No clock source.  Too fast.

 

To use CV's built-in chip programming subsystem, then Brain [edit] Brian outlined the menu operations:

 

 

 

Brian Fairchild wrote:
Tools > Chip Programmer > Read > Fuses

 

But you can use any AVR-capable tool that you deemed not applicable.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Wed. Jul 31, 2019 - 01:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much! Understood and remembered this point

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

ATmega8, CV 3.12
https://www.avrfreaks.net/forum/reading-fuse-bits-application-flash
Your answer is best for me, but it doesn't work in this CV (and I wanna know why).

I need it, because I have task: set delay (by timer) depending on system clock and multipliers. I could know system clock reading fuse bits (especially LOW ones)

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

knyazoleg wrote:

ATmega8, CV 3.12
https://www.avrfreaks.net/forum/reading-fuse-bits-application-flash
Your answer is best for me, but it doesn't work in this CV (and I wanna know why).

I need it, because I have task: set delay (by timer) depending on system clock and multipliers. I could know system clock reading fuse bits (especially LOW ones)

 

WTF??

 

Did you try:

Brian Fairchild wrote:
Tools > Chip Programmer > Read > Fuses

 

EDIT:

CodeVision Version 3.10:

 

What make/model programmer are you using?

 

 

I need it, because I have task: set delay (by timer) depending on system clock and multipliers. I could know system clock reading fuse bits (especially LOW ones)

IF this is a BRAND NEW program>>written by you<<, AND the AVR is brand new out of the tube, then the datasheet will tell you the fuse settings.  The clock for a Mega8 out of the tube is Internal RC, 1MHz, Brown out detect @2.7v, start up 6CK cycles.

 

IT's in the datasheet:

https://ww1.microchip.com/downlo...

 

Page 51.

 

Good luck.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Wed. Jul 31, 2019 - 05:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know about that bits. I know about algorithm too. But I need read these bits during execution.

So I need algorithm. And I've read datasheet for Atmega, found it. But I cant realize it in CodeAVR. Only errors or wrong addresses to Z-pointer

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

Some later AVR can read fuse bits from code, some are even able to set lock bits but if you mean you want to change a running AVRs fuses it can't be done. They are "fuses", you 'blow' them when you program the AVR.

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

Ah, I see. So have you tried the code in post #3 of the topic you linked to? What happens?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss