• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: w401第六章的EX6-1
#9
高級會員
高級會員


查看用戶資訊
WriteI2C(addr_hi); // Write Control to EEPROM

的 addr_hi 沒有宣告呀 不然你改成

WriteI2C(0); // Write Control to EEPROM

在試試看,

發表於: 2006/7/12 9:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#8
初級會員
初級會員


查看用戶資訊
EEPROM_Write()
WriteI2C(addr_hi); // Write Control to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done(); // Clear SSPIF flag

WriteI2C(addr_low); // Write Address to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done();

EE_READ()
WriteI2C(addr_hi); // Write Control to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done(); // Clear SSPIF flag

WriteI2C(addr_low); // Write Address to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done();

C:\Program Files\Microchip\Ans6-2\ex6-2.c:165:Error [1105] symbol 'addr_hi' has not been defined

該如何解決呢


發表於: 2006/7/11 21:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#7
高級會員
高級會員


查看用戶資訊
細節參考下列討論
http://www.microchip.com.tw/modules/n ... 318&forum=4#forumpost1288

方法可以在 W401 workshop 教材裡的練習 6-2 ,修改一下
APP001 舊版(worskop使用) 上的EE是24C04A 4K bit
APP001 新版(一般代理商販售)上的EE是24LC32A 32K bit

使用上 address byte 需要有hi btye和 low byte
EEPROM_Write()
EE_READ()

修改內容: 多加入hi btye address
WriteI2C(addr_hi); // Write Control to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done(); // Clear SSPIF flag

WriteI2C(addr_low); // Write Address to EEPROM
while(SSPCON2bits.ACKSTAT); // test for ACK condition, if received
I2C_Done();

再注意一下頻率應該就沒問題的
OpenI2C(MASTER, SLEW_ON);// Initialize I2C module
SSPADD = 9;
//400kHz Baud clock(9) @16MHz
//100kHz Baud clock(39) @16MHz
希望有幫助

發表於: 2006/7/10 11:34
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#6
版主
版主


查看用戶資訊
檢查一下讀取部份是否工作正常?

發表於: 2006/6/5 16:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#5
初級會員
初級會員


查看用戶資訊
就是沒有數字的畫面
空空的
我寫數字1.2.3.4.5進去
獨取出來......Lcd顯示應該有1.2.3.4.5
但是沒有

發表於: 2006/6/2 20:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#4
版主
版主


查看用戶資訊
不知道你所講的"只有一格格的"是指何意?

發表於: 2006/6/2 9:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#3
初級會員
初級會員


查看用戶資訊
Please Enter your Number :
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
EEPROM WRITE is completed!
Completed to save your Number!
可以寫入但 LCD的畫面只有全部(16*2)只有一格格的
這樣對嗎....

發表於: 2006/5/31 1:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: w401第六章的EX6-1
#2
版主
版主


查看用戶資訊
利用 C18 所提供的 EEPROM 函數庫,EX6-1 應該寫的很詳細啊!
j=0;

    while(
1)            // loop here until read the NULL from EEPROM
    
{
        
EE_Read_Data.EERandomRead(0xA0,j);        // Read data from EEPROM

        
if (EE_Read_Data.i[0]!=NULL)     // check NULL data?
            
{
                
WriteDataLCD(EE_Read_Data.i[0]);        // No, display the data to LCD
                
j++;                // Point to next address of EEPROM
            
}
        else    break;                    
//Detected NUll, Break out the loop
    
}


EE_Read_Data.l = EERandomRead(0xA0,j) 就是讀 24LC02 EEPROM 的部份,讀出來的值到一個UNION裡:
union
{
int l;
char i[2];
} near EE_Read_Data;

發表於: 2006/5/30 10:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


w401第六章的EX6-1
#1
初級會員
初級會員


查看用戶資訊
w401第六章的EX6-1
所要的結果
數字輸入完畢後自EEPROM讀取剛存入的字串並顯示在LCD上
要怎麼做才能讀取EEPROM內的資料呢

發表於: 2006/5/29 23:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------