Smartphone full keyboard controller and its programming

1 Introduction With the gradual popularization of smartphones, 3G services are constantly improving. It is becoming fashionable to use mobile phones to access the Internet and send and receive e-mails. The common mobile phone keyboard has only simple functions and numeric buttons, while inputting complicated Chinese characters and symbols. The need for cumbersome switching and slower input speeds, therefore, high-end mobile phones urgently need a convenient input interface. The introduction of the QWERTY keyboard solves this problem. With its full set of buttons, it allows users to easily input the desired content directly. For this reason, this mobile phone keyboard is very popular. The QWERTY keyboard is also called a full-featured keyboard. Its button distribution is basically the same as that of the PC keyboard. It mainly includes 26 English letters, numbers O~9, direction control, carriage return, Ctrl, Alt and symbol keys. It can fully realize the PC keyboard. Lose people and operations. QWERTY has an important position in the mobile phone world with its unique appearance, excellent business functions, alternative QWERTY keyboard, and its own intelligence, entertainment and avant-garde. A new generation of smartphones represented by the Gphone are equipped with a QWERTY keyboard. With the continuous deepening of the mobile phone market, many brands have been involved, including many international famous brands such as Nokia, Samsung and Motorola.
Because keyboard scanning requires a lot of GPIO, and the baseband controller or application processor in the mobile phone is limited by the number of pins of the device, the number of GPIOs that can be provided is very limited, and it is usually necessary to expand the GPIO to implement keyboard scanning, which will occupy A lot of software resources and a lot of power consumption. Therefore, Maxim has introduced two generations of full keyboard controllers, the MAX7349 and MAX7359, for this problem.

This article refers to the address: http://

2 MAX7349 and MAX7359 Programming The MAX7349 and MAX7359 can manage up to 64 buttons. Maxim's proprietary low-voltage, low-EMI static key-scan technology is used to program the debounced scan results into key values ​​based on the key sequence of the keys. The key value message is stored in the FIFO, and the mobile phone processor reads the key value message in the FIFO when appropriate, and the key message is not lost even if the processor does not process the key event in time, which is usually a non-real time operating system. It is very important for smartphones. Compared with the MAX7349, the MAX7359 adds a button release detection feature that generates a key-value message each time the button is pressed and released, making it easier to implement multi-key simultaneous input and key combination functions. In addition, the devices optimize the control registers and increase the FIFO space for storing key-value messages, from the MAX7349's 8 key presses to 16 times of memory.
The MAX7359 also features auto-sleep and auto-wake to minimize power consumption. After a sleep cycle, the auto-sleep feature places the device in a low-power state (typically 1μA). When a button event occurs, the auto wake-up feature sets the MAX7359 back to normal operation.
These two devices are simpler for hardware design, but require a little attention when writing driver software. Here are the programming recommendations for the MAX7349:
(1) It is recommended to avoid the 0 button of 0 row 0 column.
(2) MAX7349 initialization, assuming that the MAX7349 sets the I2C address of the AD0 pin to ground, the MAX7349's I2C read/write address is set to 0x71/0x70, the process is as follows:

