Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Loading data into EEPROM and reading it?

Status
Not open for further replies.
Hey there,

I'm planning to purchase some 1K EEPROM chips which uses SPI interface, and is it possible to dump the information into the chip using the PICKit 2, and then let the another PIC microcontroller read its contents?

I'm making a toy music box and wanted to preload the ROM with some music first. :)
 
Sorry for the late reply.

I just got these EEPROM chips, and I connected it to the PICKit 2 according to the readme.

However, how am I ever going to dump the contents inside the EEPROM? I tried MPLAB IDE - the Wizard ended up pointing the other compilers for the EEPROM series.

As a test, must I make an ASM, something like

Code:
org 0x00
db .1, .2, .3, .4, .5
end

(these bytes contains arbitary numbers for a test)

and then compile it and download into the EEPROM?
 
You need the stand alone PK2 software. You can download it from Microchip.

Mike.

Yes - I have the software, but I'm at a lost here. What should I do next?

I tried making an ASM out of it from the MPLAB IDE, but it refuses to make me a HEX file.

Or should I type the HEX by myself? Is there any proper procedures for that?

Also, the PICKit 2 didn't detect the EEProm - or must I select it manually?
 

Pommie

Well-Known Member
Most Helpful Member
In the PK2 software you select device family EEPROM and then the actual device in the drop down box.

As to how you make a hex file, that depends on the data that will go into it. What do you intend putting in the EEPROM?

Mike.
 
In the PK2 software you select device family EEPROM and then the actual device in the drop down box.

As to how you make a hex file, that depends on the data that will go into it. What do you intend putting in the EEPROM?

Mike.

Oh ok got it.

But the hex file - I just have no idea how to make it since I usually make files out of using MPLAB IDE.

Actually I'm intending to put note and frequency data into the EEPROM for my toy music box project. However, I have to get the EEPROM tested and working first by putting arbitary values into the thing.

For example, how am I going to write this in HEX after I wrote:

Address Start: 0x0
Define Bytes: 0x1, 0x2, 0x3, and so on

Too bad in MPLAB IDE it wasn't like typing an ASM and then compile it like I used to do in PIC16/18F. :eek:
 

Pommie

Well-Known Member
Most Helpful Member
Just start a project with an 18 series chip (18F2620) and add an asm file containing,
Code:
	org	0
	db	1,2,3,4,5,6
	end
And it will make a hex file for you.

Mike.
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
You must select a pic18 with at least as much memory as your EEPROM, the 18F4620 has 64k and so will do most EEPROMs. You can't select 16 series as they have 14 bit memory.

Mike.
 
Last edited:
This seems very interesting... Care to share more info on actual music box?

Oh yeah, will tell you some of the info later. I have to fully make sure it's 100% working first. :)

Also, could I use C instead of ASM to dump the contents into the ROM? I found it much easier for me to dump an array in C instead of ASM, 'cause in ASM, the "db" and the "dw" can only accept 6 variables in the row.:rolleyes:
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top