|
|
View previous topic :: View next topic |
Author |
Message |
Oli Guest
|
Reading DEVID, DEVREV and fuses on PIC24 |
Posted: Tue Nov 02, 2010 7:07 am |
|
|
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: 19538
|
|
Posted: Tue Nov 02, 2010 9:41 am |
|
|
#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
|
|
Posted: Wed Nov 03, 2010 5:51 am |
|
|
Thanks Ttelmah - really should have though of that! All resolved now. |
|
|
|
|
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
|