Russia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« on: May 27, 2012, 02:16:52 pm » |
I have a problem with my DFROBOT Mega 2560 connected to a 128x64 display (glcd library is used).
Whenever I connect board's Reset pin to LCD's pin 17 and try to upload a new sketch, the display will reset, the board's RX pin will blink for a moment, and then nothing will happen. avrdude.exe will hang until it is killed via task manager. Pressing Reset button on the board when this hang occurs does nothing. If I disconnect the Reset pin from LCD's pin 17 everything works fine.
What may be causing such an issue?
Thank you in advance!
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 91
Posts: 9449
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #1 on: May 27, 2012, 03:46:10 pm » |
The reset pin is an input not an output. Can you explain why you connected it?
|
|
|
|
|
Logged
|
|
|
|
|
Russia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #2 on: May 27, 2012, 05:05:11 pm » |
The reset pin is an input not an output. Can you explain why you connected it? I am new to Arduino. I connected it because I was told to do so by the documentation to the kit I had purchased: | GLCD Function | Panel B | Mega Pins | | +5 volts | 2 | +5V | | ... | ... | ... | | Reset | 17 | Reset |
There was also a picture with an assembled circuit where I could clearly see that connection. Did I do something wrong? With that kind of connection I could see a difference that the display became cleared upon board reset, while without the connection it would remain in its last state.
|
|
|
|
« Last Edit: May 27, 2012, 05:11:31 pm by 1nvisible »
|
Logged
|
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #3 on: May 27, 2012, 05:13:40 pm » |
I'd suggest asking DFRobot for support. It's hard for us to provide advice on other people's boards.
|
|
|
|
|
Logged
|
|
|
|
|
Russia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #4 on: May 27, 2012, 05:19:26 pm » |
I thought this board is a clone of Mega 2560. Anyway, is this a problem with the board, or this behavior is normal? EDIT: The same thing about the connection is described in glcd library's documentation: The ks0108 datasheet says the reset pin should be taken low for a brief period after power is applied. The diagrams show the display’s reset pin connected to the Arduino reset pin and this will automatically reset the display when the Arduino resets.
|
|
|
|
« Last Edit: May 27, 2012, 05:36:08 pm by 1nvisible »
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3463
|
 |
« Reply #5 on: May 27, 2012, 09:48:42 pm » |
What may be causing such an issue? The following is pure speculation but it may give you some hints.
I believe that the Arduino reset circuitry has undergone some changes in order to accommodate changes in the bootloader. I suspect that the recommendation to tie the two resets together may have been made when the Arduino circuitry was different and the GLCD did not upset that circuitry. Now, with the changes to the Arduino, the same GLCD circuitry could be adversely affecting the Arduino bootload process.Don
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 275
|
 |
« Reply #6 on: May 28, 2012, 07:44:00 am » |
I'm not an expert but I met one once. I suspect that the idea to tie the resets together is to reset both the display and processor at the same time. I would think that provide the display is a "reset-not" input, line the processor, then they should be compatible.
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3463
|
 |
« Reply #7 on: May 28, 2012, 08:56:42 am » |
I suspect that the idea to tie the resets together is to reset both the display and processor at the same time. I would think that provide the display is a "reset-not" input, line the processor, then they should be compatible. I believe that all of your suspicions are correct as far as they go. With both reset lines tied together pushing the reset button on the Arduino would normally reset both device as desired and expected. You are not taking into account the bootloader and it's involvement with the reset line.
The problem is that the current Arduinos (but not the ones in use when the DFRobot documentation was prepared) have some additional circuitry that permits the serial port to automatically reset the processor as part of the bootload process. It is this circuitry, specifically the RC time constants, that is probably being upset by the presence of the GLCD.Don
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 275
|
 |
« Reply #8 on: May 28, 2012, 11:06:27 am » |
So do you think that when the DTR goes low the isolation capacitor is to small to reset both boards? That maybe the LCD board also has a pull up resistor and the two resistors in parallel provide too much pull up to be pulled down far enough or long enough by the reset circuit? I.E. the pull-up resistor on the LCD board is throwing off the RC time constant?
If this is the case then there should only be a problem when uploading a new sketch. The sketch would not upload and there will be some sort of error message. To these this, I would try manually resetting the board at the "appropriate" time. That time would be when the compile is compete and the "Uploading ..." first appears.
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3463
|
 |
