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.

Flash Memory primitves configuration to store lcd data

Status
Not open for further replies.

prasadsrkrec

Junior Member level 2
Junior Member level 2
Joined
May 18, 2012
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,421

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
void flashByteWrite (FLADDR addr, char byte, bit SFLE)
{
        bit EA_SAVE = EA; // preserve EA
        char xdata * data pwrite; // FLASH write pointer
        EA = 0; // disable interrupts
    
        FLSCL |= 0x01; // enable FLASH writes/erases
        PSCTL |= 0x01; // PSWE = 1
        
        RSTSRC = 0x02; // enable VDDMON as reset source
        *pwrite = byte; // write the byte
 
        PSCTL &= ~0x01; // PSWE = 0
        FLSCL &= ~0x01; // disable FLASH writes/erases
        PSBANK = PSBANK_SAVE; // restore PSBANK
        
        EA = EA_SAVE; // restore interrupts
}
 
 
unsigned char flashByteRead (FLADDR addr, bit SFLE)
{
        
        bit EA_SAVE = EA; // preserve EA
        
        char code * data pread; // FLASH read pointer
        unsigned char byte;
        EA = 0; // disable interrupts
        byte = *pread; // read the byte
      
        PSBANK = PSBANK_SAVE; // restore PSBANK
       
        EA = EA_SAVE; // restore interrupts
        return byte;
}
//-----------------------------------------------------------------------------
// flashPageErase
//-----------------------------------------------------------------------------
//
// This routine erases the FLASH page containing the linear FLASH address
// <addr>.
//
void flashPageErase (FLADDR addr, bit SFLE)
{
        
        bit EA_SAVE = EA; // preserve EA
        
        char xdata * data pwrite; // FLASH write pointer
        EA = 0; // disable interrupts
        
                pwrite = (char xdata *) addr;
       
        FLSCL |= 0x01; // enable FLASH writes/erases
        PSCTL |= 0x03; // PSWE = 1; PSEE = 1
        
        RSTSRC = 0x02; // enable VDDMON as reset source
        *pwrite = 0; // initiate page erase
        
        PSCTL &= ~0x03; // PSWE = 0; PSEE = 0
        FLSCL &= ~0x01; // disable FLASH writes/erases
     
        EA = EA_SAVE; // restore interrupts
}




Above one is the code which i am using ..
But i want to configure that code to lcd already i have that program .any one help me how to add address to that code?

- - - Updated - - -

I want flash memory primitives configuration to store byte in flash memory?
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top