:::: MENU ::::
Browsing posts in: Development

코인셀 배터리 사용시 시스템 설계

코인셀 배터리의 경우 용량도 중요하지만 한번에 땡겨서 쓸 수 있는 전류도 중요하다. 하지만 이 값은 일반적으로 충분히 크지 않다.

따라서 코인셀 배터리의 용량만큼 잘 쓰려면

  • 코인셀에 병렬로 cap을 달아라. 47~100uF, 슈퍼캡?
  • 전류소모가 낮은 부품으로 구성 (당연한 얘기)
  • FEP(Functional End Point) 마진 확보 : 즉 구동 전압이 낮은 칩 사용
  • 테스트 결과를 보면 전류를 갑자기 땡기는 구간이 짧아야하고, 휴지기간이 길어야 한다.
  • 시스템을 설계할때 동시에 구동되는 부품을 줄이도록 설계: 즉 RF칩이 TX를 할때 모터를 구동하지 않는 다거나… (LCD, 모터, RF칩, LED) <= 이게 중요할 듯

참고문헌


Hex 파일 합치기

Bootloader 및 Application 펌웨어가 있는 경우 양산시 하나의 파일을 합쳐서 프로그래밍을 하면 1단계가 줄어든다.

Hex 파일 합치기

srec_cat.exe 이라는 윈도우즈 프로그램을 사용하여 다음과 같이 하나의 파일로 합친다.

srec_cat.exe HexFile1.hex -Intel HexFile2.hex -Intel -o MergedHexFile.hex -Intel

인텔 Hex 파일포맷

Record Format

:llaaaatt[dd...]cc
  • : is the colon that starts every Intel HEX record.
  • ll is the record-length field that represents the number of data bytes (dd) in the record.
  • aaaa is the address field that represents the starting address for subsequent data in the record.
  • tt is the field that represents the HEX record type, which may be one of the following:
    00 – data record
    01 – end-of-file record
    02 – extended segment address record
    04 – extended linear address record
    05 – start linear address record (MDK-ARM only)
  • dd is a data field that represents one byte of data. A record may have multiple data bytes. The number of data bytes in the record must match the number specified by the ll field.
  • cc is the checksum field that represents the checksum of the record. The checksum is calculated by summing the values of all hexadecimal digit pairs in the record modulo 256 and taking the two’s complement.

Data Records

:10246200464C5549442050524F46494C4500464C33

This record is decoded as follows:

:10246200464C5549442050524F46494C4500464C33
|||||||||||                              CC->Checksum
|||||||||DD->Data
|||||||TT->Record Type
|||AAAA->Address
|LL->Record Length
:->Colon
  • 10 is the number of data bytes in the record.
  • 2462 is the address where the data are to be located in memory.
  • 00 is the record type 00 (a data record).
  • 464C…464C is the data.
  • 33 is the checksum of the record.

Extended Linear Address Records (HEX386)

Extended linear address records are also known as 32-bit address records and HEX386 records. These records contain the upper 16 bits (bits 16-31) of the data address. The extended linear address record always has two data bytes and appears as follows:

:02000004FFFFFC
  • 02 is the number of data bytes in the record.
  • 0000 is the address field. For the extended linear address record, this field is always 0000.
  • 04 is the record type 04 (an extended linear address record).
  • FFFF is the upper 16 bits of the address.
  • FC is the checksum of the record and is calculated as
    01h + NOT(02h + 00h + 00h + 04h + FFh + FFh).

When an extended linear address record is read, the extended linear address stored in the data field is saved and is applied to subsequent records read from the Intel HEX file. The linear address remains effective until changed by another extended address record.

The absolute-memory address of a data record is obtained by adding the address field in the record to the shifted address data from the extended linear address record. The following example illustrates this process..

Address from the data record's address field      2462
Extended linear address record data field     FFFF
                                              --------
Absolute-memory address                       FFFF2462

Extended Segment Address Records (HEX86)

Extended segment address records-also known as HEX86 records-contain bits 4-19 of the data address segment. The extended segment address record always has two data bytes and appears as follows:

:020000021200EA
  • 02 is the number of data bytes in the record.
  • 0000 is the address field. For the extended segment address record, this field is always 0000.
  • 02 is the record type 02 (an extended segment address record).
  • 1200 is the segment of the address.
  • EA is the checksum of the record and is calculated as
    01h + NOT(02h + 00h + 00h + 02h + 12h + 00h).

When an extended segment address record is read, the extended segment address stored in the data field is saved and is applied to subsequent records read from the Intel HEX file. The segment address remains effective until changed by another extended address record.

The absolute-memory address of a data record is obtained by adding the address field in the record to the shifted-address data from the extended segment address record. The following example illustrates this process.

Address from the data record's address field     2462
Extended segment address record data field      1200
                                             --------
Absolute memory address                      00014462

Start Linear Address Records (MDK-ARM only)

Start linear address records specify the start address of the application. These records contain the full linear 32 bit address. The start linear address record always has four data bytes and appears as follows:

