Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - fagci

Pages: [1]
1
TFTs / Re: ft5316 firmware
« on: January 27, 2015, 12:34:09 PM »

2
TFTs / ft5316 firmware
« on: January 25, 2015, 01:16:52 PM »
Hello!
I have ft6316 touchscreen contholler, close to ft5306, but wake pin used as WAKE/INT.
I tried to read/write some data from EEPROM, but no success.

I using arduino pro mini with following code:
Code: [Select]
#include <Wire.h>

#define DEV_ADDR 0x38
#define WAK_PIN 4
#define VCC_PIN 3
#define RST_PIN 2

#define FACTORY_MODE 0x40

void init_device(){
  digitalWrite(RST_PIN, HIGH);
  digitalWrite(VCC_PIN, LOW);
  digitalWrite(WAK_PIN, LOW);
 
  digitalWrite(VCC_PIN, HIGH), delay(100);
  digitalWrite(WAK_PIN, HIGH), delay(100);
  //digitalWrite(RST_PIN, HIGH), delay(100);
}

void test_device(){
  wr(0x00,FACTORY_MODE);
  delay(300);
  for(unsigned char i=0x00; i<0xFF; i++){
    Serial.print(i);
    Serial.print(": ");
    rr(i);
    Serial.println(" ");
  }
}

void setup(){
  Wire.begin();
  Serial.begin(9600);
  pinMode(VCC_PIN, OUTPUT);
  pinMode(RST_PIN, OUTPUT);
  pinMode(WAK_PIN,OUTPUT);
  init_device();
  test_device();
}

void loop(){}

void rr(unsigned char reg) {
  Wire.beginTransmission(DEV_ADDR);
  Wire.write(reg);
  assert(Wire.endTransmission(DEV_ADDR));
  //Wire.beginTransmission(DEV_ADDR);
  Wire.requestFrom(DEV_ADDR, 128);
  while(Wire.available()) Serial.print(Wire.read(),HEX);
  //assert(Wire.endTransmission());
}

void wr(unsigned char reg, unsigned char val) {
  Wire.beginTransmission(DEV_ADDR);
  Wire.write(reg);
  Wire.write(val);
  assert(Wire.endTransmission(DEV_ADDR));
}

void assert(int e){ if(e){ Serial.print("[E");Serial.print(e);Serial.print("]"); } }

And I got only zeroes in any way  :(

Help me please to flash this controller by firmware, which I have..

Datasheet: https://drive.google.com/file/d/0By7QfrffBV76T2o5S2dheGtKdXM/view?usp=sharing

Michael L, probably I have this problem due to improper initialization?

Pages: [1]