tiny85 & PCF8566T

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

strange problem.

I use an arduino usb with tiny85 and make a board with PCF8566.

I analyse I2C message with a scana from iKalogic. 

message from I2C are ok and get ack +++

lcd turn on when I send the initialisation but after stopp and do not accept value for the display.

But I2C are ok, value for display get ack for each byte.

I use the with a 1:4 display ( 4 backplane) 

 

my code for arduino

#define DRIVER_ADDR 0x3E  // 7 bit add

#define PCF_CONTINUE (1 << 7)

#define PCF_CMD_SET_MODE ((1 << 6))
#define PCF_MODE_LOW_POWER (1 << 4)
#define PCF_MODE_ENABLE (1 << 3)
#define PCF_MODE_HALF_BIAS (1 << 2)
#define PCF_MODE_THIRD_BIAS 0
#define PCF_MODE_MULTIPLEX_4 0 // Multiplex 1:4
#define PCF_MODE_STATIC 1


#include <TinyWireM.h>                  // I2C Master lib for ATTinys which use USI


// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  //pinMode(0, OUTPUT); //LED on Model B
  pinMode(1, OUTPUT); //LED on Model A
  pinMode(2, INPUT_PULLUP); //TWI
  pinMode(0, INPUT_PULLUP); //TWI
   
  TinyWireM.begin();                    // initialize I2C lib
  delay(1000);
   
}


// the loop routine runs over and over again forever:
  char start=0;
void loop() {

  if ( start ==0 )  // do one not in the init wait power stable
  {
    start =1;
  TinyWireM.beginTransmission(DRIVER_ADDR);
  TinyWireM.send(0x60 |PCF_CONTINUE);     // subadd device
  TinyWireM.send(0x48 |PCF_CONTINUE );    // enable driver 1:4
  TinyWireM.send(0);                      // clear pointer
  TinyWireM.endTransmission();            // Send 1 byte to the slave 
  
  }
  digitalWrite(1, HIGH);      // drive led high
  delay(1000);               // wait for a second

  TinyWireM.beginTransmission(DRIVER_ADDR);
  TinyWireM.send(0x60 |PCF_CONTINUE);   //  subadd device
  TinyWireM.send(0x00);                 //  clear pointer
   for (int i = 0; i < 12; i++) {       // send 12 byte 24 x 4 
        TinyWireM.send(0xaa);
        delay(10);
      }
  TinyWireM.endTransmission();  

  digitalWrite(1, LOW);     // drive LED low
  delay(1000);               // wait for a second
  
  TinyWireM.beginTransmission(DRIVER_ADDR);
  TinyWireM.send(0x60 |PCF_CONTINUE);                 // 
  TinyWireM.send(0x00);           
  for (int i = 0; i < 12; i++) {
         TinyWireM.send(0x55);
        delay(10);
      }
  TinyWireM.endTransmission();  
}

the clock output from PCF8566 is ok , Vlcd is set to gnd,

Try with -3V same problem, get some seg on a short time. 

 

thank you for help! 

Attachment(s): 

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When troubleshooting I2C first put everything into spec.  Don't trust the AVR internal pullups.  They can be high values like 50K ohms. The specification is 3-5K ohms.  At the higher resistance, the SCL and SDA falling edges go to ground immediately when asserted, but may rise too slowly when released.

 

Next make a test program that has everything removed except the minimal code needed to show that a focused test point is responding to precise input.  Remove stuff like // drive LED low and //wait a second.  Does this have anything to do with the LCD driver IC?  If not, comment it out.   Make simple tests that change one LCD IC param at a time.   When all else fails and you absolutely have to use an LCD display for battery-conserving reasons, then try your application with a Nokia 5110 screen.  These screens work, they're super cheap, and there is a lot of code written for them in Arduino.  Have you looked for Arduino libraries for this PCF8566 IC?   How do the functional libraries compare to your code?  Can you get your PCF8566 working with a downloaded Arduino library for this IC?

 

What do you mean by "Try with -3V same problem...."?   I don't see any -3V or any negative voltage on the schematic.    Some schematic programs 'hide' the voltage lines.  Avoid these programs.  They are a leftover from the 1970s when people would make CPUs using hundreds of TTL chips with interconnecting wires.   A 21st-century schematic shows every pin on every chip and every power supply connection.

Last Edited: Tue. Jun 21, 2016 - 07:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have connected -3V on the Vlcd extern battery to try. for testing.

 

Not sure at lib arduino is support for this smal usb arduino, set example from arduino and used this for my program.

 

ps. pullup? I have extern 4K7 pull up on the board! 

But 

after analyse the I2C signal it seam some strange pulse end of the some byte, i teori , it will not affect but will try my code with another test board. 

Thierry

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello 

 

Many thanks, this example helps me a lot :D

 

Regards.