CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

driving of module

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

driving of module
PostPosted: Tue May 17, 2005 3:24 am     Reply with quote

Hello,

http://expand.xs4all.nl/uploadarchief/download.do?file=CELL_V6_15.pdf

This is the datasheet of the module I need to drive (it is a braille-cell - makes blind people able to read).

I wanted to know if I can use the SPI module for driving this? And if yes, what is the configuration of it?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue May 17, 2005 5:40 am     Reply with quote

Your circuit uses 10 data bits while SPI uses 8 data bits, this makes it impossible to use SPI.

Writing your own function to output this data is very easy:
Code:

#define CLOCK_PIN   PIN_B1
#define DATA_PIN    PIN_B2
#define STROBE_PIN  PIN_B3

write_braille(int16 Data)
{
  int8 i;

  for (i=0; i<10; i++)
  {
    // Output data bit
    if ( bit_test(Data, i) )
      output_high(DATA_PIN);
    else
      output_low(DATA_PIN);
   
    delay_us(1);

    // Clock pulse
    output_high(CLOCK_PIN);
    delay_us(1);
    output_low(CLOCK_PIN);
  }

  // Strobe pulse
  delay_us(1);
  output_high(STROBE_PIN);
  delay_us(1);
  output_low(STROBE_PIN);
}

main()
{
  // Initialize outputs
  output_low(CLOCK_PIN);
  output_low(DATA_PIN);
  output_low(SROBE_PIN);
 
  write_braille(0x101);
  write_braille(0x102);
  write_braille(0x103);

  while(TRUE)
    ; // loop forever
}
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue May 17, 2005 6:51 am     Reply with quote

heel erg bedankt! I'm sure I can use this.. The only thing is that I don't really know how to drive the cells :-s
The producer gives very few information
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group