Hello All
I want to write ID for pic id address on IDE (like a config or edata)
how can I do it?
thanks a lot
Ahmet
How Can I insert pic ID on code
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
- Senacharim
- Posts: 139
- Joined: Tue Aug 10, 2010 5:19 pm
- Location: Ventura, CA
Re: How Can I insert pic ID on code
That's a bit very vague. I'm willing to bet you've not been programming long--spend enough time programming and it becomes ingrained that imprecision and ambiguity are bad.ta1dr wrote:I want to write ID for pic id address on IDE (like a config or edata)
how can I do it?
Now then, I'm guessing you're asking how to use the EEPROM.
Code: Select all
Include "EEPROM.bas"
//--- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
// EEPROM Value 'Address
EEPROM = (%11100110 As Byte) 'ConfigByte1, '0
EEPROM = (%00110000 As Byte) 'ConfigByte2, '1
EEPROM = (%00000000 As Byte) 'ConfigByte3, '2
EEPROM = (65535 As Word) 'Number '3 - 4
EEPROM = (52 As Byte) 'ID '5
Const
ConfigByte1_EEPROM = 0
Dim
ConfigByte1 as Byte
ConfigByte1 = EE.ReadByte(ConfigByte1_EEPROM)
EE.WriteByte(ConfigByte1_EEPROM, ConfigByte1)
Good luck, happy coding.
Surviving Member
Bermuda Triangle Battalion
from 2026 to 1992
Voted "Most likely to time travel"--Class of 2024.
Bermuda Triangle Battalion
from 2026 to 1992
Voted "Most likely to time travel"--Class of 2024.
Isn't he talking about the chip ID word that you can program for the pic?
If I wanted to program that ID, I would do that separately in MPLAB rather than in the program code.
Like the config bits, e.g. Brown-out, code protect, ... I.D.
Actually, no I changed my mind. It would be way better to do it in the program code. I've never used the chip ID yet, but I can think of many uses for it. But then what ever ID it is that you want to burn to the chip, you could easily just put it in the EEPROM. Make it something cool like the last byte in the EEPROM memory or something.
If I wanted to program that ID, I would do that separately in MPLAB rather than in the program code.
Like the config bits, e.g. Brown-out, code protect, ... I.D.
Actually, no I changed my mind. It would be way better to do it in the program code. I've never used the chip ID yet, but I can think of many uses for it. But then what ever ID it is that you want to burn to the chip, you could easily just put it in the EEPROM. Make it something cool like the last byte in the EEPROM memory or something.
yes jason you correct thanks for suggestion, good idea eepromJason wrote:Isn't he talking about the chip ID word that you can program for the pic?
If I wanted to program that ID, I would do that separately in MPLAB rather than in the program code.
Like the config bits, e.g. Brown-out, code protect, ... I.D.
Actually, no I changed my mind. It would be way better to do it in the program code. I've never used the chip ID yet, but I can think of many uses for it. But then what ever ID it is that you want to burn to the chip, you could easily just put it in the EEPROM. Make it something cool like the last byte in the EEPROM memory or something.
sorry jerry I cant explain correct but thanks for attention
thanks for attention senacharim
regards
Ahmet
FYI, Yes you can do it in MPLAB Configure>ID Memory but that will only give you access to the lower nibble of the user ID, The high nibble can be only be written to via program code.
Thanks to Jerry he has put together a small userID Module which you can download in the USB Library.
SFUSBv142
Thanks to Jerry he has put together a small userID Module which you can download in the USB Library.
SFUSBv142