专门网论坛 » ◇ThinkPad技术讨论区◇ » ◇深度技术讨论区◇ » 贴一个三菱公司提供的M37515充放电控制MCU演示板的源代码,供大家参考

2004-3-31 11:29 xsx
贴一个三菱公司提供的M37515充放电控制MCU演示板的源代码,供大家参考

看到大家关于智能电池更换电芯锁定的讨论,贴一个M37515演示板的源代码供大家参考。我先贴程序框图。

讨论贴[url]http://www.thinkpad.cn/forum/viewthread.php?tid=92094&fpage=1[/url]

[[i] Last edited by xsx on 2004-3-31 at 11:53 [/i]]

2004-3-31 11:30 xsx
主程序框图

2004-3-31 11:31 xsx
控制函数流程框图

2004-3-31 11:32 xsx
控制函数流程框图2

2004-3-31 11:34 xsx
M37515.C

// M37515 Demo Board - Mitsubishi Electronics America
// Board Designed by Mark Gould
// Firmware Programmed by Howard Chan
// Version 0.1 3/12/98
// Version 0.5 3/13/98
// Version 0.9 3/14/98
// Version 1.0 3/24/98
// ------------------------------------------------------------
// Mini App Note: The following code is designed for the M37515 board.
// The sample firmware consists of the following files:
// m37515.h - Declaration of SFR registers.
// m37515.c - Main Source code. Also sample of Multi EEprom page write and
// read.
// iic.h - header file to include to use IIC & EEprom function
// iic.c - IIC routines for Master Read, Write, & Ack Polling.
// func.h - header file to include to use AD-functions and timer init.
//
// The code below, simply intializes the MCU, the Timer (AD-sampling) and the IIC system
// Then a loop is used to write a block of more than 8 words to the function
// WriteEEprom which can handle a maximum of 8 bytes at a time (limitation of EEprom
// refer to Microchip 24C01B Serial EEprom Data Sheet.) Then the Target buffer
// is cleared of old data. The Seek function is called to move the EEprom
// address pointer to the first byte to be read. Where ReadEEprom is used to
// Read the consecutive block(Read have no limitation). Finally the main()
// waits forever, as a timer 1 interrupt occurs to sample the 10-bit AD data.
//
// NOTE: The while loop (EX. while(SeekEEprom(0x20));) is used, because the EEprom
// functions return a '1' if the IIC is busy with a current read or write. Thus
// it waits till it can perform the transaction before continuing.
//
#pragma language=extended
#include "iic.h"
#include "func.h"
//---------Globals----------------------
const char data[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E'};
char RXbuffer[sizeof(data)]; // This buffer will accommidate the data above
//----------Main function -----------------
void main(void) {
char i; // just a temp storage variable
char size;
Mcuinit(); // Initialize MCU registers & ports
Timerinit(); // Intialize timer1 for AD-sampling
IICinit(); // Initialize IIC and timer2 (IIC)
for(i = 0; i < sizeof(data); i += 8) {
if(i < sizeof(data) - 8) // If more than 8 bytes then
size = 8; // Write 8 bytes at a time
else // else
size = sizeof(data) - i; // Write remaining bytes
while(WriteEEprom(&data[i],0x20 + i,size)); // write data to EEprom
}
for(i = 0; i < sizeof(data); i++) // Clear RXbuffer
RXbuffer[i] = 0;
while(SeekEEprom(0x20)); // Move EEprom address pointer to 1st byte to read
while(ReadEEprom(RXbuffer,sizeof(data))); // Read EEprom data
while(1); // Wait here
}

2004-3-31 11:36 xsx
IIC.H

#ifndef IIC
#define IIC 0
// Function Declarations for EEprom
char WriteEEprom(void *dsptr, unsigned char address, unsigned char size);
char SeekEEprom(unsigned char address);
char ReadEEprom(void *dsptr, unsigned char size);
void Delay(int time);
// Function Declarations for IIC
void IICinit(void);
char MasterIIC(void *dsptr, char slvaddr, char datasize, char RW);
interrupt [0xF0 - 0xDC] void SMBus_intr(void);
interrupt [0xE8 - 0xDC] void timer2_intr(void);
#endif

2004-3-31 11:41 xsx
IIC.C

// M37515 Demo Board - Mitsubishi Electronics America
// Firmware Programmed by Howard Chan
// Version 0.1 3/12/98
// Version 0.5 3/13/98
// Version 0.9 3/14/98
// Version 1.0 3/24/98
// ------------------------------------------------------------
// Mini App Note: The following routines are used for interfacing with
// the M37515 IIC hardware. The main engine is in the MasterIIC() function
// and the SMBus_intr() function. The others are just application functions for
// EEprom. NOTE: Slave mode hasn't been implemented yet.
//
//
#include "m37515.h"
#include <intr740.h>
//-------Definitions-------------
#define WRITE 0 // Write
#define READ 1 // Read
#define NULL 0 // Null
#define IIC_TIME 0x01 // IIC polling time = f(Xin)
//-------Buffer Global-----------
struct {
char *rxptr; // Rx Data pointer NOTE: should have seperate pointers
char *txptr; // Tx Data pointer to prevent accidental overwrite.
char index; // index of data
char size; // size of data
char address; // Slave Address
char mode:1; // '1' - tx mode, '0' - rx mode
char txpend:1; // Are more TX transactions pending?
char rxpend:1; // Are more RX transactions pending?
} buffer; // IIC bufferbuffer;
char test5; // Debug Only
struct {
char clkmode;
} IICparameters;
//--------IIC Functions-----------
// FUNC: void IICinit(void)
// DESC: Initialize IIC system to single master bus.
void IICinit(void) {
disable_interrupt();
T2 = IIC_TIME; // Set IIC Time
T2REQ = 0; // Reset Timer 2 Interrupt Request
T2EN = 0; // Disable Timer 2 Interrupt (Called when Polling required)
S2 = 0xC5; // 11000101b - Set Clock mode & NACK return mode
                // ||||||||
                // |||+++++-- 100 @ Standard Clock Mode
                // ||+------- FAST: 0 - Standard Clock Mode
                // |+-------- ACK bit: 1 - ACK non-return mode
                // +--------- ACK: 1 - No ACK clock sent
S1 = 0x10; // 00010000b - Hold Scl to high
                 // ||||||||
                 // ||||++++-- Don't Care
                 // |||+------ PIN: 1 - Clr IRQ for next INT
                 // ||+------- BB: 0 - Send Stop Condition
                 // |+-------- TRX: 0 - Recieve Mode
                 // +--------- MST: 0 - Slave Mode (Don't generate start or stop)
S1D = 0x50; // 01010000b - Disable communications and set ports
                  // ||||||||
                  // |||||+++-- Bit counter - Don't Use
                  // ||||+----- ES0: 0 - Disable S0 IIC
                  // |||+------ ALS: 1 - Free form (EEprom)
                  // ||+------- SAD: 0 - 7-bit address
                  // |+-------- TSEL: 1 - P24 & P25
                  // +--------- TISS: 0 - CMOS input
// ICON & IREQ Setting
IICREQ = 0; // Clear interrupt request
IICEN = 1; // '1'- Enable, '0' Disable IIC interrupt
enable_interrupt();
}
// FUNC: void Delay(int time)
// DESC: Add delay
// time: Lenth of delay: (Actual time hasn't been calculated.
void Delay(int time) {
int i;
for(i = 0; i<time; i++);
}
// FUNC: char MasterIIC(void *dsptr, char slvaddr, char datasize, char RW)
// DESC: Access IIC bus as Master transaction
// return: "0" - successful transaction, "1" - Read or Write Pending, Transaction denied
// dsptr: pointer to a data structure to write to IIC.
// slvaddr: slave address of device on bus.
// size: total size of data transcation
// RW: "0" - Write mode, "1" - Read mode;
char MasterIIC(void *dsptr, char slvaddr, char datasize, char RW) {
if (buffer.rxpend || buffer.txpend)
return 1; // '1' - Read or Write is still pending
ES0 = 0; // Disable IIC
ACKbit = !RW; // '1' = ACK non-return mode, '0' = ACK return mode
S1 = 0x10; // 00010000b - Hold Scl to high
                 // ||||||||
                 // ||||++++-- Don't Care
                 // |||+------ PIN: 1 - Clr IRQ for next INT
                 // ||+------- BB: 0 - Send Stop Condition
                 // |+-------- TRX: 0 - Recieve Mode
                 // +--------- MST: 0 - Slave Mode (Don't generate start or stop)
ES0 = 1; // ES0: 1 - Enable IIC
S0 = (slvaddr << 1) | (RW & 0x01); // Set Slave address and transfer direction
           // SSSSSSSR
           // ||||||||
           // |||||||+-- RW#: 0 - Write mode, '1' - Read mode
           // +++++++--- Slave Address
S1 = 0xF0; // 11110000b - Send Start Condition
                 // ||||||||
                 // ||||++++-- Don't Care
                 // |||+------ PIN: 1 - Clr IRQ for next INT
                 // ||+------- BB: 1 - Send Start Condition
                 // |+-------- TRX: 1 - Transmit Mode
                 // +--------- MST: 1 - Master Mode (generate start or stop)
buffer.address = (slvaddr << 1) | (RW & 0x01); // Set Slave address and direction
buffer.size = datasize; // Set total size of ds
buffer.index = 0x00; // Set index to point to first data
if(RW) { // if RW = '1' then read
buffer.mode = 1; // '1' Read mode
buffer.rxpend = 1; // '1' Read pending
buffer.rxptr = (char *)dsptr; // Set Rx pointer to dsptr
} else {
buffer.mode = 0; // '0' Write mode
buffer.txpend = 1; // '1' Write pending
buffer.txptr = (char *)dsptr; // Set Tx pointer to dsptr
}
return 0; // '0' - Transaction complete
}
--接下贴---

[[i] Last edited by xsx on 2004-3-31 at 11:47 [/i]]

2004-3-31 11:47 xsx
---接上贴---
// FUNC: char WriteEEprom(void *dsptr, unsigned char address, unsigned char size)
// DESC: Write data to IIC bus via Buffer.
// NOTE: The Microchip 24C01B Serial EEprom has only a 8-byte write page.
// So the maximum write size per block is 8. For data that is larger than
// 8 bytes, Make subsequent calls to this function with the address incremented.
// return: "0" - successful transaction, "1" - Read or Write Pending, Transaction denied
// dsptr: pointer to a data structure to write to IIC.
// address: address of device or memory to write.
// size: total size of data. (Size limit to 8-bytes at a time)
char WriteEEprom(void *dsptr, unsigned char address, unsigned char size) {
static char EEbuf[9]; // 8 data bytes + 1 EEprom address byte
char i;
if (buffer.rxpend || buffer.txpend)
return 1; // '1' - Read or Write is still pending
EEbuf[0] = address; // Set EEprom address
for(i = 0; (i < size) && (i < 8); i++) // Copy data to write buffer
EEbuf[i + 1] = ((char *)dsptr)[i];
return MasterIIC(EEbuf, (0xA0 >> 1), size + 1, WRITE);
}
// FUNC: char SeekEEprom(unsigned char address)
// DESC: Move EEprom pointer to correct address
// return: "0" - successful transaction, "1" - Read or Write Pending, Transaction denied
// address: address of device or memory to read.
char SeekEEprom(unsigned char address) {
static unsigned char data;
data = address; // Ensure that data has an address during interrupts
return MasterIIC(&data, (0xA0 >> 1),1,WRITE);
}
// FUNC: char ReadEEprom(void *dsptr, unsigned char size)
// DESC: Read data to IIC bus via Buffer
// return: "0" - successful transaction, "1" - Read or Write Pending, Transaction denied
// dsptr: pointer to a data structure to read to IIC.
// address: address of device or memory to read.
// size: total size of data. (No size limit)
char ReadEEprom(void *dsptr, unsigned char size) {
return MasterIIC(dsptr, (0xA0 >> 1), size, READ);
}
// FUNC: interrupt [0xE8 - 0xDC] void timer2_intr(void)
// DESC: This interrupt is used for ACK polling.
interrupt [0xE8 - 0xDC] void timer2_intr(void) {
disable_interrupt(); // Initiate Acknowledge Polling
ES0 = 0; // ES0: 0 - Enable IIC
S1 = 0x10; // 00010000b - Hold Scl to high
           // ||||||||
           // ||||++++-- Don't Care
           // |||+------ PIN: 1 - Clr IRQ for next INT
           // ||+------- BB: 0 - Send Stop Condition
           // |+-------- TRX: 0 - Recieve Mode
           // +--------- MST: 0 - Slave Mode (Don't generate start or stop)
           // Delay(1);
ES0 = 1; // ES0: 1 - Enable IIC
S0 = buffer.address;// Set Slave address and transfer direction
           // SSSSSSSR
           // ||||||||
           // |||||||+-- RW#: 0 - Write mode, '1' - Read mode
           // +++++++--- Slave Address
S1 = 0xF0; // 11110000b - Send Start Condition
           // ||||||||
           // ||||++++-- Don't Care
           // |||+------ PIN: 1 - Clr IRQ for next INT
           // ||+------- BB: 1 - Send Start Condition
           // |+-------- TRX: 1 - Transmit Mode
           // +--------- MST: 1 - Master Mode (generate start or stop)
T2EN = 0; // Disable Timer 2 Interrupt
enable_interrupt();
}
// FUNC: interrupt [0xF0 - 0xDC] void SMBus_intr(void)
// DESC: Interrupt call services the IIC bus as a Master.
interrupt [0xF0 - 0xDC] void SMBus_intr(void) {
static char state; // Internal State counter
disable_interrupt();
if(AL == 1) { // If bus arbitration is lost
S2 = 0xC5; // 11000101b - return NACK return mode
           // ||||||||
           // |||+++++-- 100 @ Standard Clock Mode
           // ||+------- FAST: 0 - Standard Clock Mode
           // |+-------- ACK bit: 1 - ACK non-return mode
           // +--------- ACK: 1 - ACK clock sent
S0 = 0x00; // Flush buffer with dummy data(like a read)
}
if(LRB) { // If no ACK then Poll again.
test5++; // No Ack flag
T2REQ = 0; // Reset Timer 2 Interrupt Request
T2EN = 1; // Enable Ack Polling (Timer 2)
S1 = 0xD0; // 11010000b - Send Stop condition
} else
if(buffer.mode) {
switch(state) {
case 0:
TRX = 0; // Set direction to Rx
S0 = 0x00; // Dummy write to start next read
state = 1; // move to next state
break;
case 1:
TRX = 0; // Set direction to Rx
buffer.rxptr[buffer.index++] = S0; // Read IIC shift reg.
if (buffer.index < buffer.size) { // If more data then
S0 = 0x00; // Dummy write to start next read
state = 1; // Move to next state
} else {
S1 = 0xD0; // 11010000b - Send Stop condition
           // ||||||||
           // ||||++++-- Don't Care
           // |||+------ PIN: 1 - Clr IRQ for next INT
           // ||+------- BB: 0 - Send Stop Condition
           // |+-------- TRX: 1 - Transmit Mode
           // +--------- MST: 1 - Master Mode
buffer.rxpend = 0; // Transaction complete
state = 0; // Reset State Machine
}
break;
default:
state = 0; // Reset State Machine
S1 = 0xD0; // Send Stop condition
buffer.rxpend = 0; // RX transaction is complete
}
} else {
//--------------Write Mode---------------
if(buffer.index < buffer.size) { // If no more data to flush
S0 = buffer.txptr[buffer.index++]; // Write data to IIC shift reg.
} else {
S1 = 0xD0; // 11010000b - Send Stop condition
           // ||||||||
           // ||||++++-- Don't Care
           // |||+------ PIN: 1 - Clr IRQ for next INT
           // ||+------- BB: 0 - Send Stop Condition
           // |+-------- TRX: 1 - Transmit Mode
           // +--------- MST: 1 - Master Mode
buffer.txpend = 0; // Transcation complete
state = 0; // Reset State Machine
}
}
enable_interrupt();
}

[[i] Last edited by xsx on 2004-3-31 at 11:51 [/i]]

2004-3-31 11:48 xsx
FUNC.H

#ifndef FUNC
#define FUNC 0
// Function Declarations
void Mcuinit(void);
void Timerinit(void);
void ShowLED(unsigned int value);
unsigned int Analog(unsigned char channel);
// Interrupts
interrupt [0xEA - 0xDC] void timer1_intr(void);
#endif

2004-3-31 11:50 xsx
FUNC.C

// M37515 Demo Board - Mitsubishi Electronics America
// Firmware Programmed by Howard Chan
// Version 0.1 3/12/98
// Version 0.5 3/13/98
// Version 0.9 3/14/98
// Version 1.0 3/24/98
// ------------------------------------------------------------
// Mini App Note: The following routines are used for interfacing with
// the M37515 10-bit A-D, timers, and LEDs.
//
// The 10-bit A-D routine is very simple. It simply sets the channel bits
// to read and clears the start conversion bit. Then the bit is polled for
// A-D complete status. Then the AD-Hi must be read first for an 10-bit
// conversion, else read the AD-lo first and discard the AD-Hi for an 8-bit read
//
// For timers, just set the timer1 registers for the value to be loaded after
// every underflow, and set the interrupt vector for the appropriate ISR.
// Below is the formula used to calculate the time.
// f(Xin)/16 * (TIME) = PRE12 * <T1 or T2>;
//
// where f(Xin) = Input Xtal Frequency (Hz)
// TIME = Time of overflow in (secs)
// PRE12 = Prescaler value to load that will affect timer T1 and T2
// T1 or T2 = Timer value to be loaded on timer underflow.
//
// The LED ports (pins P13-P17) can sink up to 15 mA, so an external driver
// is not necessary. Just tie the LED to the port, and write a '0' to the
// P1 register to light the LED.
#include "m37515.h"
#include <intr740.h>
//----------Definitions ----------------
#define AD10BIT 1 // 1: 10-bit A-D, 0: 8-bit A-D
#define ADSEL_MSK 0x07 // Mask for Analog inputs xxxxxAAA
#define ADCNV_MSK 0x10 // Mask for AD conversion xxxAxxxx
#define SAMPLE_TIME 0x08 // Sample time for AD input - about 8 ms.
#define LEDRANGE 0x03ff // Full scale range of LED output
#define RANGE80 0x333 // 0.8 * LEDRANGE
#define RANGE60 0x266 // 0.6 * LEDRANGE
#define RANGE40 0x199 // 0.4 * LEDRANGE
#define RANGE20 0xCC // 0.2 * LEDRANGE
#define RANGE00 0x10 // 0.01 * LEDRANGE
unsigned int test; // Global test variables
int analog1, analog2; // Watch Variables, for Analog 1 & 2
// FUNC: void ShowLED(unsigned int value)
// DESC: Output values to LEDs as a percentage 20, 40, 60, 80, 100
// value: value to output to LEDs
void ShowLED(unsigned int value) {
// Output LEDs via trickle method
// '0' - on, '1' - off
LED100 = (value >= RANGE80) ? 0 : 1; // 80 - 100 percent
LED80 = (value >= RANGE60) ? 0 : 1; // 60 - 79 percent
LED60 = (value >= RANGE40) ? 0 : 1; // 40 - 59 percent
LED40 = (value >= RANGE20) ? 0 : 1; // 20 - 39 percent
LED20 = (value > RANGE00) ? 0 : 1; // 00 - 19 percent
}
// FUNC: unsigned int Analog(unsigned char channel)
// DESC: Read Channel of A/D port NOTE: Possible bit manipulation due to high bits.
// return: Results of 10-bit A-D conversion
// channel: select AD channel to read from 0 - 7
unsigned int Analog(unsigned char channel) {
union {
        unsigned int word;
unsigned char byte[2];
} adword;
ADCON = ADSEL_MSK & channel; // Mask correct channel and start conversion
// ADCON &= 0xEF; // Start Conversion (zero bit 4)
while(!(ADCON & ADCNV_MSK)); // wait till conversion complete (bit 4)
#if AD10BIT
adword.byte[1] = ADH; // convert ADH & ADL to an integer (10-bit)
#endif
adword.byte[0] = ADL; // NOTE: ADL
return adword.word; // Return 10-bit A/D value
}
// FUNC: void battery(void)
// DESC: A function that simply samples AD channel 0 & 1 and outputs
// the first 8-bit to P0 and last 2-bits + channel to P1;
char port;
void battery(void) {
// char port;
char temp0,temp1;
union {
unsigned int word;
unsigned char byte[2];
} ad[2];
ad[0].word = Analog(0); // Evaluate AD #0
ad[1].word = Analog(1); // Evaluate AD #1
// DEBUG VARIABLES
analog1 = ad[0].word;
analog2 = ad[1].word;
port = (ad[1].word >= ad[0].word) ? 1:0;
temp0 = ad[port].byte[0]; // Set low byte
temp1 = (0xf8 & P1) | (0x03 & ad[port].byte[1]); // Set high byte last 2 bits.
temp1 |= (port) ? 0x04: 0; // Set bit for port. 1 - port 1, 0 - port 0
P0 = temp0; // Place data on the bus (low)
P1 = temp1; // (high)
}
// FUNC: interrupt [0xEA - 0xDC] void timer1_intr(void)
// DESC: Interrupt call samples AD port #0 and displays data to LED
interrupt [0xEA - 0xDC] void timer1_intr(void) {
static char samp[2]; // Static variable assignments.
static char i;
char button;
disable_interrupt();
// Debounce routine
samp[i^=0x01] = P4.1; // store sample & index to next sample.
if(samp[0]==samp[1])
button = samp[0]; // Update button status if same.
// Battery interrupt
if(button == 0)
battery();
// Sample Pot
test = Analog(2); // For Debug Use
ShowLED(test); // Display Analog results to LED
enable_interrupt();
}
//-------------------Initialization functions ------------
// FUNC: void Timerinit(void)
// DESC: Initialize Timer 1 interrupt for A-D use.
void Timerinit(void) {
disable_interrupt();
PRE12 = 0xff; // SET Pre-scaler for timer 1 & 2
T1 = SAMPLE_TIME; // Set AD sample Time
T1REQ = 0; // Reset Timer 1 Interrupt Request
T1EN = 1; // Enable Timer 1 Interrupt
enable_interrupt();
}
// FUNC: void Mcuinit(void)
// DESC: Initialize Mcu ports, cpu mode and AD-mode
void Mcuinit(void) {
disable_interrupt();
CPUM = 0x04;
/* Set CPU mode register */
/* 00000100B */
/* |||||||| */
/* ||||||++--------------- PROCESSOR MODE BIT */
/* |||||| 00 : SINGLE CHIP MODE */
/* |||||+----------------- STACK PAGE IN PAGE 1 */
/* |||+------------------- PORT Xc : I/O PORT FUNC. */
/* ||+-------------------- MAIN CLOCK Xin-Xout : EXECTE */
/* ++--------------------- COUNTER SOURCE : F(Xin)/2 */
P0D = 0xFF; /* 11111111B (1:OUTPUT, 0:INPUT) */
/* |||||||| */
/* |||||||+--------------- DATA0 */
/* ||||||+---------------- DATA1 */
/* |||||+----------------- DATA2 */
/* ||||+------------------ DATA3 */
/* |||+------------------- DATA4 */
/* ||+-------------------- DATA5 */
/* |+--------------------- DATA6 */
/* +---------------------- DATA7 */
P0 = 0x00;
P1D = 0xFF; /* 11111111B (1:OUTPUT, 0:INPUT) */
/* |||||||| */
/* |||||+++--------------- No Use */
/* ||||+------------------ LED0 */
/* |||+------------------- LED1 */
/* ||+-------------------- LED2 */
/* |+--------------------- LED3 */
/* +---------------------- LED4 */
P1.0 = 0x00;
P2D = 0xFF; /* 11111111B (1:OUTPUT, 0:INPUT) */
/* |||||||| */
/* ||||||++--------------- No Use */
/* |||||+----------------- SMBus Clock */
/* ||||+------------------ SMBus Data */
/* |||+------------------- EEprom IIC Data */
/* ||+-------------------- EEprom IIC Clk */
/* |+--------------------- No Use */
/* +---------------------- No Use */
P3D = 0x00; /* 00000000B (1:OUTPUT, 0:INPUT) */
/* |||||||| */
/* |||||||+--------------- AN0(Voltage +) */
/* ||||||+---------------- AN1(Voltage -) */
/* |||||+----------------- AN2(POT) */
/* +++++------------------ No Use */
ADCON = 0x00;
/* Set A-D ctrl reg. */
/* 00000000B,ADCON */
/* |||||||| */
/* |||||+++--------------- ANALOG INPUT PIN SELECT */
/* ||||| */
/* ||||| */
/* ||||+------------------ NO USE */
/* |||+------------------- A/D CONVERSION COMPLETION BIT */
/* +++-------------------- NO USE */
enable_interrupt();
}

2004-3-31 13:18 xsx
演示板使用的EEPROM是Microchip 24C01B

2004-4-22 21:32 nssong
这么有深度!不如换电池之前先把这:小样:给焊下来!!

2004-5-15 21:48 xsx
如果不怕锁电池当然可以随便焊

2004-7-6 13:08 qiuming
好文,就是看不懂,难理解,晕倒!

2004-7-9 16:19 jy03k
哗....精彩!!!

我这有一个DELL的电池,用的芯片就是M37515..

在更换电池后出现了( 1.3.5 )这三个灯亮.充满电也是一样..

郁闷....请高手指点..这是怎么回事啊?

2004-7-18 12:43 LHphoenix
好难
要多深的基础才能看懂啊

2004-7-19 00:25 本本维修
[quote]Originally posted by [i]jy03k[/i] at 2004-7-9 04:19 PM:
哗....精彩!!!

我这有一个DELL的电池,用的芯片就是M37515..

在更换电池后出现了( 1.3.5 )这三个灯亮.充满电也是一样..

郁闷....请高手指点..这是怎么回事啊? [/quote]


你的电池原来是用SONY电芯吗?

2004-7-21 15:42 liudegang
请问有IBM A31的电源资料吗

我的A31叫朋友那去开会用,到了会场就开不开机了,电池电源正常,按开机键没有反映,切充电灯也不亮,去哈尔滨找人修了两次也没有修上,因是水货没有质保.我还想修一下.换个主板也行.多谢了!!!

2004-8-23 02:59 csfss
[quote]Originally posted by [i]jy03k[/i] at 2004-7-9 04:19 PM:
哗....精彩!!!

我这有一个DELL的电池,用的芯片就是M37515..

在更换电池后出现了( 1.3.5 )这三个灯亮.充满电也是一样..

郁闷....请高手指点..这是怎么回事啊? [/quote]

我的也是这样啊。听朋友说 1.3.5 这三个灯亮好像是表示电池有故障。

2004-11-4 15:32 aaron80
好贴啊!!就是太复杂!!难看懂啊~

2004-12-3 15:34 cyjun
代码很详细啊,第一次看到这么好风格的厂家代码。

2005-1-18 12:48 rishilee
有人看得懂吗?签签名让DX们PFPF.

2005-1-18 13:16 rogeryin
应该还有Assembly Language的部分吧。。

谢谢啦不过,回家仔细看 :D

2005-1-18 14:20 matthard
不是一般的高深啊..完全看不明白.

2005-1-27 12:50 ilycdl
这是什么意思,完全不懂

2005-2-27 18:09 link22004
看不明白

2005-2-28 23:17 ttnn
好贴!

顶一个

2005-2-28 23:28 ttnn
我看不懂哦

2005-3-3 17:15 ttnn
有什么特殊作用?

2005-3-7 20:37 lee120
少一个m37515.h的代码嘛

2005-3-16 23:45 1400x1050
哈哈哈:D我的天啊!

2005-3-16 23:52 xsx
[quote]Originally posted by [i]lee120[/i] at 2005-3-7 08:37 PM:
少一个m37515.h的代码嘛 [/quote]

m37515.h是MCU的开发平台提供的系统预定义文件,用于声明SFR寄存器。

2005-4-2 20:28 nolinear2000
太专业了点!

2005-4-3 14:50 zhou-top
[quote]Originally posted by [i]jy03k[/i] at 2004-7-9 16:19:
哗....精彩!!!

我这有一个DELL的电池,用的芯片就是M37515..

在更换电池后出现了( 1.3.5 )这三个灯亮.充满电也是一样..

郁闷....请高手指点..这是怎么回事啊? [/quote]
老大,是d600电池吗,我的也坏了一块..

2005-4-3 14:51 pFNT5w4nNv
用的是什么MCU?

我懂点单片机,请问这是什么编码器编的?因为刚买了小黑,所以开始研究。感兴趣中。。。

2005-4-3 14:53 pFNT5w4nNv
晕,写错字了,是什么编译器。

这代码是用于什么编译器呢?

2005-4-3 16:04 lucas12345
看得懂的解释一下嘛!

2005-4-23 18:15 MSC
*** 作者被禁止或删除 内容自动屏蔽 ***

2005-5-20 22:06 libht
天啊  才看懂了电点啊  大部分不太明白

2005-5-21 12:38 新雨星愿
楼主辛苦了,不过俺可是有看没有懂,太高深了,得补补课才能看懂了

2005-5-27 22:45 阿呆
楼上的兄弟,假如没有看m37515 DATESHEET。泥怎么也看不懂。

2005-6-9 13:14 emc2
好深奥呀,不是学这个的,一点都看不懂

2005-6-14 08:20 猛虎
一个字
难~

2005-6-15 18:06 venusian
看不懂,等高人出来

2005-6-23 20:40 ferando
看的头大
楼主要是有可能拿单片机和其他东西做试验,会更直观一点!

2005-6-25 10:52 superqian
路过,只能看看,不是很懂!

2005-6-28 09:53 ljchun
[quote]Originally posted by [i]MSC[/i] at 2005-4-23 18:15:
很经典哦。。。 [/quote]
不错

2005-7-22 15:14 bg2iax
不是一般的高深啊..完全看不明白.

2005-8-14 14:26 电子专家
关键是如何看数据含义 能这样就好了

2005-8-20 15:26 fsclub
好东西.
不过这个代码里面没有提到什么情况下会锁电池?这个是目前最关心,也最想要的.
另外,我发一个M37516的DATASHEET,我的390X电池就是用M37516做控制的.

2005-8-20 15:28 fsclub
第二部分

2005-8-20 15:30 fsclub
第三部分:

2005-8-20 15:32 fsclub
要是有个M37516系列的编译器或者开发套件玩玩就更爽了~~

2005-8-21 17:25 hz31521
看不懂,一点也看不懂,唉,老了

2005-8-28 00:20 草上飞
他咋就这么难呢?

2005-9-17 01:47 cz596
是单片机啊```早知道自己反编译了``

2005-10-27 08:48 htggg
好深啊请问有几个能看懂的

2005-10-27 23:05 ahr
看m37516的datasheet,程序好像读不出来,OTP的,烧写还要150度高温下放40个小时?

2005-10-29 23:38 蝈蝈
COMPAQ N610C的电池会锁死不??有XD换个没有??

2005-11-7 09:53 adaywithoutrain
能把电路原理图也贴上,我来分析一下,我就是写处理器C语言代码;

页: [1] 2


Powered by Discuz! Archiver 5.6.0  © 2001-2006 Comsenz Inc.