• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

633 Temp Sensors / Flash Problem

EddieShen

New member
Hi...

I currently have written a new Image to my lcd633. Firmware v1.9, Hardware v1.5a using command 4. WIth this, I believe I have changed startup fan speeds, GPIO settings, as well as teh LCD display.All other things were left default.

I modified GPIO[0], GPIO[1], GPIO[2], GPIO[3] to user input, as I do not need ATX functions, etc.

However, after this, I can only detect 3 temperature sensors max no matter how many I daisy chain together. I have verified this with your 633 sample test as well as my own.

I coincidentally have tested it on another 633, and have broken it seems as well...

have you guys had any issues with this before? Is there a factory default reset? Thanks!

--Eddie
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Tech

Administrator
Please take a look at the CFA-633 data sheet, specifically at the note in section "18: Read DOW Device Information". That note gives the command that would be needed to set the GPIO for the DOW pin to the correct settings.
 

EddieShen

New member
reset option

I was wondering if theres any jumpers i could short to reset to factory settings if you can't figure out what is going wrong? I produced a new lcdImg program which does not appear to crash the program....

I have listed my code below... I know its not optimized in anyway but I just want it to work....

The BROKEN code is as follows:
Code:
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "typedefs.h"
#include "serial.h"
#include "635_packet.h"
#include "show_packet.h"
#include "635lib.h"

// Revision Status
#define VERSION "0.01"

int main(int argc, char* argv[])

{
  int fd_sio;
  char *LCDDevice;

  union
  {
    unsigned int power;
    unsigned char power_bytes[4];
  } Power;
  Power.power_bytes[0]=100;
  Power.power_bytes[1]=100;
  Power.power_bytes[2]=100;
  Power.power_bytes[3]=100;

  if ( argc > 1 ) LCDDevice = *++argv;
  else LCDDevice = "/dev/ttyS1";
  fd_sio = Serial_Init( LCDDevice, 19200 );

  setGPIO( 0 );
  setGPIO( 1 );
  setGPIO( 2 );
  setGPIO( 3 );

  clearDisplay();
  printLCD(0,0," sdsdfgkjhkgjg ");
  printLCD(1,1,"    startup     ");
  enableFanReport( 0x0003 );
  enableTempReport( 0x000F );
  setFanPower(Power.power);

  setGPIO( 0 );
  setGPIO( 1 );
  setGPIO( 2 );
  setGPIO( 3 );

  usleep(250000);
  imageBoot();
  usleep(500000);
  resetSelf();
  return 0;
}
the WORKING code is as follows:
Code:
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "typedefs.h"
#include "serial.h"
#include "635_packet.h"
#include "show_packet.h"
#include "635lib.h"

int main(int argc, char* argv[])

{
  int fd_sio;
  char *LCDDevice;

  union
  {
    unsigned int power;
    unsigned char power_bytes[4];
  } Power;
  Power.power_bytes[0]=100;
  Power.power_bytes[1]=100;
  Power.power_bytes[2]=100;
  Power.power_bytes[3]=100;

  if ( argc > 1 ) LCDDevice = *++argv;
  else LCDDevice = "/dev/ttyS1";
  fd_sio = Serial_Init( LCDDevice, 19200 );

  setGPIO( 0 );
  usleep(30000);
  setGPIO( 1 );
  usleep(30000);
  setGPIO( 2 );
  usleep(30000);
  setGPIO( 3 );
  usleep(30000);
  
  outgoing_command.command = 34;
  outgoing_command.data[0] = 4;
  outgoing_command.data[1] = 100;
  outgoing_command.data[2] = 7;
  outgoing_command.data_length=3;
  send_packet();
  usleep(30000);

  clearDisplay();
  usleep(30000);
  printLCD(0,0," asdfghjkhghg ");
  usleep(30000);
  printLCD(1,1,"    startup     ");
  usleep(30000);
  enableFanReport( 0x0000 );
  usleep(30000);
  enableTempReport( 0x0000 );
  usleep(30000);
  setFanPower(Power.power);

  usleep(250000);
  imageBoot();
  usleep(250000);
  clearDisplay();
  printLCD(1,1,"     Done!      ");
  return 0;
}
Assume all the function calls work unless you can't seem to figure it out still... I guess I will post them then...

One thing I noticed that was different about the 2nd (working) program is that I added delays in between some commands that might take more than a trivial amount of time (GPIO change). I do not wait for an incoming packet, so perhaps the queue was filled, but if that were the case it would just lead to dropped packets not data corruption right? Hope this helps because I somewhat need an answer soon... thanks for all the help so far!

--Eddie
 

EddieShen

New member
might as well post the functions....

I realized some function calls are not very intuitive so I decided to post some functions after all =)
Code:
void setGPIO(int gpio)
{
  outgoing_command.command = 34;
  outgoing_command.data[0] = gpio;
  outgoing_command.data[1] = 0;
  outgoing_command.data[2] = 10;
  outgoing_command.data_length=3;
  send_packet();
}

void imageBoot()
{
  outgoing_command.command = 4;
  outgoing_command.data_length=0;
  send_packet();   
}

void printLCD(int row, int col, char data[])
{
    int length = 2 + strlen(data);
    if (length + col > 22)
      length = 22 - col;
    outgoing_command.command = 31;
    outgoing_command.data[0] = col;
    outgoing_command.data[1] = row;
    memcpy(&outgoing_command.data[2], data, strlen(data));
    outgoing_command.data_length=length;
    send_packet();
}
 

EddieShen

New member
Unfortunately....

It seems as though 3 temp senors max can be detected even after the flash... how should I be fixing it now?... There must be something illegal in my code....
 
USB LCD Displays - Graphic and Character LCDs with a Keypad

CF Tech

Administrator
I dono. You can write support at crystalfontz dot com (edit to '@' & '.') and request an RMA. We will get it sorted on this end.

Please include a link to this thread in your request.
 
Top