View previous topic :: View next topic |
Author |
Message |
mansur
Joined: 21 Feb 2013 Posts: 37 Location: Jakarta

|
Posted: Thu Oct 04, 2018 8:00 am Post subject: FM24C64 with Xmega |
|
|
Dear all,
can you advice me about external eeprom in xmega.
I'm already make epprom circuit FM24C65 with TWIC in xmega256B3U.
the address configuration is(000) A2,A1,A0.
and the result for serial debugging is:
The reading result of address equal 114 (wrong data).
the bascom source code:
Code: |
$regfile="xm256A3BUdef.dat"
$crystal = 32000000 ' 32MHz
$hwstack = 128
$swstack = 128
$framesize = 128
Config BASE = 0 ' arrays start at 0
'first enable the osc of your choice
Config Osc = Enabled , 32mhzosc = Enabled
'configure the systemclock
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
'for debug we send some data to the UART
Config Com3 = 115200 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8
open "COM3:" for binary as #2
Config Twic = 100000 ' CONFIG TWI will ENABLE the TWI master interface
const cfram_channel = 1 ' this constant is required by the fm24c64_256-xmega lib
' set it to 1 for TWIC , 2 for TWID , 4 for TWIE and 8 for TWIF
'Open "twic" For Binary As #1 ' when not using default twic, you must use a channel
const _twi_stop_1 = 1 ' just test i2cstop option, see help
Dim Twi_start As Byte ' always required for xmega i2c
I2Cinit' #1
$eepromsize = &H8192 ' set it to the size of your EEPROM
$lib "fm24c64_256-xmega.lib" ' include lib
dim ee(100) as eram byte ' dim an EEPROM array
Dim B , adres As byte
print #2, "Writing EEEPROM"
for adres = 0 to 10
print#2, adres ; ",";
ee(adres) = adres
'waitms 20 ' ONLY FOR NORMAL EEPROM , REMOVE FOR RAMTRON
next
print
print#2, "read EEEPROM"
for adres = 0 to 10
b = ee(adres)
print#2, adres;"-";b
next
end
|
(BASCOM-AVR version : 2.0.8.1 , Latest : 2.0.8.1 ) _________________ Mansur. H
Automation & Instrument Engineer |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6198 Location: Holland

|
Posted: Thu Oct 04, 2018 8:18 pm Post subject: |
|
|
do scl and sda have pull up regs? _________________ Mark |
|
Back to top |
|
 |
mansur
Joined: 21 Feb 2013 Posts: 37 Location: Jakarta

|
Posted: Fri Oct 05, 2018 7:39 am Post subject: |
|
|
Hi Albert Mark,
We use the hardware pullup.
 _________________ Mansur. H
Automation & Instrument Engineer
Last edited by mansur on Fri Oct 05, 2018 9:11 am; edited 2 times in total |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6198 Location: Holland

|
Posted: Fri Oct 05, 2018 9:03 am Post subject: |
|
|
and you are sure you use a ramtron FM chip? It will not work on a plain eeprom.
i tested this on both twic and twie.
otherwise try to address the chip first with normal i2c code. and'/or use the i2cbus scanner sample to validate the address. _________________ Mark |
|
Back to top |
|
 |
mansur
Joined: 21 Feb 2013 Posts: 37 Location: Jakarta

|
Posted: Fri Oct 05, 2018 9:20 am Post subject: |
|
|
Mark,
The manufacture is Cypress Semiconductor, the type is F Ram chip.
I bought from mouser.com
https://www.mouser.co.id/ProductDetail/877-FM24CL64B-G
the datasheet as attached, and i'm already compare with ramptron datasheet and the result is similiar chip.
Ok, we will try with normal I2C mode like general i2c eeprom. _________________ Mansur. H
Automation & Instrument Engineer |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6198 Location: Holland

|
Posted: Fri Oct 05, 2018 9:39 am Post subject: |
|
|
yes that is the right chip.
just make sure WP is connected to ground ! _________________ Mark |
|
Back to top |
|
 |
mansur
Joined: 21 Feb 2013 Posts: 37 Location: Jakarta

|
Posted: Sat Oct 06, 2018 11:06 pm Post subject: Solved |
|
|
[quote=\"albertsm\"]yes that is the right chip.
just make sure WP is connected to ground ![/quote]
Thanks Marks,
the problem has been solved by reflow the smd chip. _________________ Mansur. H
Automation & Instrument Engineer |
|
Back to top |
|
 |
|