« Reply #9 on: May 28, 2012, 12:59:04 pm » |
So do you think that when the DTR goes low the isolation capacitor is to small to reset both boards? That maybe the LCD board also has a pull up resistor and the two resistors in parallel provide too much pull up to be pulled down far enough or long enough by the reset circuit? I.E. the pull-up resistor on the LCD board is throwing off the RC time constant? That's my thought.If this is the case then there should only be a problem when uploading a new sketch. The sketch would not upload and there will be some sort of error message. To these this, I would try manually resetting the board at the "appropriate" time. That time would be when the compile is compete and the "Uploading ..." first appears. That won't completely solve the problem. Any time the serial port is opened, which would include the use of the serial monitor, the problem could occur.Don
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 275
|
 |
« Reply #10 on: May 28, 2012, 08:20:53 pm » |
I would think that if the problem is too much Pull-up, the effect would be to not reset the processor and/or display.
The solution might be to buffer the reset. I don't know if it will work but something like the attached schematic could work.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #11 on: May 29, 2012, 01:09:21 am » |
What about a series diode (1N4148) between the Mega reset and the anode to the KS0108 reset line, perhaps with a 4K7 pull-up to the anode, this would prevent the KS0108 reset from affecting the board reset? While still being capable of reset by the Arduino reset, it should work just fine... IMO
Doc
|
|
|
|
« Last Edit: May 29, 2012, 06:08:33 pm by Docedison »
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Dallas, TX USA
Offline
Edison Member
Karma: 25
Posts: 1618
|
 |
« Reply #12 on: May 29, 2012, 02:13:22 am » |
ok, so here is the deal. Some ks0108 modules don't provide a powerup reset and some do. When Michael drew up the wiring diagram for wiring up the ks0108 for the glcd library he recommended connecting the Arduino reset pin to the reset signal on the glcd module. This was to compensate for the ks0108 modules that won't self reset at power up and saved using another arduino pin to control the ks0108 reset signal. The reset pin on the arduino board acts as an output when the reset button on the arduino board is pressed.
Some glcd modules have powerup reset circuitry in them as well as a pullup on the glcd module reset line. This combined with the newer auto reset circuitry on the newer arduino boards causes the auto reset on the arduino board to fail.
It takes the combination of certain ks0108 modules and the newer arduino boards to make auto reset on the Arduino to fail. (Happens on newer official Arduino boards as well)
Most ks0108 modules will work if the reset signal on the glcd module is simply not connected to anything. Of those that do not work this way, most of these will work if reset is tied to vcc. (while you can strap the glcd module reset line directly to VCC, I'd recommend using a resistor) For those glcd modules that still won't work, software in the glcd library can reset the ks0108 as part of its initialization; however, in order for the software reset to work, you have to use another arduino pin. The glcd software reset will always work for any combination of Arduino and ks0108 module but does require using an additional pin. To setup the library to use library controlled glcd reset you have to enable it by uncommenting the define in the pin configuration for the ks0108 panel. Edit your pin configuration file in glcd/config/ks0108_{board}.h and look for the line: #define glcdRES Uncomment that line and use the pin number for that define to connect to the glcd module reset line.
So you have 3 options: 1) disconnect the reset line on the glcd module (see if that works) 2) tie the reset line on the glcd module to vcc 3) turn on glcd s/w control of the glcd reset line
While 1 and 2 are easier and save a pin and will work for nearly all ks0108 glcds, in the event of reseting the Arduino the glcd module can potentially be left in an odd state and require powering down in order to reset the glcd since there is no other way to reset the glcd. While this very seldom happens, it is a possibility. In other works, when not using the software reset, there is a very small possibility that when the arduino is reset (not powered down/up) while the glcd library is talking to the glcd that after the arduino is reset that the glcd library will not be able to properly talk to the glcd module until the arduino and glcd are power cycled.
Hope that clears things up.
--- bill
|
|
|
|
« Last Edit: May 29, 2012, 02:16:02 am by bperrybap »
|
Logged
|
|
|
|
|
Russia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #13 on: May 30, 2012, 04:01:41 pm » |
Thanks to everyone for your answers! Special thanks to bperrybap for the detailed description!
Fortunately, my display unit seems to work well without its reset pin connected to anything, so I'll leave it this way.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #14 on: May 31, 2012, 07:00:26 pm » |
Indeed, "If it Ain't Broke... Don't Fix it". IMO
Doc
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
|