How to get the content of Device Identification Register?

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

How to get the content of Device Identification Register by C in IAR workbench for AVR?Include manufacture ID etc.

I am not got specification of this REGISTER in DATASHEET,how to access it?

The chip is ATmega48,Atmega88,ATmega168.

Thanks.

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

The various programmer applications can find this for you.

Are you designing a new programmer?

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

No.

Would you mind telling me name of this document?
"programmer applications"?

Thanks.

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

Which programmer are you using? Does this programmer not provide the device identification?

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

I using ISP,because the content of Device Identification-Register will apply into my code,so I want to access this register under system run-mode by code.

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

hmm I do not understand what you are asking for to be honest. the device Identification Register? are you talking about a ident for each chip? because that would be the signature, to read those is like reading fusebits.

are you saying somehow you want to take the device signature (what its normally called with avrdude (-U signature:r:con:r to read it) and such)... the device signature is a few bytes that is used to identify each chip type..

is that what your looking for? you have to be more specific with each post, instead of just repeating it over.

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

Thank you a lot.I understood!

Thank you & thank mneary.

:-)

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

suzhwt wrote:
I using ISP,because the content of Device Identification-Register will apply into my code,so I want to access this register under system run-mode by code.

No way.

This registers can only be accessed by a programmer, not by the code itself.

Peter

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

theusch taught me this trick. On some AVR chips the stack pointer registers SPL and SPH are initialized to RAMEND on a reset. See the current Atmega48/88/168 data sheet page 14 section 5.6.1 SPH and SPL - Stack Pointer High and Stack Pointer Low Register. Unfortunately, reading the SPL and SPH value will only uniquely identify the ATmega48 which has 512 bytes of SRAM, while the Atmega88 and Atmega168 both have 1024 bytes of SRAM. On the other hand the major differences are between the 48 and 88/168. The 48 has no dedicated boot loader support, less SRAM, less EEPROM and less FLASH. I think the only difference between the 88 and 168 is the FLASH size. It might be good enough?

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

Another idea: At the time of programming the chip you presumably know whether it's a 48, 88 or 168 that you are putting the code into? So write a byte to an EEPROM location to hold 48, 88 or 168 and then have the main app code read that to identify which device it's running on. (this is not unlike the technique of reading fixed OSCAL calibration bytes from the flash and putting it into EEPROM which can then be "seen" by the application code)

Cliff

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

Quote:

No way.

This registers can only be accessed by a programmer, not by the code itself.

Peter


>>No<< way? Way! :( (but not for Mega48 family as OP is asking for)

Just as in the good old days it took many words and cycles to toggle an I/O bit and the AVR chip designers have now given us a way to use the PINx to toggle an output bit, they have also given us a way to read the signature on models that have SIGRD in SPMCSR. Models include Mega640 and Mega164 families (and also the Mega406 which can now actually be seen in captivity!).

Lee

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.

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

Lee,

Thanks for the SIGRD heads up. Now that I know to look for it, I also found SIGRD in the AT90USB family AVR data sheets, but nowhere else other than what you already pointed out :cry:.