Recent Posts

Pages: 1 ... 8 9 [10]
91
Character LCDs / Re: NHD-0420D3Z - Arduino I2C Address 0x28 SOLVED
« Last post by andywb on August 11, 2018, 01:24:36 AM »
If you read the NHD data carefully it does imply 0x50 is an 8 bit value with the lowest bit set to zero:-

"The default I2C address is 80 (50 hex). The I2C address can be changed to any 8-bit value by command
function, with the exception that the LSB (least significant bit) must always be '0'."


0x68 on the DS3231 is a seven bit address to which you have to add the read or write bit. You can use this directly in the Wire library as Wire adds the read/write bit.

The I2C call on the Parallax stamp uses an 8 bit address, Wire on the Arduino uses a 7 bit address and shifts it left.

On the Arduino you therefore have to convert the 8 bit NHD display address 0x50 given in the data sheet to 0x28 before you send it to the wire library. Wire will restore the address to 0x50 for transmission.

I should have realised this because when I looked carefully into my old PBasic Code I declared all the addresses in set up but on the call to the sub routine which reads the clock I found a shift left with a comment about this.

Other tips to save you reading additional threads - The NHD display cannot be powered from the Arduino 5v when the Arduino is powered from USB as the 5v supply falls to 4.69v. Maximum clock rate has been de-rated by Newhaven to 50KHz. Use Wire.setClock(50000L) after Wire.begin to reduce the clock rate. If you do not reduce the clock rate the display misses characters.

Update 14/08/2018 - The Wire page has a note about the 7 bit and 8 bit addresses which somehow I missed https://www.arduino.cc/en/Reference/Wire
92
Character LCDs / NHD-0420D3Z - Arduino I2C Address 0x28 SOLVED
« Last post by andywb on August 07, 2018, 02:05:55 AM »
I have a project which uses these displays and was originally based on a Stamp BS2pe. The display worked well at address 0x50 using the BS2. I now have the display working with the Arduino Uno. I have reduced the clock rate to 50kHz and made sure the pull ups are above 10k as mentioned in post https://www.newhavendisplay.com/NHD_forum/index.php/topic,8660.0.html.

I2C Scanner is reporting the display at address 0x28 which is one bit shifted from 0x50 and it seems one bit is being dropped on the wake up signal from the bus.

The display responds to commands sent to address 0x28 but not to those sent to 0x50.

Is this an Arduino issue or a display problem?

I am addressing the display directly using the Wire library.

#include <Wire.h>

byte val = 41;
byte val2 = 0xFE;
byte val3 = 0x45;
byte val4 = 0x00;
int Millis1;
int Millis2;
int Millis3;

void setup()
{
  Wire.begin(); // join i2c bus
  Wire.setClock(50000);
  Serial.begin(9600);
  Millis1 = micros();
  Millis2 = micros();
  Millis3 = (Millis2 - Millis1);//Measure time taken for the maths
}

void loop()
{
  Wire.beginTransmission(0x28); // transmit to device
                              // device address is specified in datasheet
 char myString[] = "This is the first line ";

 
 Wire.write(val2);
 Wire.write(val3);
 Wire.write(val4);
 Wire.write(myString);
 Wire.write(val);             // sends value byte
 Millis1 = micros();
 Wire.endTransmission();     // stop transmitting
 Millis2 = micros();
 Serial.print(Millis2 - Millis1 - Millis3);//Print time taken for 252 clock pulses in microseconds
 Serial.print(" - ");
 Serial.print((252000/(Millis2 - Millis1 - Millis3)));
 Serial.println("Khz");
 
  val++;        // increment value
  if(val == 84) // if reached 64th position (max)
  {
    val = 41;    // start over from lowest value
  }
  delay(500);
}
93
TFTs / Re: API_VERTEX_TRANSLATE_X(250*16); is not working
« Last post by sachin patil on August 07, 2018, 01:45:21 AM »
Thanks for answer. Now, I am not getting font.
I have followed document to get custom font.
I took times.ttf from windows. "Test_ASCII.txt" (this has times new roman alphabet & save as UTF-8).
I use below command,
" fnt_cvt -i times.ttf -s 25 -u Test_ASCII.txt -d 500"
 I am not getting font on display.
94
Evaluation Tools / NHD-4.3CTP-SHIELD N and Eve editor
« Last post by geraldc on August 02, 2018, 10:14:03 PM »
Hi.
I can design and compile screens etc but can anyone tell me where to assign functions to button and guages?
I get buttons on the screen but they do nothing.The nextion I use has a far easier interface.

