Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Library for TM1651 (Oshonsoft Basic).

DogFlu66

Member
Hello,
I've been searching for PCBs that include the TM1651 to carry out practical exercises, but it seems that the only available product is an LED battery level indicator that uses the TM1651.

The TM1651 integrated circuit allows controlling 4-digit 7-segment displays and reading up to 6 keys. Writing the library for this chip has been particularly easy because it is similar to the TM1637. Therefore, I adapted the library I previously wrote for the TM1637 to work with the TM1651.

I removed all the functions related to digit control and key reading, and then implemented specific functions to control the LEDs included on the PCB.

I am sharing all the necessary files to experiment with the TM1651-based battery level indicator for a while.

TM1651 Library:

TM1651_Init()
Initialize the TM1651.
TM1651_OutSeg(Seg As Byte, sBit As Bit)
Outputs data to a specific segment of the display (0 to 6, On/Off bit).
TM1651_Clear()
Clears all segments of the display, turning them off.
TM1651_Full()
Turns on all segments of the display.
TM1651_Bright(Bright As Byte)
Adjusts the brightness of the display (0 to 7).

TM1651 Mini Battery Display.jpg
 

Attachments

  • Test TM1651.bas
    1.9 KB · Views: 6
  • _TM1651Lib.bas
    5.4 KB · Views: 6
  • _Pic18F46K22Lib.bas
    43.4 KB · Views: 7
It seems that they are compatible, but for the TM1651, I have only found a battery level PCB that uses it. On the other hand, for the TM1637, it is possible to find PCBs with different key and digit configurations.
 
It seems that they are compatible, but for the TM1651, I have only found a battery level PCB that uses it. On the other hand, for the TM1637, it is possible to find PCBs with different key and digit configurations.
Well the TM1637 is a larger chip, so has more capabilities, it's probably only worth using the TM1651 for a small application like the battery display. Why not use the 37 instead?, presumably the software is very little different. I've got a couple of different TM1637 boards, and have used them with PIC's using XC8.
 
They seem to be the same. But I can't prove it 100%.

The initial configuration is the same and the memory address of the first output byte is the same. The brightness has the same levels and memory address, which are the only functions you can test, later I will compare the datasheets in detail.
 
Last edited:
They seem to be the same. But I can't prove it 100%.

The initial configuration is the same and the memory address of the first output byte is the same. The brightness has the same levels and memory address, which are the only functions you can test, later I will compare the datasheets in detail.
Should be easy then to make a library that covers them both?.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top