Continue to Site

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.

Memory

Status
Not open for further replies.

Cyborg

New Member
Hey y'all

I've been working with pic for a while now and I wanna start learning how to store programs in eeproms. I,m using PIC16F628 with windows 98 and can somebody tell me what kind of eeprom memory from Microchip.com to use with PIC16F628. Also it is possible to store two different files in it then run the one u want or make some sensor when activated activates another code (program).

Thanks
 
Cyborg said:
Hey y'all

I've been working with pic for a while now and I wanna start learning how to store programs in eeproms. I,m using PIC16F628 with windows 98 and can somebody tell me what kind of eeprom memory from Microchip.com to use with PIC16F628. Also it is possible to store two different files in it then run the one u want or make some sensor when activated activates another code (program).

Thanks

A PIC can only run programs in program memory, which is totally seperate from data memory. You can connect an external I2C (or SPI) EEPROM to a 16F628, but you can't run programs from it. A BASIC STAMP does this in a sort of way, it runs a BASIC interpreter which reads BASIC tokens from EEPROM and interprets the tokens - but it doesn't actually run a program from the EEPROM.

A 16F628 has 2K of program memory, you can quite easily (and commonly do) have more than one program in the PIC, selected by external events.
 
Reply

So what you mean is that you can connect another 12c microcontroller with the PIC16F628 then they can both work together.
If it si possible can ony other PIC be used instead of 12CPIC?
 
Re: Reply

Cyborg said:
So what you mean is that you can connect another 12c microcontroller with the PIC16F628 then they can both work together.
If it si possible can ony other PIC be used instead of 12CPIC?

I was talking about connecting an I2C EEPROM to a PIC, but you could connect two PIC's together via I2C - but I wouldn't personally, I2C is fairly complicated and I would only use it if I had an I2C chip already in the design.

You can easily do I2C master in software, one of my tutorials does just that, but I2C slave is more difficult - using extra hardware to detect the start bit is advisable, although people have done it completely in software.
 
Reply

Ok, now I understand the thing. I'll use PIC's with larger memory cause it will be alot easier since I'm a beginner.

Thank you
 
It's hard to use up all the program space in the larger PICs unless you've got a lot of table data, or perhaps pages of LCD graphics data. And that type of stuff is perfect for sticking on an external EEPROM. So there's rarely a case where you'd want to store program code externally.

The later PICs have an I2C module implemented in hardware. However, I have to mention it requires significant software control & buffering, yet is extremely poorly documented on just how to do it. On top of that, there were hardware errata (bugs) in some case. Like, there's a rare case in the PIC18F452/252 where the BufferFull (that is, a byte's been received) flag and corresponding interrupt will be skipped, and all you can hope to do is keep track of the expectation so you can perform a timeout.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top