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.

interfacing controller with TM1638(LED DRIVER)

Status
Not open for further replies.

khaleel

New Member
Hi,

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


I'm trying to communicate my controller with TM1638. As a first step i have thrown some data on LEDs through 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?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top