microwire eeprom 93c06, 14,46.....


Closed Thread
Results 1 to 9 of 9
  1. #1
    darkman's Avatar
    darkman Guest

    Default microwire eeprom 93c06, 14,46.....

    I need help. this codes for 93C56 but I cant use this code for other microwire eeprom

    where change this code for 93C06,93C14,93C46,93C66,93C76, 93c86



    codes :

    eeread:
    CS = 1 ' Enable serial EEPROM
    Shiftout DI, CLK, MSBFIRST, [%1100\4, addr93c] ' Send read command and address
    Shiftin DO, CLK, MSBPOST, [data93c] ' Read data
    CS = 0

    '============================================
    eewrite:
    ' Subroutine to enable writes to serial EEPROM
    eewriteen: CSslave = 1 ' Enable serial EEPROM
    Shiftout DIslave, CLKslave, MSBFIRST, [%10011\5, 0\7] ' Send write enable command and dummy clocks
    CSslave = 0 ' Disable
    ' Subroutine to write data at addr in serial EEPROM
    eewrite: CSslave = 1 ' Enable serial EEPROM
    Shiftout DIslave, CLKslave, MSBFIRST, [%1010\4, addr93c, data93c] ' Send write command, address and data
    CSslave = 0 ' Disable
    Pause 1000 ' YAZDIKTAN SONRA BEKLE

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Did you set the TRIS register at least for those CS and Cslave pin.??? Did you disable them at the begining of your program before access to them.

    There's some slight difference between every 93C familly when you want access to them...

    93c06 93C46
    Code:
            'read from eeprom
            CS = 1                          
            Shiftout DI, CLK, MSBFIRST, [%110\3, addr\6]       
            Shiftin DO, CLK, MSBPOST, [B0,B1]                                    
            cs=0
    93c56
    Code:
         'Read from EEPROM                                
         CS = 1 
         Shiftout DI, CLK, MSBFIRST, [%110\3, addr\8]
         Shiftin DO, CLK, MSBPOST, [b0,b1]                                       
         CS = 0
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    darkman's Avatar
    darkman Guest


    Did you find this post helpful? Yes | No

    Default

    This my microwire eeprom copier project with pic

    I working now microwire eeprom reading after I' m working microwire eeprom writing complate my code :


    CS var PORTB.0 ' Chip select pin
    CLK var PORTB.1 ' Clock pin
    DI var PORTB.2 ' Data in pin
    DO var PORTB.3 ' Data out pin

    addr93c var byte ' 93C Address
    data93c var byte ' 93C Data
    size93c var byte ' 93c MEMORY SIZE

    Low CS ' Chip select inactive


    size93c=15 ' MEMORY SIZE


    p93c1:

    For addr93c=0 To size93c ' Loop 16 times
    Gosub eeread ' Read from SEEPROM
    Lcdout $fe,1,"ADRES: ",#addr93c ' Display
    Lcdout $fe, $c0,"DATA: ",Hex2 data93c
    PAUSE 1000
    Next addr93c
    GOTO son
    ' Subroutine to read data from addr in serial EEPROM
    eeread:
    CS = 1 ' Enable serial EEPROM
    Shiftout DI, CLK, MSBFIRST, [%1100\4, addr93c] ' Send read command and address
    Shiftin DO, CLK, MSBPOST, [data93c] ' Read data
    CS = 0
    RETURN

    son:

    END




    this code working with 93c 56 but not works others

    I try your codes but I' cant read 93C46...

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, this is the one i use everyday to read from 93c06 and 93c46.. it has to work...

    what about if you add this before reading from eeprom

    Code:
         low cs  
         pause 50
         addr = $01                                        
         CS = 1                                            
              Shiftout DI, CLK, MSBFIRST, [%100\3, addr\6] 
         CS = 0
    some have memory organization pin(ORG)... pin 6 if my memory is good. Should be tie to VCC.

    Last edited by mister_e; - 9th February 2005 at 18:20.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    darkman's Avatar
    darkman Guest


    Did you find this post helpful? Yes | No

    Default

    I try now please wait

  6. #6
    darkman's Avatar
    darkman Guest


    Did you find this post helpful? Yes | No

    Default

    my org pin connected to Vss

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    must be vdd

    the number after the "\" is really important. Case you don't add this \ stuf... nothing will work as you expected
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    darkman's Avatar
    darkman Guest


    Did you find this post helpful? Yes | No

    Default

    @mister_e please read your pm box

  9. #9
    Join Date
    Nov 2006
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile

    Hi,

    I download the code from Melabs and it is the code for writing to 93C56, i use this code for 93C46 but it is not working. Anybody can please help to advise what could I change to make this code work for 93C46?

    For more information the ORG pin is short to the ground or VSS. Meaning byte size address organization.

    Please help. Thanks!

    Here is the code below:



    ' PicBasic Pro program to read and write to Microwire SEEPROM 93LC56A
    '
    ' Write to the first 16 locations of an external serial EEPROM
    ' Read first 16 locations back and send to LCD repeatedly
    ' Note: for SEEPROMs with byte-sized address

    ' Define LOADER_USED to allow use of the boot loader.
    ' This will not affect normal program operation.
    Define LOADER_USED 1
    Define OSC 4

    ' Define LCD registers and bits
    Define LCD_DREG PORTD
    Define LCD_DBIT 4
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 1

    include "modedefs.bas"

    CS var PORTA.5 ' Chip select pin
    CLK var PORTC.3 ' Clock pin
    DI var PORTC.4 ' Data in pin
    DO var PORTC.5 ' Data out pin

    addr var byte ' Address
    B0 var byte ' Data

    Low CS ' Chip select inactive

    ADCON1 = 7 ' Set PORTA and PORTE to digital
    Low PORTE.2 ' LCD R/W line low (W)
    Pause 100 ' Wait for LCD to start up


    Gosub eewriteen ' Enable SEEPROM writes

    For addr = 0 To 15 ' Loop 16 times
    B0 = addr + 100 ' B0 is data for SEEPROM
    Gosub eewrite ' Write to SEEPROM
    Pause 10 ' Delay 10ms after each write
    Next addr

    loop: For addr = 0 To 15 ' Loop 16 times
    Gosub eeread ' Read from SEEPROM
    Lcdout $fe,1,#addr,": ",#B0 ' Display
    Pause 1000
    Next addr

    Goto loop

    ' Subroutine to read data from addr in serial EEPROM
    eeread: CS = 1 ' Enable serial EEPROM
    Shiftout DI, CLK, MSBFIRST, [%1100\4, addr] ' read comd and add
    Shiftin DO, CLK, MSBPOST, [B0] ' Read data
    CS = 0 ' Disable
    Return

    ' Subroutine to write data at addr in serial EEPROM
    eewrite: CS = 1 ' Enable serial EEPROM
    Shiftout DI, CLK, MSBFIRST, [%1010\4, addr, B0] ' write cmd add, data
    CS = 0 ' Disable
    Return

    ' Subroutine to enable writes to serial EEPROM
    eewriteen: CS = 1 ' Enable serial EEPROM
    Shiftout DI, CLK, MSBFIRST, [%10011\5, 0\7] 'write enable cmd clk
    CS = 0 ' Disable
    Return

    End

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  4. Replies: 6
    Last Post: - 10th June 2005, 07:31
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts