Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Interfacing microcontroller with TM1638

Status
Not open for further replies.

khaleel.arya

Junior Member level 2
Junior Member level 2
Joined
Apr 10, 2015
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
INDIA
Activity points
155
Hi,

what would be the clock frequency i need to give in order to communicate with TM1638?



Regards,
khaleel
 

Hi srizbf,

compiler:MPLABC30\v3.31
IDE:MPLAB V8.88
controller:dspic30f5011


I'm trying to communicate my controller with TM1638. As a first step i'm throwing some data on LEDs throgh SPI protocol.unfortunately i'm unable to get data on display.

The bits i have configured for clock polarity and phase are

SPI2CONbits.CKP = 1; // Idle state for clock is a high level, active state is a low level
SPI2CONbits.CKE = 0; // Serial output data changes on transition from Idle clock state to active clock state
SPI2CONbits.SMP = 0; // Input data sampled at middle of data output time
here is my writing sequence
CS = 0; // Enables communication
DelayTcy(2);
WriteSPI2(0x44); // Data Command Set with Write data Mode and fixed Address
DelayTcy(10); // delay of 1us
CS = 1; // Disables communication
DelayTcy(10); // delay of 1us
CS = 0; // Enables communication
WriteSPI2(0xC0); // Set the Display Adress initial 0x00
DelayTcy(10);
WriteSPI2(0x3F); // Transmission of Data '0'
DelayTcy(10);
CS = 1; // Disables communication
DelayTcy(10);
CS = 0; // Enables communication
WriteSPI2(0x8F); // Brightness Control
DelayTcy(10);
CS = 1; // Disables communication
Is every thing fine with my configuration and writing sequence or any changes need to made?
 

where is 'STB' of TM1638 controlled in yours?
 

CS(chip select) of my controller is connected to STB
 

the sequence seems to be correct.
do you send 'display on ' command anytime afterwards?
 

WriteSPI2(0x8F); // Brightness Control and Display ON

This function makes the display ON and controls the brightness of display.
 

Hi,

Now, I'm able to display data on 7-segment LEDS. The mistake here is, my write function sends MSB first, but according to TM1638 we have to send LSB first.I have made the changes and it is working.

Regards,
khaleel.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top