⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 这个开发机器人项目源码
💻
字号:
$Id: README,v 1.10 2003/09/13 07:16:03 dwalters Exp $-- Open Automaton Project: http://oap.sourceforge.net -- POWER MANAGEMENT MODULE INTRODUCTION------------------------------------This README covers the source code and circuit schematics for the Open Automaton Project Power Management Module.The Power Managment Module is a hardware device that controls the power sourceto the robot's main 12V rail (either main battery, or external), and alsocontrols the signal to initiate battery charging. This module is also responsible for continuously monitoring the main battery voltage, and thevoltage of the external power source. All communication between this module and the robot's mainboard is via the I2C interface using the SMBus protocol.The circuit schematic (power_management_module.sch) was developed in gschem, part of the gEDA package, version 20030525.Circuit schematic symbols that are not in the symbol library bundled with gEDAare included as separate sym files (these .sym files can be copied into yourlocal symbol directory, typically /usr/local/share/gEDA/sym/local/).LICENSING---------All source code and electronic circuit designs are copyright (C) 2003, Dafydd Walters.The Open Automaton Project software is distributed under the terms of the GNUGeneral Public License. See the file COPYING.SOFTWARE for details.Please see the file COPYING.ELECTRONICS to see the terms under which theelectronic circuit designs of the Open Automaton Project are distributed.CIRCUIT NOTES-------------When assembling this circuit, it is essential to use heavy gauge wiring andwide circuit board tracks for all of the 12V DC and GROUND runs. This is because of the high currents drawn (up to 5 Amps). Thin wires will get hotand will cause undesirable voltage drops, not to mention that inadequatewire gauge for these kinds of currents is a potential fire hazard.OPERATION NOTES---------------This module operates autonomously, and is not dependent on communication withthe host mainboard to perform power management operations. The host interfaceprovides supervisory functions to allow the mainboard to monitor the stateof the power management module, and to set its configuration (stored in nonvolatile EEPROM). Full details of the host SMBus interface is provided inthe next section.The power management module (PMM) monitors the state of three microswitches,each connected to one of the electrical contacts that mate with the Docking Station. These microswitches are closed when the robot is docked in the charging position.When the microswitch closures are sensed, the Power Management Module initiatesthe charging sequence as follows: 1. Instruct the Docking Station to supply the external 12V DC power supply. 2. When the external 12V supply is stable, switch the robot's main power    rail from the on-board battery to the 12V external supply, leaving the    battery open circuit (no load). 3. Close the circuit from the battery to the charger terminals. 4. Instruct the Docking Station to start charging the battery.The PMM sends instructions to the Docking Station via infrared, using amodified version of the Sony IR remote control protocol.The LEDs signal the following states:  - LEDs off: Not charging. - Green LED on: Charging sequence active. - Red LED on: Error condition.SMBUS INTERFACE---------------This module is a slave on the I2C SMBus, with the fixed address 86(the address can be changed by modifying the source code and re-compiling).The device responds to the following host (master) commands:Read Byte Data, Command = 1: Report battery voltage to host, as raw 8-bit                              ADC bitcount (one data byte).Read Byte Data, Command = 2: Report external supply voltage to host, as raw                              8-bit ADC bitcount (one data byte).Read Byte Data, Command = 3: Report charger voltage to host, as raw 8-bit                              ADC bitcount (one data byte).Read Byte Data, Command = 4: Report current state to host (one data byte)                             0 = reset; transient state; about to enter state 1                             1 = waiting for microswitches to close,                             2 = waiting for good external supply,                             3 = charging,                             4 = error.Read byte Data, Command = 5: Report error code to host (one data byte)                             1 = error waiting for good ext. supply in state 2,                             2 = battery not charging in state 3.Read byte Data, Command = 6: Report state of microswitches (one data byte)                             bit 0 = charging voltage docking microswitch,                             bit 6 = external supply docking microswitch,                             bit 7 = ground docking microswitch.                             When bit is 1, microswitch is open.                             When bit is 0, microswitch is closed (pressed).                             Unused bits are 0.Read Byte Data, Command = 7: Report good external supply voltage threshold to                             host, as raw 8-bit ADC bitcount (one data byte).Write Byte Data, Command = 100: Set good external supply threshold voltage in                                 raw 8-bit ADC bitcounts (one data byte). Module                                stores this value in nonvolatile EEPROM.PEC (Packet Error Checking) is disabled for all SMBus commands.Reading the error code (command 5) has the secondary effect of resetting theerror condition, returning the PMM to state 1 (waiting for microswitches toclose).CIRCUIT NOTES-------------The IR LED is a high output device (100mA forward current at 1.2V) emitting16mW of radiant power.FIRMWARE NOTES--------------The software for the PICMicro is written in assembly language, and compiles using the GNU PIC Assembler, gpasm. To compile the source code into a hex file suitable for programming a PIC16F819 device, type    gpasm -n power_management_module.asmThe resulting hex file will be called power_management_module.hex  The -n option puts DOS-style CR-LF newline sequences in the .hex file, required by most device programmers. It also compiles with the MPASM compiler for Microsoft Windows that is a partof the MPLAB suite from Microchip. However, you must make sure the assembly(.asm) file is in Windows/DOS format (i.e. with CR-LF sequences at the end ofeach line) before it will successfully compile in MPASM for Windows.Some device programmers require the configuration bits to be set manually. Itis very important that these are set correctly. The Power Management Modulerequires the following configuration bit settings: - Flash Code Protection off - CCP1 on RB3 - In-circuit Debugger disabled - Flash write enable off - EE Code Protection off - Low Voltage Programming Enable off, RB3 is I/O - Brown-out Reset Enable on - RA5/MCLR pin function is digital I/O - Power-Up Timer on - Watchdog Timer off - Oscillator: INTRC, port I/O function of RA6 and RA7The above configuration settings are represented by the configuration word2F50 in hexadecimal.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -