CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Reading DEVID, DEVREV and fuses on PIC24

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Oli
Guest







Reading DEVID, DEVREV and fuses on PIC24
PostPosted: Tue Nov 02, 2010 7:07 am     Reply with quote

Hi all,

I'm trying to read the following address' on the PIC24FJ256GB110

DEVID (0xFF0000)
DEVREV (0xFF0002)
CW1 (0x2ABFA)
CW2 (0x2ABFC)
CW3 (0x2ABFC)

This document: http://ww1.microchip.com/downloads/en/DeviceDoc/39907a.pdf

indicates the address' I have put in brackets.

I have attempted to access these like this:
Code:

int16 reg_ID;
#word DEVID = 0xFF0000
reg_ID = DEV_ID;


without any luck. Could somebody explain the correct way to do this?

Many thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Tue Nov 02, 2010 9:41 am     Reply with quote

#word, locates a 16bit variable into the _RAM_ at the specified location.
Which doesn't exist.

You want to access the _ROM_.

Key thing to understand, is that unlike the PC, the PIC, has completely separate RAM, and ROM memory spaces. This makes it simpler to get good performance without having to fiddle around with cache, since the chip can be initiating a ROM read/write, at the same time as it is also reading/writing the RAM. Downside, is two complete address buses, and control lines for these, and that the user needs to be aware of what memory 'space' they want to talk to.
Accessing the ROM, is more complex than a simple read, with you having to setup an address pointer, and trigger a flash read cycle, to transfer the value into RAM where you can then inspect it.

Look at the 'read_configuration_memory' instruction, and the 'read_program_memory' instruction.

Best Wishes
Oli
Guest







PostPosted: Wed Nov 03, 2010 5:51 am     Reply with quote

Thanks Ttelmah - really should have though of that! All resolved now.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group