Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduinohelpers - graphic LCD


  • Please log in to reply
10 replies to this topic

#1 Psysoul

Psysoul

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 February 2012 - 01:26 AM

Hello everyone!

I built a circut for my graphic LCD (128x64), which has the same controller as AdaFruit ST7565,
so it should work using the code from:

http://netduinohelpers.codeplex.com/

Unfortunately I couldn't deploy this (I changed things to micro framework 4.2), I flashed my netduino to 4.2 a few days ago
and I also run some sample programs, so it is working fine.

I removed a few files to shrink the size of the project, however it still might be too big. Is this the situation? What else could be the problem? The build is successful, only the deployment fails.

Output:

Incrementally deploying assemblies to device
Deploying assemblies for a total size of 103072 bytes
Assemblies not successfully deployed to device.
Deployment to the device was not successful.

Thanks for any ideas.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 11 February 2012 - 04:55 AM

Hello Psysoul. The Netduino Plus suffers of a very limited memory size for the user's programs, because the many features embedded in such a board. If you want to make it running a LCD display, you should create your own app, and link/attach just the needed classes. Avoid embed the whole library, because it's clearly huge. However, this won't be a guarantee, because it depends also on the actual ram required by the driver. The simplest thing is making an attempt. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Psysoul

Psysoul

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 February 2012 - 10:49 AM

Hello Psysoul.
The Netduino Plus suffers of a very limited memory size for the user's programs, because the many features embedded in such a board.
If you want to make it running a LCD display, you should create your own app, and link/attach just the needed classes. Avoid embed the whole library, because it's clearly huge.
However, this won't be a guarantee, because it depends also on the actual ram required by the driver.
The simplest thing is making an attempt.
Cheers


Thank you, I created my own app, adding only the needed classes and it's working. Well, LCD backlight is not working.

