Port configuration issues when C8051F340 is connected to FM24C04

Publisher:MysticalEssenceLatest update time:2017-02-19 Source: eefocusKeywords:C8051F340  FM24C04 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I originally wanted to use the SMBus port of the microcontroller, but the official example used several timers, and my small project also needs a lot of timers.

The timer resources are not enough. So I just use the IO port to simulate the I2C timing to operate the FM24C04. The project is not strict on time.

carve. 


Therefore, the question that this article will introduce arises:

When drawing the schematic diagram, the SDA/SCL port of SMBus (corresponding to P0_0/P0_1) has been connected to the SDA and SCL of FM24C04.

So according to the normal operation, I enabled SMB0E of XBR0 and connected it to the port. Then I set the corresponding IO ports P0_0 and P0_1 to open drain.

Road, it should be OK, right? Actually not, the data read during operation is always 0xFF, it may be high impedance state.


I checked the read and write operation codes and found no problems. I also couldn't change the timing by increasing or decreasing the delay. So I suspected that there was something wrong with the crossbar switch. 

After thinking about it, I thought, since I am using analog timing, why should I set it to open drain? Why should I configure the port to SMBus? Isn't push-pull also

Is it possible? So as shown below, set SMB0E to zero. Burn, debug and run, read and write are OK. In addition, the corresponding IO port settings

Open drain or push-pull can operate normally.  


Keywords:C8051F340  FM24C04 Reference address:Port configuration issues when C8051F340 is connected to FM24C04

Previous article:Using IAR for 51 to simulate binary addition and subtraction with LED lights
Next article:MCP41010 digital potentiometer driver source code based on C8051F310

Recommended ReadingLatest update time:2024-11-16 20:56

Design and implementation of data collection network based on RFID
  1 Introduction   Radio Frequency Identification (RFID) is a rapidly developing automatic identification technology with many advantages: convenient and fast data reading, fast identification speed, simultaneous identification of multiple targets, large data capacity, long service life, wide application range, and
[Microcontroller]
Design and implementation of data collection network based on RFID
A brief discussion on the application design case of low-frequency ultrasound transdermal instrument based on C8051F340
Transdermal drug delivery system has become an emerging and important means in the medical field. Transdermal drug delivery is a method in which drugs pass through the skin and are absorbed through capillaries into the systemic circulation to produce drug effects. It can avoid the first-pass effect of the liver, pro
[Microcontroller]
A brief discussion on the application design case of low-frequency ultrasound transdermal instrument based on C8051F340
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号