:04000005000000CD2A
  • 04 is the number of data bytes in the record.
  • 0000 is the address field. For the start linear address record, this field is always 0000.
  • 05 is the record type 05 (a start linear address record).
  • 000000CD is the 4 byte linear start address of the application.
  • 2A is the checksum of the record and is calculated as
    01h + NOT(04h + 00h + 00h + 05h + 00h + 00h + 00h + CDh).

The Start Linear Address specifies the address of the __main (pre-main) function but not the address of the startup code which usually calls __main after calling SystemInit(). An odd linear start address specifies that __main is compiled for the Thumb instruction set.

The Start Linear Address Record can appear anywhere in hex file. In most cases this record can be ignored because it does not contain information which is needed to program flash memory.

End-of-File (EOF) Records

:00000001FF
  • 00 is the number of data bytes in the record.
  • 0000 is the address where the data are to be located in memory. The address in end-of-file records is meaningless and is ignored. An address of 0000h is typical.
  • 01 is the record type 01 (an end-of-file record).
  • FF is the checksum of the record and is calculated as
    01h + NOT(00h + 00h + 00h + 01h).

Example Intel HEX File

Following is an example of a complete Intel HEX file:

:10001300AC12AD13AE10AF1112002F8E0E8F0F2244
:10000300E50B250DF509E50A350CF5081200132259
:03000000020023D8
:0C002300787FE4F6D8FD7581130200031D
:10002F00EFF88DF0A4FFEDC5F0CEA42EFEEC88F016
:04003F00A42EFE22CB
:00000001FF

참고

 


충전용 밧데리

Lipo 밧데리

충전용 밧데리로  많이 사용하는 Lipo밧데리는 다음과 같이 불린다.

  • Lithium Ion Polymer
  • Li-Poly
  • LiPoly
  • LiPo

밧데리 전압

일반적으로 3.7V이며, 4.2V 도 있음. 그런데 충전을 해보니 3.7V라고 쓰여진 제품도 완충되면 4.2 정도까지 전압이 나온다.  중요한 것은 아래 그래프처럼 최대 4.2V에서 3.7V를 유지를 하다가 3.4V가 되면 밧데리를 더 이상 사용이 안되고, 3.0V가 되면 컷오프 회로가 작동을 해서 회로를 끊어버린다.

The voltage starts at 4.2 maximum and quickly drops down to about 3.7V for the majority of the battery life. Once you hit 3.4V the battery is dead and at 3.0V the cutoff circuitry disconnects the battery.

 

주의할 점

  • 허용 전압 이상(4.2V) 으로 충전 금지
  • 허용 전압 이하(3.0V)까지 방전 금지
  • 허용 전류 이상으로 충전 금지
  • 허용 온도 스펙 (0~50도)에서만 충전 및 사용
  • 밧데리 팩을 직렬, 병렬 연결 금지 <== 이런 것은 공장에서 각 배터리의 전압차를 기계로 잘 맞춰서 만든다고 한다.

참고 문서https://learn.adafruit.com/li-ion-and-lipoly-batteries?view=all


태양광 충전

태양광 패널

태양광 패널에서 생성된 전력을 충전회로를 통해 밧데리에 충전을 한다. 일반적으로 태양광 패널은 6V, 12V이다. 관련한 솔루션을 찾아보니 한 3가지 정도가 나온다.

Dual Power 입력의 처리

MAX1551같은 칩을 사용하거나. 다음과 같이 처리하면 첫번째 파워가 연결이 됐을 경우 2번째 파워를 통한 입력을 막을 수 있다.

A P-channel MOSFET, M1, is used to prevent back conducting into the 2nd power supply when the 1st power supply is present and Schottky diode, D1, is used to prevent 2nd power supply loss through the 1kΩ pull-down resistor.

 



LED 회로 주의점

각  LED의 최대 전류를 넘으면 안됨. 하지만 각 LED 소자의 Forward Voltage가 조금씩 다를 수 있기 때문에 각각의 LED에 저항을 달으라는 이야기.




OpenSDA 인터페이스

OpenSDA는 open-standard 시리얼 디버거 어댑터로 MSD Bootloader 및 USB CDC기능을 가진다.

NXP, Freescale사의 보드의 경우 P&E micro사의 솔루션이 들어가 있는데 보드에 오래된 bootloader가 들어가 있으면 업데이트를 해야하며 다음과 같은 순서로 업데이트를 한다. 어떤 OS에서는 캐쉬기능 때문에 파일을 넣어도 write가 안된 경우도 있고, Windows8, Windows 10에서 문제가 있다고 하기도 함.

  1. Unplug the USB cable (if attached).
  2. Press and hold the Reset button.
  3. Plug in a USB cable from a USB Host to the OpenSDA USB port.
  4. Release the RESET/Bootloader button.
  5. A removable drive will be visible in the host file system with a volume label of BOOTLOADER.

보드의  LED는 다음과 상태값을 가진다.

참고

https://mcuoneclipse.com/2014/11/01/illustrated-step-by-step-instructions-updating-the-freescale-freedom-board-firmware/
https://mcuoneclipse.com/2016/06/26/how-to-recover-the-opensda-v2-x-bootloader/



Pages:1234567...23