Datasheeet tells to us a current source (e.g. CAT4238TD, which I don't have), or a series of resistors. However I couldn't figure out which restistor do I need for each path. (I have A1+, A2+, A3+, C1-, C2-, C3-). Can someone help me how to connect these? Also should I use a digital pin to control these?

http://www.soselectr.../dogl128-6e.pdf

#4 Psysoul

Psysoul

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 February 2012 - 02:10 PM

Also I have another question: I need to control 3 RGB (CC) from the netduino. I used PWM to drive just one LED, but don't know how to drive 3, they need to be lighting up in the same color. I guess I need transistors to avoid damaging the output pins of the netduino, but how do I connect the 3 LEDs? Also can I use the 3.3 v or 5v from the netduino output to drive the LEDs or I need to use an external power supply?

#5 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 11 February 2012 - 03:21 PM

Also...about the LCD, you can connect all the C- to ground. Then you should connect the A+ terminals *toward* the +5V, for instance.
Note that you cannot directly the As+ to +5V, but you should instead use a resistor. I'd suggest to use three resistors, one for each A+.
Well, the specs say that you must limit the current flowing for each led, to about 45-60 mA. Again, the specs say that each led causes a voltage drop of about 4V.
Here is the resistor value:
R = (Vcc - Vled) / I = (5 - 4) / 0.05 = 20 Ohms, for a supposed current of 50 mA.

Here another tip. I'd use the primary power supply (e.g. 9V), instead of the +5V, for two reasons:
  • for three leds, you would asking as much as 150 mA, plus the Netduino current. That's a useless wasting of thermal energy on the 5V regulator: overheating is never a good choice.
  • your resistor value is much less critical, and the health of the led is surely longer.
So, for example, using 9V the resistor would be: (9 - 4) / 0.05 = 100 Ohms, that is a very common value.

Bear in mind that the above calculation is for one resistor for one led, thus you'll need actually three resistors of 100 Ohms.


About the RGB led.
It's hard to burn your Netduino: the circuits are very well designed, and the only thing you should avoid as the pest is:
  • taking the voltage *below* zero Volts (i.e. ground), or reversing the supply polarity;
  • taking a voltage fairly above the maximum limits specified, which is around 5.5 V.
How to drive a RGB led? Well it depends on how the led is. How much current should be drought for each color?
Assuming the led is a normal, 3-5 mm, its brightness is very high even with few milli-Amperes. Thus, you may drive just one color directly using a port, but you can't drive three colors, which would require 3x current.
The easiest way is using a transistor. Here is a post of mine (sorry it's Italian), but you should only look the circuit:
http://tinyclr.it/se...-power-led.aspx
You should add the resistors (as above considerations). The high-power led I've used didn't require a resistor.

Hope it helps.
Cheers
Biggest fault of Netduino? It runs by electricity.

#6 Psysoul

Psysoul

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 February 2012 - 03:55 PM

Also...about the LCD, you can connect all the C- to ground. Then you should connect the A+ terminals *toward* the +5V, for instance.
Note that you cannot directly the As+ to +5V, but you should instead use a resistor. I'd suggest to use three resistors, one for each A+.
Well, the specs say that you must limit the current flowing for each led, to about 45-60 mA. Again, the specs say that each led causes a voltage drop of about 4V.
Here is the resistor value:
R = (Vcc - Vled) / I = (5 - 4) / 0.05 = 20 Ohms, for a supposed current of 50 mA.

Here another tip. I'd use the primary power supply (e.g. 9V), instead of the +5V, for two reasons:

  • for three leds, you would asking as much as 150 mA, plus the Netduino current. That's a useless wasting of thermal energy on the 5V regulator: overheating is never a good choice.
  • your resistor value is much less critical, and the health of the led is surely longer.
So, for example, using 9V the resistor would be: (9 - 4) / 0.05 = 100 Ohms, that is a very common value.

Bear in mind that the above calculation is for one resistor for one led, thus you'll need actually three resistors of 100 Ohms.


About the RGB led.
It's hard to burn your Netduino: the circuits are very well designed, and the only thing you should avoid as the pest is:
  • taking the voltage *below* zero Volts (i.e. ground), or reversing the supply polarity;
  • taking a voltage fairly above the maximum limits specified, which is around 5.5 V.
How to drive a RGB led? Well it depends on how the led is. How much current should be drought for each color?
Assuming the led is a normal, 3-5 mm, its brightness is very high even with few milli-Amperes. Thus, you may drive just one color directly using a port, but you can't drive three colors, which would require 3x current.
The easiest way is using a transistor. Here is a post of mine (sorry it's Italian), but you should only look the circuit:
http://tinyclr.it/se...-power-led.aspx
You should add the resistors (as above considerations). The high-power led I've used didn't require a resistor.

Hope it helps.
Cheers



Thanks a lot for the answer. I put aside the LCD now, but Im gonna check it with 20 Ohms (it might be that this version has no backlight).

As for the LEDs I managed to use a TIP 122 NPN transistor to drive 3 leds (red,red,green), which is working fine. I used a similar circuit as yours, however I used D7 with a 4.7K resistor and you used a PWM with only 330 ohms.

Now I need to create a driver for the RGB leds, luckily I have 3 TIP 122 transistors, so I can create a circuit and use 3 digital pins.

However ideally I want to drive these using the PWM output pins, is it possible to drive 3PWM output using 3 TIP 122 and 3leds?

Now I have a problem. Should I use 4.7k or 330ohms between NPN base and PWM0 on netduino?

Also another problem: I have common cathode LEDs, which mean I can't use the same configuration, as I need to control the + lines of the leds. In current configuration all lines would be on if I switch the digital out on, so I guess they would just be white. How can I change the circuit?

I guess I need to use PNP transistor instead, so I can switch the positive line (r, g, B) instead of the ground.

#7 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 11 February 2012 - 06:16 PM

The TIP 122 is not actually a normal transistor, but it's rather a "darlington" coupling. For brevity, it's called "darlington transistor". You can recognize it because it actually embeds a couple of transistor, so that the overall current gain is very high.
You can see the current gain (hFE) at page 2, which is at least 100, and it's very high.
Okay, maybe you don't need those kind of info, but it's related to the question you asked:

Now I have a problem. Should I use 4.7k or 330ohms between NPN base and PWM0 on netduino?<br style="color: rgb(28, 40, 55); font-size: 13px; line-height: 19px; background-color: rgb(250, 251, 252); ">

Well, since the TIP 122 can achieve an huge current gain, you can rely on a very small current flowing into the base, to drive even a very high current through C-E leads. In other words, you can use the 4.7k resistor, and you'll be able to drive even high-power leds.
Okay...I stop here, because there's something else to say, but...only if you need it...too many info!




Common cathode.
Okay, the simplest way is using PNP, instead of NPN. If you don't have them, you could still use NPN transistor, but adding a level shifter, for example any HCMOS gate (74HC00, 74HC32, etc)
This chip should be powered at +5V, so that the Netduino output -being at +3.3V- will become "amplified", swinging from 0 to +5V.
At this point, simply connect your NPN base to the gate output, without resistor. The collector lead to +5V, and the emitter to a resistor, which is connected to the led array. Of course, the common cathode should be at ground.
The only problem is that this pattern require a pretty high voltage. The voltage on the emitter lead will be 0.7..0-8V less than the base lead voltage. That's the way a level shifter is required.
Moreover, for this pattern, I would *avoid* the darlington, because, as you can see, they have an higher voltage drop: VBE = 3V (page 2).
Cheers
Biggest fault of Netduino? It runs by electricity.

#8 Psysoul

Psysoul

    New Member

  • Members
  • Pip
  • 6 posts

Posted 12 February 2012 - 12:04 PM

The TIP 122 is not actually a normal transistor, but it's rather a "darlington" coupling. For brevity, it's called "darlington transistor". You can recognize it because it actually embeds a couple of transistor, so that the overall current gain is very high.
You can see the current gain (hFE) at page 2, which is at least 100, and it's very high.
Okay, maybe you don't need those kind of info, but it's related to the question you asked:

Well, since the TIP 122 can achieve an huge current gain, you can rely on a very small current flowing into the base, to drive even a very high current through C-E leads. In other words, you can use the 4.7k resistor, and you'll be able to drive even high-power leds.
Okay...I stop here, because there's something else to say, but...only if you need it...too many info!




Common cathode.
Okay, the simplest way is using PNP, instead of NPN. If you don't have them, you could still use NPN transistor, but adding a level shifter, for example any HCMOS gate (74HC00, 74HC32, etc)
This chip should be powered at +5V, so that the Netduino output -being at +3.3V- will become "amplified", swinging from 0 to +5V.
At this point, simply connect your NPN base to the gate output, without resistor. The collector lead to +5V, and the emitter to a resistor, which is connected to the led array. Of course, the common cathode should be at ground.
The only problem is that this pattern require a pretty high voltage. The voltage on the emitter lead will be 0.7..0-8V less than the base lead voltage. That's the way a level shifter is required.
Moreover, for this pattern, I would *avoid* the darlington, because, as you can see, they have an higher voltage drop: VBE = 3V (page 2).
Cheers


More info is always better, as I have so much things to learn and experience.

I found a few PNP transistors (2N2905 or similar), so I built the circle and it works using 3.3Vs to the transistor. However I want to use 5V if possible, so the leds would be brigther, but in this case even if the netduino output is high, the leds will be light up a little, when they shouldn't. Do I have a problem with the resistors, or I need to use a level shifter in this case?

#9 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 12 February 2012 - 01:13 PM

Using PNP (2N2905 is okay) the circuit is different.
The base lead still goes to the Netduino output, and the emitter should go to the +Vcc. Now, The brightness isn't given by the voltage, but by the current flowing through the led instead.
Your goal is having the transistor off (i.e. unpolarized) when the Netduino out is high (+3.3V), and having it on (i.e. full polarized) when the output will be low.
I agree about using +5 instead of +3.3V, but it's rather for avoid using uselessly the +3.3V regulated. Even more power wasted, and more overheat: no reason for doing that.
However you can connect the emitter to +5V, but you must provide a voltage divider for the base lead, that it a couple of resistors. One is still in series to the base lead toward the Netduino output, the new added should go from the base lead to the +5V. The aim is to get a "low" voltage drop emitter-base, when the Netduino output is high, thus the transistor can't be polarized.
So, supposing that the series resistor is 4.7k, the new could be *roughly* a quarter, or a fifth.
Let's check for 1k:
Veb = (5 - 3.3) * 1k / (4.7k + 1k) = 0.3V
which is not enough to get the transistor polarized.

Now let's check what will be when the Netduino output is low:
Veb = (5 - 0) * 1k / (4.7k + 1k) = 0.87V
It seems okay.
However, as you can see, it's not critical at all. It's much easier to pick a bunch of different values and see what's the best one.

I forgot to mention that the collector lead will go to the led, and the led to the ground.
Cheers
Biggest fault of Netduino? It runs by electricity.

#10 adamdzak

adamdzak

    New Member

  • Members
  • Pip
  • 1 posts

Posted 06 October 2012 - 11:43 PM

I've been trying for about a week now with this project, and I for the life of me can't get even the sample going. I consistently throw the same errors... opcode 'conv.ovf.i' -- overflow will not throw exception An error has occured. Please check your hardware. Any thoughts?

#11 david98xp

david98xp

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 18 December 2014 - 10:10 PM

I'm using a N2. I am on 4.2 and ported everything and deleted most things I wouldn't use. It deploys good but only a white backlight comes on while nothing is shown on screen.

My display is also the negative rgb one.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.