Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Program EEPROM AT28LV010 using pic microcontroller

Status
Not open for further replies.

love_electronic

Member level 5
Joined
Nov 16, 2010
Messages
93
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,964
Hi

I wanna know that can EEPROM's be programmed using PIC Microcontrollers or not?

Thanks
 
Last edited by a moderator:

Re: Program EEPROM using pic microcontroller

Ofcourse, you can make a eeprom programmer using PIC Microcontroller. PICKit 2 and 3 also programs some eeproms and I think they are PIC or dsPIC based programmers.
 

Re: Program EEPROM using pic microcontroller

Thanks pic.programmer
I don't have PICKit. I use ICD-U64 for programming Microcontrollers.
Can u tell me how to program an EEPROM using microcontroller? I want to program AT28LV010 EEPROM.
 

Re: Program EEPROM using pic microcontroller

I don't know whether your CCS C ICD-u64 can program eeproms or not. Please check your programmer manual. Also there are universal programmers available which programs 8051, PIC, AVR and also some eeproms. Google for it. If you are using PIC or AVR for your projects then they have internal eeproms and there is no need of external eeprom when they are used.

where are you going to use the eeproms ? In a PIC or AVR project ?
 

Re: Program EEPROM using pic microcontroller

Actually i don't wanna buy the programmer. I have a programmer but it does not support AT28LC010.It only supports AT28C010.
I want to make a small hardware to program eeprom using any pic microcontroller.
Can you tell me how to do that?
 

Re: Program EEPROM using pic microcontroller

Hi,

Code:
I want to program AT28LV010 EEPROM.
All the timing, the voltage levels and all other information should be given in it's datasheet.

Please read it and if required ask a specific question.

Klaus
 
Re: Program EEPROM using pic microcontroller

Sorry, I have never made a eeprom programmer using PIC or AVR. I will see if I can make one now. If I succeed then I will post the project here.
 

Re: Program EEPROM using pic microcontroller

Thanks pic.programmer

Any Other guy who knows or give me an idea how to do that.
 

Re: Program EEPROM using pic microcontroller

The only serious difference between AT28C010 and AT28LV010 is the different supply voltage. A general purpose parallel programmer should be able to handle both if it has a programmable supply voltage. But may be your programmer is too old or restricted to 5V supply. It might be possible to use a logic level converter.

AT28 series is quite easy to program because it's single supply and doesn't involve high voltage pins or special signal timing. Design of a PIC based programmer is straightforward, use a 3.3V capable PIC, connect each eeprom signal pin with a PIC GPIO, or save some pins by using address latches. An 8-bit bidirectional port and 5-6 output pins are required at minimum. Implement the programming algorithm according to datasheet.
 
Re: Program EEPROM using pic microcontroller

Hi

I wrote this code for PIC18LF46K22. It is a 3.3V device. See if this works for you. If it works then later you can fine tune the

Code:
Delay_ms(1)


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
sbit OE at LATE0_bit;
sbit WE at LATE1_bit;
sbit CE at LATE2_bit;
 
#define ADDRESS_LOW LATA
#define ADDRESS_HIGH LATB
 
#define DATA LATC
 
#define LOW 0
#define HIGH 1
 
unsigned char addr[128], data_[128];
unsigned char no_of_bytes = 0, i = 0, state = 0;
 
void AT28C010_Write_Byte(unsigned int address, unsigned char byte) {
    OE = HIGH;
    Delay_ms(1);
    ADDRESS_LOW = address & 0x00FF;
    ADDRESS_HIGH = (address & 0xFF00) >> 8;
    Delay_ms(1);
    WE = LOW;
    Delay_ms(1);
    CE = LOW;
    Delay_ms(1);
    DATA = byte;
    Delay_ms(15);
}
 
void AT28C010_Write_Page(unsigned int address, unsigned char byte) {
 
}
 
void interrupt() {
 
     unsigned char tmp = 0;
 
     if(RC1IF_bit) {
         if(OERR1_bit) {
             OERR1_bit = 0;
             CREN1_bit = 0;
             CREN1_bit = 1;
         }
         
         if(state == 2) {
             if(no_of_bytes != tmp) {
                  data_[no_of_bytes++] = UART1_Read();
             }
             else {
                 tmp = 0;
                 state = 4;
             }
         }
         else if(state == 1) {
             if(no_of_bytes != tmp) {
                  addr[no_of_bytes++] = UART1_Read();
             }
             else {
                 tmp = 0;
                 no_of_bytes = 0;
                 state = 2;
             }
         }
         else if(state == 0) {
            tmp = UART1_Read();
            state = 1;
         }
         
         RC1IF_bit = 0;
     }
}
 
void main() {
 
    CM1CON0 = 0x00;
    CM2CON0 = 0x00;
    
    SLRCON = 0x00;
    
    ANSELA = 0x00;
    ANSELB = 0x00;
    ANSELC = 0x00;
    ANSELD = 0x00;
    ANSELE = 0x00;
 
    TRISA = 0x00;
    TRISB = 0x00;
    TRISC = 0x00;
    TRISD = 0x80;
    TRISE = 0x00;
    
    PORTA = 0x00;
    PORTB = 0x00;
    PORTC = 0x00;
    PORTD = 0x00;
    PORTE = 0x00;
    
    LATA = 0x00;
    LATB = 0x00;
    LATC = 0x00;
    LATD = 0x00;
    LATE = 0x00;
    
    UART1_Init(9600);
    Delay_ms(200);
    
    RC1IE_bit = 1;
    PEIE_bit = 1;
    GIE_bit = 1;
    
    RC1IF_bit = 0;
    
    while(1) {
    
      if(state == 4) {
      
         for(i = 0; i < no_of_bytes; i++) {
             AT28C010_Write_Page(addr[i], data_[i]);
         }
         
         no_of_bytes = 0;
         state = 0;
      }
    }
}



The user has to connect the Programmer to PC and also to the EEPROM. The user has to send one byte which is tells the no_of_address to write then you have to send the addresses (max 128) and then again you send 128 bytes of data. These will be stored in addr[] and data_[] buffers and will be passed to EEPROM_Write_Byte() function.

Test this and reply.


Example:

Send ascii char 1 and then send hex values like 0x00 (addr) and 0xAA (data_) and it will write to it. Page Write and Read functions have to be implemented.

Read function will be used to verify the written data.
 

Re: Program EEPROM using pic microcontroller

Need to support 17 address lines and unprotect algorithm, should use data polling for effective programming instead of long software delays.
 

Re: Program EEPROM using pic microcontroller

should use data polling for effective programming instead of long software delays.

When writing data to eeprom ?

I thought 15 address line. Will make the necessary changes.

@FvM

Please provide info about data polling. which pins I have to monitor and for what values and when ?
 
Last edited:

Re: Program EEPROM using pic microcontroller

128 kB = 2^17 Bytes, 17 address lines

Data polling is performed by comparing data bit 7 with the previously written value. See data sheet section 4.3. Alternatively toggle bit method (section 4.4) can be used.

Within a page write procedure, up to 128 bytes can be written after an unlock operation. But the delay between two byte writes must not be larger than 150 µs, otherwise the page write is assumed complete and the already transmitted data are programmed.
 
Re: Program EEPROM using pic microcontroller

Thanks guys.
I will try your "suggestions and code" and tell you about the result.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top