Jump to content
Sign in to follow this  
infrared

SPI/Microwire LCD segment driver interface?

Recommended Posts

Background: MSP430G2231 Launchpad CCSv4. Interface for LCD segment driver ic (PT6523).

http://www.43oh.com/forum/viewtopic.php?f=9&t=164#p3161 here is some more information in this post and in the thread.

 

I have three wires: Chip enable (chip select), Data Input and Clock. (another pin enables and disables the ic's lcd output)

 

After some c samples I can not get the lcd to even show junk data. Bit banging should work but without a scope I can not see levels on the driver ic. I have tried this at 3.5 volts and 5.0 volts.

 WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
 P1OUT = 0;
 P1OUT |= 0x02;
 P1DIR |= 0x02;
 USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE; // Port, SPI Master
 USICTL1 |= USICKPH + USIIE;               // Counter interrupt, flag remains set
 USICKCTL = USIDIV_4 + USISSEL_2;          // /2 SMCLK
 USICTL0 &= ~USISWRST;                     // USI released for operation
 USICNT = 8;                               // init-load counter

 

what now?

Share this post


Link to post
Share on other sites

First thing you should try is to slow down the SPI clocking frequency.

 

If I read your code correctly, the SPI is running at 500kHz (SMCLK/2).

 

That means that your MCLK=SMCLK=1MHz because you are not configuring it otherwise.

 

The datasheet says that the Fosc range is [19..76]kHz but typically 38kHz. That's the same speed as the ACLK when you have the 32.768kHz crystal installed.

 

Then, you should fire a repeating data byte of 0xAA or 0x55 at the display. That should give you an alternating bit pattern on the screen. I don't know what the LCD glass patterns are so I am assuming that it has a dot matrix pattern.

Share this post


Link to post
Share on other sites
First thing you should try is to slow down the SPI clocking frequency.

 

Then, you should fire a repeating data byte of 0xAA or 0x55 at the display. That should give you an alternating bit pattern on the screen. I don't know what the LCD glass patterns are so I am assuming that it has a dot matrix pattern.

 

It's a segment display from a car stereo, so fixed segments.

 

And the last four bits of the data part (control bits) should optimally be either 0b0000 or 0b1000.

 

And just to check, you do have the /INH pin on the lcd ic driven high, correct? Otherwise, the lcd will not display anything, even if you have proper data.

Share this post


Link to post
Share on other sites

I appreciate the quick replies. Was wondering how I give you both thanks in the forums but can not find the button on the post. Maybe I do not have enough post yet???

 

Well I do not have the 32khz xtal soldered to the board for ACLK so I will do that. ACLK needs calibration? or is that if you decide to fiddle with the cap trimming (ie for different xtal/lco). I did check out the fosc in the datasheet. That surprised me, being that most spi peripherals operate at any clk. For example the fomec lcd's can be driven up past 50mhz. but i digress

 

USICKCTL = ACLK = LFXT1 = 32768;

 

what would be the correct syntax?

 

USICKCTL=ACLK + DIVA1; I am confused and really need a better understanding of the clocks mnemonics and registers (USI still has me on the learning curve for implementing a half duplex 2.5 wire serial bus).

 

The good thing is that I am good with c and can follow the examples. Also, I am just a 3rd year business and first year cse student @ UTA.

Share this post


Link to post
Share on other sites

Well, at 1mhz running clock, if you need a ~38khz spi clock, dividing the smclk by 32 would give 31.25khz. Dividing by 16 would give 61khz which is also within the ic's operating speed.

 

That said, with USIDIV_4, that should be divide by 16. (_0 = Divide by 1, _1 = by 2, _2 = by 4, _3 = by 8, _4 = by 16, etc to 7)

http://focus.ti.com/lit/ug/slau144f/slau144f.pdf

Share this post


Link to post
Share on other sites
I appreciate the quick replies. Was wondering how I give you both thanks in the forums but can not find the button on the post. Maybe I do not have enough post yet???

Everybody should have access to the "thanks" function. It's the little "thumbs up" icon at the upper right of the post, next to the quote button. Once you click it, it will change to a "thumbs-down" icon, to remove the thanks (in case you clicked it in error). When someone has been thanked for a post, those who gave the thanks are listed at the bottom of the post.

Share this post


Link to post
Share on other sites

nope no thumbs or quote button... maybe its disabled in prefs...

 

USICKCTL = USIDIV_5 + USISSEL_2; // divide by 32 using smclk @1mhz

 

I am sure this is the proper clock rate.

 

so after I set up the USI I will need to loop with a delay. In the loop I will check the register and if empty fill it; Pull CS high then start clking data out. reload register then repeat while loop?

Share this post


Link to post
Share on other sites
nope no thumbs or quote button... maybe its disabled in prefs...

I don't think that you can disable those in prefs. :? Can you post a screenshot of this post so we can see what it looks like on your machine?

Share this post


Link to post
Share on other sites

I'm completely off topic but ...

 

Here. I thanked you for the last post.

 

Does that activate the thumbs up stuff now?

 

Maybe it's a database initialization thing?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...