I'm new here and clearly a noob.. so take it easy on me.
Here is a link to a "closed thread" on this subject. I will make this quick. I have a Arduino Mega. This examples shows an UNO. Some of these wires are hooked to pins that have the PWM next to them. My question is "Is it ok for me to hook up all the pins to the digital pin locations on the mega? Obviously not the power and grounding pins...
Here is the data sheet on the LCD
The thread is showing pins 11,10,9 5, and 3 being used.. all of which are PWM pins.. Do these wires have to go to these or can I use all Digital pins?
Ok, now that prompts me to ask a question.
What difference does it make which pin he connects them to if the code he is running does not contain
any PWM commands (ie:analogWrite()) ?
I move my 1602 pins around all the time , depending on what I am doing. I have used all of the pins except
D0 and ussually D1 (Rx & Tx). Other than those , I redefine my constructor to suit whatever pins happen to
be available at the time. Can you give any reason why he can't use PWM pins if he's not running PWM code ?
raschemmel:
What difference does it make which pin he connects them to if the code he is running does not contain
any PWM commands (ie:analogWrite()) ?
It makes no difference. PWM pins are digital pins as well, just "PWM-capable". PWM could simultaneously be used on other pins that are not connected to the LCD.
Dslethal,
Do you know what you are doing ?
You're post references a 1602 lcd.
You linked the datasheet for the Hitachi chip.
Why ?
Almost EVERYONE here has one of these 1602 lcds and I'd be willing to bet you could count on one hand
the number of people who have spent more the 5 minutes looking at the datasheet.
So you have a Mega.
What is it you really want to know ?
The fact that you even asked that question suggests you know next to nothing about connecting this lcd, or
for that matter , about the software. If that is the case , fine. If you want to know how to get the lcd working
why don't you just come right out and say it ?
(ie: I need help getting this lcd working)
I have two of these lcds and it takes me 3 minutes tops to connect one and have it working. If you knew how
to hook it up you could have done it in less time than it takes me to write this post.
So that brings me to the obvious question, why are you not asking us how to connect it to a Mega ?
(or about the software or libraries ?)
Some of these wires are hooked to pins that have the PWM next to them. My question is "Is it ok for me to hook up all the pins to the digital pin locations on the mega?
The answer to your question is ... Yes.
Essentially all of the I/O pins on the Atmel Mega series microcontrollers are basically the same as far as pure digital I/O goes. Each of them also has one or more alternate uses - for example AtoD conversion, Pulse Width Modulation, Serial communications of one form or another, etc.
Since the LCD requires simple digital signals this means that any of the I/O pins on the Arduino can be used for any of the data or control lines on the LCD module. This means that if your system has other devices which require the 'alternate' functions of the microcontroller you assign those pins first, then you use whatever pins are left over for your LCD and adjust the argument of the constructor appropriately. In English this last part means that you put the appropriate Arduino pin numbers between the parentheses in the LiquidCrystal lcd(...) statement.
raschemmel - first of all I stated at first I'm a noob to this stuff. I dont' have years of experience in embedded systems or in the field. So stop for one min, go take your medication, and then come back and relax for a min. I have a mega board. I want to hook up 1602 LCD to it. I've have seen lots of code and examples of this style LCD hooked up to UNO's. MY question was clear... can I hook up all of the data pins or I/O pins to the digital ones on the MEGA.. vs having some of them assigned to pins that have PWM abilities also. This isn't hard to understand.. and to bring out the point that I don't have a lot of experience isnt needed especially because I stated that I'm a noob... WAY TO MAKE me feel good to come to the Arduino forums and feel comfortable to ask questions and start learning some things..
To the other ppl that replied, thank you for being kind and understanding. No worries, every industry has guys like raschemmel.. and it's ok.. some kids get dropped on their heads at a young age and cant help it..
I guess so.. I want to hook up a bunch of servos, which will I think require the use of the PWM pins... so i wanted to free up as many of them as I could.. so that is why I was asking if I can use the digital pins vs the PWM ones...
Also, I'm pretty sure it uses SPI protocol.
If you don't know what that is let me know and I'll shoot a link to a tutorial on it.
Most people prefer I2C protocol . (same offer) because it uses addresses instead of unique chip selects.
At some point you might want to learn about ONEWIRE. (same offer)
Here is a link to a "closed thread" on this subject.
(there was no link)
Also, BTW, is there a 1602 LCD anywhere in this story or was that just a hook to ask the PWM question ?
Anything else you need ?
I don't believe that you have to use PWM pins to drive a servo. The Servo library reference states "The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega." You would need to use PWM pins for analogWrite().
Ok. That's what I thought.
It seems at the time he thought he needed a digital output for each servo but besides that he
wanted to have the freedom to re-arrange his I/O and conserve pins but thought he needed
all his PWMs for the servos and did not want to tie them up controlling an lcd.
I'm new here and clearly a noob.. so take it easy on me.
DsLethal,
You came to an international forum (of experts) announcing your inexperience and pleading for mercy and
then the first time someone comments on your inexperience or elaborates on it you fly off the handle and
start hurling insults. Does that make sense ? I looked back at my post and for the life of me I couldn't find
any where that I insulted you. Are you offended because someone wants to talk about how little you know ?
Reread my post:
What is it you really want to know ?
I answered you first question here:
I have used all of the pins except
D0 and ussually D1 (Rx & Tx).
But we didn't really get to why you came here until this part:
So you're good ?
You don't need any help then ?
I want to hook up a bunch of servos, which will I think require the use of the PWM pins... so i wanted to free up as many of them as I could.. so that is why I was asking if I can use the digital pins vs the PWM ones...
The reason I talked about your inexperience was to get at why you really came here. Your original question implied some
importance to PWM. The title of your post mentioned an lcd. The actual objective though is driving alot of servos, and
moving the lcd pins is part of that. We get that. My point is that if you are seeking information , it saves time to just
come right out and state your final objective (driving servos). , which you did, after insulting me. If you take offense
to anything I said, it is perfectly fair to state that "I take offense to you talking about my inexperience", or "You don't
have to be rude.", and leave it at that. I think you crossed the line by hurling insults. I think that was overkill, since
pointing out you are inexperienced can hardly be construed as an insult (at least not here on the forum, and especially
since you admitted it yourself. We do that all the time, as it is part of the learning experience). So now that you have kicked me in the teeth I think you could at least have the decency to thank me for the information I gave you pertaining to driving
servos. And I apologize if I offended you in my first post.
I looked back at my post and for the life of me I couldn't find
any where that I insulted you.
You are looking at your posts from your point of view which is still the same as as when you wrote the post. I find that many of your posts are somewhat offensive.