SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By esklar81
#101339
DarrenG,

The more I look at this, the more confused I get! :?

I tried looking at the software side, to see how NewSoftSerial works. I haven't yet found straightforward instructions, so please post a link to what you have.

What I did find indicates that the first argument of the function is the receive pin and the second is the transmit pin.

however, the line of code I found was
Code: Select all
NewSoftSerial nss(rxPin, txPin);
which differs substantially from the syntax in the code you posted.
Code: Select all
NewSoftSerial sLCD =  NewSoftSerial(3, 14); /* Serial LCD is connected on pin 14 (Analog input 0) */
So, here're a few questions:
1) What pin is "14"? It appears to be an analog input pin, which is an odd choice for sending data to a display.
2) What's connected to pin 3, which appears to be a digital I/O pin? Is it possible that your code is hanging waiting for a particular response on that pin? Does grounding it help?
3) If you change both pins to DI/O pins, do you get the same result?
4) If you change to different serial driver software, do you get the same result?

TIA,
Eric[/color]
By DarrenG
#101346
esklar81 wrote:I tried looking at the software side, to see how NewSoftSerial works. I haven't yet found straightforward instructions, so please post a link to what you have.
All I have is the newsoftserial.h library. I don't profess to understand it but presume it has been used here as it allows the inclusion of multiple serial devices (LCD and GPS in this case) more easily?
What I did find indicates that the first argument of the function is the receive pin and the second is the transmit pin.
That is how I am given to understand it.
however, the line of code I found was
Code: Select all
NewSoftSerial nss(rxPin, txPin);
which differs substantially from the syntax in the code you posted.
Code: Select all
NewSoftSerial sLCD =  NewSoftSerial(3, 14); /* Serial LCD is connected on pin 14 (Analog input 0) */
Which is correct, rxPin is ignored as there is no return channel, TxPin is the physical Analog0 pin which is configured as Digital14. The serial LCD only requires RX, GND and VCC. It has no TX.
So, here're a few questions:
1) What pin is "14"? It appears to be an analog input pin, which is an odd choice for sending data to a display.
I can't say why that pin was chosen here but the shield uses a large number of digital pins for the Canbus communication, joystick, LEDs etc?
2) What's connected to pin 3, which appears to be a digital I/O pin? Is it possible that your code is hanging waiting for a particular response on that pin? Does grounding it help?
Looking at the schematic, as far as I can tell nothing is connected?
3) If you change both pins to DI/O pins, do you get the same result?
Pin 14 is already a digital pin?
4) If you change to different serial driver software, do you get the same result?
I'm pretty new to this so am just working from the example sketches given as a starting point. Given that the 16x2 works with this setup and those pin assignments I can't see how the code could be at fault? The 16x2 and 20x4 use the same serial configurations and have the same power requirements?
By SFE-Robert
#101347
Maybe I'm wrong here, but A0 is by default the TX pin and you shouldn't need to configure it as such. If it works without the shield in place, there is something else going on.
By esklar81
#101365
@Robert:
I was, I admit, clutching at some rather brittle straws. :|

@DarrenG:
I looked through the thread, but I didn't see any specification of which LCD modules you've tried. Please provide links to the datasheets and schematics, if you can. In the absence of real information, I decided to investigate the following theory with two example parts chosen from the SparkFun offerings:
http://www.sparkfun.com/commerce/produc ... ts_id=9068
http://www.sparkfun.com/commerce/produc ... ts_id=9568

What I found was that the description of the 16X2 unit says that, contrary to the silkscreen on the board, it is a 3.3 V device.

The 20X4 unit appears to be a 5 V device. However, the description page links to the same schematic as the description of the 16X2 unit. The datasheet for the 20 X 4 unit describes it as having a controller that does not appear to be on that schematic.

My theory is that you have slightly below 5 V when you have everything running, including the shield. A 3.3 V LCD module might not be happy there and might have less than the desired life, but it will have enough voltage. If there's internal regulation, it may not even care much. OTOH, the 5 V module has less voltage than it needs.

I suggest the following:
1) Analyze the circuits for the two modules, including the driver chips, and see whether they have on-board regulation and at what voltage they operate.

2) Perform the voltage measurements as we've discussed. Include measurement with each LCD module connected directly to the Arduino, connected through the shield with the shield-supported devices turned off or disconnected, and connected through the shield with the shield-supported devices turned on.

Happy Hunting,
Eric
By DarrenG
#101395
These are the serial LCDs I have:

16x2 LCD - Red on Black 5v

20x4 LCD - Black on Green 5v

The product pages link to the same datasheet and schematic which is the serial piggyback board. However both of these LCDs are self contained, the serial driver circuit is built into the LCD and not a piggyback board.

However, control is the same and they are both listed as 5v displays on Sparkfun's product pages.
By DarrenG
#101429
SFE-TS-Robert wrote:You are correct. They have the same backpack with the same code on them.

Are you sure they are both talking at the same baud rate?
That was my initial thought but as the 20x4 works when connected to the Arduino then it must be operating at 9600?

Similarly the 16x2 is set to default 9600 and works in both configurations.

It's very bizarre!
By SFE-Robert
#101442
that is very strange. there really is very little different between the two. remind me again, what's not working? i do remember there is a small difference in commands between the two.
By DarrenG
#101444
Both 16x2 and 20x4 work when connected directly to the Arduino.

Only 16x2 works when connected via the shield. The 20x4, when plugged into shield shows splashscreen and I can see the backlight come on, albeit the splashscreen text 'Sparkfun v2.5' is at much lower contrast and the backlight is at lower brightness.

It does seem like some sort of threshold voltage/current issue but I'm not experienced enough to know how to test that or indeed what to test.
By DarrenG
#101446
SFE-TS-Robert wrote:instead of plugging into the shield, plug directly into the 5v, GND, and A0 pin on the arduino (which should come through on the shield).
I have already:
Both 16x2 and 20x4 work when connected directly to the Arduino.
I was using 5v, GND and A0 on the Arduino to test sans shield :)

I can't physically connect directly to the Arduino AND have the shield connected though if that is what you're suggesting?
By esklar81
#101447
@DarrenG:
Not just to be a nag, but have you performed the various voltage tests I suggested? I'm out of ideas, but believe that the various voltage tests may well point to the problem.

Also, I think Robert was suggesting you connect to the Arduino pins with the shield in place. The pins should be transferred straight up through the shield. Although I don't, based on my review of the shield schematic, expect a different result, it's probably worth a try.

@Robert:
Are the schematics and specifications for these available somewhere? The schematic linked from their product pages in the SparkFun catalog is the same and does not appear to be anywhere near complete. I believe I found my way to a datasheet for the 20X4 LCD module, but not for the 16X2. If I had more information, I could do a much better job of hunting for the critical difference.

TIA,
Eric
By SFE-Robert
#101451
They are essentially identical. We have the same datasheet for both.

And yes, I did suggest connecting them through the shield, not without the shield on.

It seems to be that the shield is drawing too much current maybe. If it works without the shield, guess what, it's the shield's fault.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]