Thanks
95
TFTs / Re: API_VERTEX_TRANSLATE_X(250*16); is not working
« Last post by Ted_M on August 02, 2018, 10:12:27 AM »
Hi Sachin,

Please check the display settings in main.c and confirm they are configured for the 320x240 resolution.  These parameter names are from our Arduino example code for the 3.5" EVE2 module and are specified differently in the FTDI main.c file but you may use the values pertaining to each setting.

Code: [Select]
  /* Values specific to QVGA LCD display */
  FT_DispWidth = 320;
  FT_DispHeight = 240;
  FT_DispHCycle =  408;
  FT_DispHOffset = 70;
  FT_DispHSync0 = 0;
  FT_DispHSync1 = 10;
  FT_DispVCycle = 263;
  FT_DispVOffset = 13;
  FT_DispVSync0 = 0;
  FT_DispVSync1 = 2;
  FT_DispPCLK = 8;
  FT_DispSwizzle = 2;
  FT_DispPCLKPol = 0;
  FT_DispCSpread = 1;
  FT_DispDither = 1;

#endif

Here is a link to our example code on Github for further reference:
https://github.com/NewhavenDisplay/EVE2-TFT-Modules/tree/master/3.5in/Capacitive/FT_App_Graph/Project/Arduino/FT_App_Graph

Regards,

Ted
96
TFTs / API_VERTEX_TRANSLATE_X(250*16); is not working
« Last post by sachin patil on August 02, 2018, 06:50:10 AM »
I am using following display.
http://www.newhavendisplay.com/-p-9561.html

 (  NHD-3.5-320240FT-CSXN-CTP ).
I have change only SPI driver from "BRT_AN_014".
http://www.ftdichip.com/Support/SoftwareExamples/FT800_Projects.htm


I am able to run demo functions well. Only, I am not able to get resolution.
For eg.
API_COLOR_RGB(0, 0, 255);                 // Set color to blue
    API_VERTEX_TRANSLATE_X(250*16);      // Add an offset of 250 to X direction of subsequent Vertex commands
    API_VERTEX2II(500,100,30,0x43);

Then, I am not able to see letter at postion 750 (500+250), 100.
I have not change anything in "Main.c\ void APP_Init(void)" function.
97
OLEDs / Re: NHD-0420CW Display Upside Down
« Last post by clebell on August 01, 2018, 06:48:54 PM »
I was assuming that, after making the interface pin selection, the other display parameters were already configured at power on.

Perhaps that was the source of my previous confusion.

This will keep me humble for a good long time.
98
Evaluation Tools / Re: Re-programming the Firmware on the Eval board
« Last post by mgrubner on August 01, 2018, 05:21:37 PM »
I managed to do it using ST micro eval board with integrated ST-link. My board Nucleo-F411R, with STM32 ST-Link utility software and USB driver running on my PC. I used jumper wires between NHD-eval Board JTAG header and CN4 connector on STlink of the F411R board. Must remove Jumpers on CN2 of the Nucleo-F411R board to freeup the JTAG port on the STlink portion of the board.
The pin connection are as follows:
NHD-eval Jtag connector Pin 5(TDI) to CN4-6
NHD-eval Jtag connector Pin 7(TMS)to CN4-4
NHD-eval Jtag connector Pin 9(TCK)to CN4-2
NHD-eval Jtag connector Pin 4(GND)to CN4-3
Load NHD latest hex file with the ST-link utility software click on target connect and follow with target program as soon as you let go of the reset button on the NHD eval board.
99
OLEDs / Re: NHD-0420CW Display Upside Down
« Last post by Ted_M on August 01, 2018, 05:03:49 PM »
No worries, just glad to hear you have it working. :)
100
OLEDs / Re: NHD-0420CW Display Upside Down
« Last post by clebell on August 01, 2018, 04:12:09 PM »
It seems I was mistaken.  Maybe.  This is too much.

This is a NHD-0420CW-AB3. I have been orienting the display with the row of connector pads at the bottom.

So I just turned it upside down and the thing reads perfectly.

Before you start laughing (too late, I know), I swear it was originally reading the other way.

Further testing to follow.  This has got to be a glitch.
If it's not a glitch, I'll have an abundance of displays with which to educate myself.

Charles Red-in-the-Face Bell
Really.  This just can't be it.
Pages: 1 ... 8 9 [10]