/*MAX7349 initialization starts*/
I2C_Write(0x70,0x04,0x01,); //turn off I2C_Write (0x70,0x01,0); //9 ms debounce I2C_Write(0x70,0x02,0); //Disable Autorepeat function I2C_Wirte(0x70,0x03,0x01 // Enable hardware interrupt I2C_Write(0x70,0x05,0); //Prevent accidental output, omit I2C_Write(0x70,0x04,0x81); //Start device normal function/*MAX7349 initialization end*/
(3) After receiving the hardware interrupt, read the FIFO register continuously (I2C_Write (0x70, 0x00); I2C_Read (0x71, variable). Note that this read operation is a write operation and a read operation for writing the FIFO register address 0x00. If you want to read the FIFO continuously, you only need to write I2C_Write (0x70, 0x00) at the beginning, the FIFO register address will not be automatically incremented, and the value of 0x00 will be all 0 until it is recommended. Press the button) to set a maximum number of readings (256 times). If there is a non-zero value in the FIFO 256 times, the device will be restarted directly, and the following operations are performed:
I2C_Write(0x70,0x04,0x01); //Shutdown 12C_Write(0x70,0x04,0x81); //Start device normal function (4)About button release detection, because the MAX7349 has no button release detection, for combination keys, long and short keys, etc. Special button requirements require software coordination to achieve. The implementation is as follows:
The FIFO is read out by I2C every time a hardware interrupt is received, and the MAX7349 is restarted after 50 ms, performing the following operations:
I2C_Write(0x70,0x04,0x01,); //turn off I2C_Write(0x70,0x04,0x81); //Start the normal function of the device. If the interrupt is not received subsequently, or the FIFO is read after receiving the interrupt, there is no The last time the same button information is considered, the last time the button is released, the upper layer software sends a button release message. If there is the same key information in the read FIFO as the last time after receiving the interrupt, continue the steps of “reading the empty FIFO and waiting for the device to restart for 50 ms”.
In fact, as long as a hardware interrupt is detected, the steps of "reading FIF0, waiting for the device to restart after 50 ms" are repeated continuously until there is no new hardware interrupt after the device restarts.
(5) According to experience, when the I2C bus is not working properly, try to enable or disable the bus timeout function by setting the D0 bit of the 0x04 register. The MAX7359 adds a button release detection function, that is, pressing and releasing the button produces a key value information, so it is easier to handle than the MAX7349 software. The programming recommendations for the MAX7359 are as follows:
1 Avoid using the button MAX7359 to modify the default value of the button information FIFO (register address: 0x00) is empty, from 0x00 of the MAX7349 to 0x3f of the MAX7359. So if you are designing a new MAX7359, you should avoid using the 63rd key (the key at the intersection of Co17 and Row7) and the 62nd key (the key at the intersection of Co17 and Row6) because the software is processing the two buttons. The key value is a bit more complicated.
2MAX7359 initialization MAX7359 initialization process is as follows (assuming the MAX7359 sets the I2C address of the AD0 pin to ground, the MAX7359 I2C read / write address is set to Ox71 / 0x70);
/*MAX7359 initialization starts*/
I2C_Write (0x70, 0x01, 0x08); / / off, start to initialize I2C_Write (0x70, 0x02, 0x01); / / 10 ms debounce, adjustable I2C_Write (0x70, 0x03, 0x01); / / button message FIFO is not empty Then trigger interrupt I2C_Wirte (0x70, 0x04, 0); / / prevent error trigger GPIO
I2C_Write(0x70,0x05,0); // Turn off the auto-repeat function I2C_Write(0x70,0x06,0); // Turn off the auto-shutdown function, turn on the auto-shutdown function as needed, and set the wait time before shutting down.
I2C_Write (0x70, 0x01, 0x88); / / start device normal function / * MAX7359 initialization end * /


3 Read button messages
3.1 Setting the FIFO Register After receiving the hardware interrupt, set the FIFO register address by a write operation: 0x00.
I2C_Write(0x70,0x00): If you do not read or write to the other control registers of the MAX7359 after writing the FIFO address, the next time you read the FIFO register, you do not need to write the FIFO address.
I2C_Read (0x71, byte variable);
...... //Repeat reading FIFO until reading 0x3f which means the FIFO is empty. There can be no maximum number of times, such as 256 times. If 256 times of reading in FIFO and not reading 0x3f in the FIFO, the soft restart soft restart process as follows:
I2C_Write(0x70,0x0 1,0x08);
I2C_Write(0x70, 0x01, 0x88);
3.2 Processing of FIFO Messages After processing the read FIFO byte variable (assuming the variable name is: FIFO_BYTE), the software processing method is as follows:
(1) The non-zeroxff byte variables FIFO_BYTE and 0x3f received from the FIFO are taken as (AND 0x3f), and the resulting value is the key value (ie, one of the 0 to 63 keys is pressed or released).
(2) The FIFO_BYTE and 0x40 are then summed (AND 0x40). If the result is 0, the button is pressed. If the result is not 0, the button is released. If the hardware routing uses the 63 and 62 keys, the FIFO_BYTE processing is complicated. Please refer to the MAX7359 Programming Guide for the 62 and 63 key processing methods.
3.3 Long button processing usually requires a timer to periodically check when the keyboard press information that has not received the keyboard release information occurs. If the current time minus the button press time meets the long button time, It can send long press messages to the upper layer software.

The High Power Battery Pack is mainly used in various vehicles, ships, aircraft and other internal combustion engines, lighting, energy storage, uninterrupted power supply, mobile communication, portable electric tools, electric toys.there are some differences compared with other normal battery .
1.properties
High power Lithium Battery is a battery that powers a vehicle, usually compared to a small battery that powers a portable electronic device. And normal lithium battery is a kind of anode materials for lithium metal or lithium alloy, using nonaqueous electrolyte solution of a battery, and Rechargeable Battery lithium ion battery and lithium ion polymer battery is not the same
2.discharge power
a 4200 mah high power lithium battery can discharge all power in just a few minutes, but normal lithium battery could not do that completely, so normal lithium battery discharge ability  cannot be compared with the high power lithium batteries entirely. The biggest difference between high power lithium battery and onormal lithium battery lies in its high discharge power and higher energy. Since high power lithium-ion batteries are mainly used for automotive energy supply, they have higher discharge power than ordinary batteries.

3.High Power Battery pack can discharge at higher instantaneous current than normal Lithium Battery Pack 

11

High Power Battery Pack

High Power Battery Pack,High Power Battery,Battery Pack,Lithium Polymer Battery

YFJ TECHNOLOGY (HK) CO.,LIMITED , http://www.yfjpower.com

This entry was posted in on