Metal detector dc42 improvment

What are you developing?
ted
Posts: 62
Joined: Sun Jul 16, 2017 9:57 pm

Re: Metal detector dc42 improvment

Post by ted » Tue Jan 30, 2018 2:00 pm

So I got uno, but I have a problem with LCD 128x64 7920.
http://hobbycomponents.com/images/forum ... 00_600.JPG

#1 code

Code: Select all

This is what I an using and Have nathing on LCD.
#include <LiquidCrystal.h>  // recommended by author DC42

// Digital pin definitions
// Digital pin 0 not used, however if we are using the serial port for debugging then it's serial input
const int debugTxPin = 1; // transmit pin reserved for debugging
const int encoderButtonPin = 2; // encoder button, also IN0 for waking up from sleep mode
const int earpiecePin = 3; // earpiece, aka OCR2B for tone generation
const int T0InputPin = 4;
const int coilDrivePin = 5;
const int LcdRsPin = 6;
const int LcdEnPin = 7;

const int LcdRWPin = 0;[b] // added by me for testing
[/b][color=#FF0000][/color]

const int LcdPowerPin = 8; // LCD power and backlight enable
const int T0OutputPin = 9;
const int lcdD0Pin = 10;
const int lcdD1Pin = 11; // pins 11-13 also used for ICSP
const int LcdD2Pin = 12;
const int LcdD3Pin = 13;
So I test my LCD with traditional "hello World" is working ok, this program is using different LCD library and pins.
#2 code

Code: Select all

#include "U8glib.h"
//pins used_ E, R/W, RS, PSB.

on this pins I have 5V pulses - E, R/W, RS.

The problem is that I have no 5V pulses on any pin when I run the first code ( #1 )for dc42 detector, I think the problem is in R/W pin which is not declared in original program.
Any ideas how to fix it ?

User avatar
BennehBoy
Posts: 500
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Metal detector dc42 improvment

Post by BennehBoy » Tue Jan 30, 2018 2:55 pm

I think you need a GPIO pin for the LCD r/w. Pin 0 on Arduino Uno is Serial RX.

To make life simpler, I use an i2c LCD driver, less Pins required, and the library is a drop in replacement, see the LCD Code in this repo -> https://github.com/BennehBoy/TD5EcuEmulator
-------------------------------------
https://github.com/BennehBoy

ted
Posts: 62
Joined: Sun Jul 16, 2017 9:57 pm

Re: Metal detector dc42 improvment

Post by ted » Tue Jan 30, 2018 3:37 pm

I did that before no success
const int LcdRWPin = 0; // added by me for testing

User avatar
BennehBoy
Posts: 500
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Metal detector dc42 improvment

Post by BennehBoy » Tue Jan 30, 2018 4:13 pm

ted wrote:
Tue Jan 30, 2018 3:37 pm
I did that before no success
const int LcdRWPin = 0; // added by me for testing


Did what before?

I'm saying DO NOT USE pin 0.
-------------------------------------
https://github.com/BennehBoy

ted
Posts: 62
Joined: Sun Jul 16, 2017 9:57 pm

Re: Metal detector dc42 improvment

Post by ted » Tue Jan 30, 2018 4:37 pm

I try to use 0 pin, I will try others.

ted
Posts: 62
Joined: Sun Jul 16, 2017 9:57 pm

Re: Metal detector dc42 improvment

Post by ted » Wed Jan 31, 2018 12:49 pm

I think the problem is described bellow
I have a program which has LCD pin description and message which should be displayed. So I add a LiquidCrystal.h library.
I think I should declare the type of used LCD and add the command to run the LCD program.
What I should with R/W and PBS pins ?
Attachments
LCD 128x64.jpg
LCD 128x64.jpg (61.85 KiB) Viewed 82 times

User avatar
ahull
Posts: 1718
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Metal detector dc42 improvment

Post by ahull » Wed Jan 31, 2018 2:41 pm

I know absolutely nothing about that particular display, but from the silkscreen I suggest you pull R/W high to read from the display, and low to write to it (since the bar is over the W). Now which pin you chose to use to do that, I'll leave entirely up to you.
- Andy Hull -

User avatar
BennehBoy
Posts: 500
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Metal detector dc42 improvment

Post by BennehBoy » Wed Jan 31, 2018 3:07 pm

-------------------------------------
https://github.com/BennehBoy

ted
Posts: 62
Joined: Sun Jul 16, 2017 9:57 pm

Re: Metal detector dc42 improvment

Post by ted » Wed Jan 31, 2018 3:23 pm

I was there
So I test my LCD with traditional "hello World" is working ok, this program is using different LCD library and pins.
#2 code
CODE: SELECT ALL
#include "U8glib.h"
//pins used_ E, R/W, RS, PSB.

User avatar
BennehBoy
Posts: 500
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Metal detector dc42 improvment

Post by BennehBoy » Wed Jan 31, 2018 7:15 pm

Final post from me here....

Read the link I posted.... setup your UNO with ONLY the LCD connected using the pins described in the link. Compile and upload the test sketch that they provide.
-------------------------------------
https://github.com/BennehBoy

Post Reply