??? 07/13/04 08:05 Read: times |
#74144 - RE: battery check Responding to: ???'s previous message |
Hi Farhan,
What exactly do you want to do ? 1. Check the Serial Port at power ON: Case 1: You want to see if there is any byte recieved on the Serial Port during the boot time: In this case, you have to initialize the serial port (preferrably with the interrupt) first (at the begining of the Booting Time). Write your Serial Interrupt ISR to store values in the recieve buffer. Have a Serial Byte Counter to count the number of bytes recieved in the Interrupt ISR; update this byte in the ISR. After Boot time, just check the value of this counter, it will tell you how many bytes have been recieved during the Booting Time, and the recieved bytes will be there in the Recieve buffer. Case 2: You want to know if any (known or unknown) device is connected to the Serial Port. In this case you can either use the hardware handshake signals such as RTS/CTS, DTR/DSR; Or the second method is by sending some known information packet (series of bytes) or a single byte to which the connected device responds. If the device responds then it is physically connected, else it is not. 2. Want to check the battery at boot time: Case 1: You want to know if battery is connected. In this case use a comparator which will have one input as the reference voltage and the other input as the battery voltage, The output of the comparator to any of the input pins and poll this pin and it will tell you whether battery is connected or not. Case 2: You want to know how whether battery charge is good. Here again there are 2 ways: 1. The same as above (using a comparator), in this case you will have to adjust the reference to the comparator; 2. Give the Battery voltage to the ADC (by stepping down, etc) and read out the value of the ADC, this will just tell you the voltage of the Battery, but not how much charge is left in the battery, specifically for the NiMH and NiCD batteries. To find out how much charge is left in the battery, I dont think there is any method of doing so (I am not an expert in batteries, but many members in this forum ARE, they will definitely respond to this post, just keep a watch in this thread). Bye, Mr. Kiran V. Sutar. |
Topic | Author | Date |
battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
RE: battery check | 01/01/70 00:00 | |
message check | 01/01/70 00:00 | |
Step back...![]() | 01/01/70 00:00 |