Announcement

Collapse
No announcement yet.

VDI-RODERICO

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by roderico View Post
    In my case, I'm using a generic 1602 display, similar to this:
    https://www.openhacks.com/uploadspro...one-1602a1.pdf
    and for the backlight it is only required +5V and usually the recommended resistor is given, anyway I'm not using the backlight...
    Hi Roderico!
    Reading your datasheet I can think you are using a chinese bulk 1602A.
    It is possible to found them in ebay at very low price.
    If you do a search in internet then you can found also this datasheet for the same LCD!
    LCDD-01-datasheet.pdf

    Therefore, are you sure that you are reading the right datasheet?
    There is printed a brand name on PCB?
    If you are not sure at 100%, it is better to use this datasheet.
    Going to page 11, 12, 13 and 14 you can found many informations.
    The voltage and current of backlight led are different and they depends from colours and not only.

    Using 5V without a resistor, also of some ohm, instead of 4,2V or less, can work the same but you risk to damage the led.
    1602A Yellow/Green array LCD has 4,2V with 100mA led,
    1602A White/Blue edge LCD has 3,4V with 20mA led,
    1602A Yellow/Green edge LCD has 3,9V with 20mA.

    To beginners:
    Who don't know the led then it is better to start from a bigger value and after reduce it, if the light is low.
    It is not important to rise the maximum light, if the luminous intensity is enough you reduce the battery consumption .

    Comment


    • #47
      Originally posted by roderico View Post
      Hi Sacchetti, to me it looks fine and would match the test firmware, however I would connect DB0-3 to GND and add a pull-up resistor to pin 1 (MCLR) -- 10K -- Vdd. The battery meter is just a voltage divider, if you are changing the resistor's value you might also add a 5.1V diode to protect the pic in case you make a mistake. If I'm not mistaken, using 10K for R10 would scale [12V-9V] to [4V,3V] while using R10 = 6K8 you'll have [3V,2.28V] the difference is small but safer and it is not required too much precision here, in any case you might be able to adjust the scaling factor in the menu without changing the code when using 10K. Although you save a pin connecting 12V directly to the voltage regulator would it be better than going from 8V to 5V? In any case with your current schematics the test firmware might work so please give it a try and then it can be fixed if it does not work. For the BL I might need to see but for the other pics there is no much space left...
      You wrote:
      "Although you save a pin connecting 12V directly to the voltage regulator would it be better than going from 8V to 5V?"
      Sorry, I didn't take it immediately.

      You are right, in MD as IDX, TGS, ELDO, etc. the 8V regulator is present.
      It is possible connect it to 8V because 78L05 has about 2V dropout.
      But you must use one wire more.

      The PIC plus the OpAmp plus the LCD absorb few mA then 78L05 doesn't heat up.
      However I prefer to check with a prototype.

      Comment


      • #48
        Originally posted by Sacchetti View Post
        Hi Roderico! About the "4 bit bus mode" the data line DB0-3 are not used. I have seen you are using an MCP1703 and an LCD without backlight. I think that both choices was done to reduce current consumption. But if your objective is to reduce the consumption to the minimum then you cann't connect DB0-3 to GND because you increase it. Every line source current and in a quantity that depends from technology used to build the chip. In many chinese datasheet this information is not present, however sometime it is present. As soon as I found one then I add this one in this thread to show you. However, I have found some chip to do -1uA for every line and some chip do -250uA or -500uA. You can check this using a good (fine) multimeter in the lower mA scale and connecting every pin to GND. At the end, for example, in the worst condition you have by useless -500uA x 4 = -2mA of consumption more!
        Hi Sacchetti, the reason to suggest to ground DB0-3 is to guarantee that their status is always in logical 0, however if you have found that it consumes 2mA more it is better not to ground them, since it appears not to cause any problem if they are not, I'll answer the other comments below..

        Comment


        • #49
          Originally posted by Sacchetti View Post
          Hi Roderico!
          About the pull-up resistor on MCLR, please read datasheet on page 124.
          It is better you download it directly from microchip to be sure we are reading the same and the last.
          You are right if the micro is configured for use POR, but I prefer to use PWRT or OST.
          In this case PWRT is enough for example.
          Doing in this way there isn't necessity to add the resistor.
          Therefore I am going to check the source code release 1.3 for 16F88 and 16F690 to see how is configured.
          With the pull-up resistor the MCLR is guaranteed that it is in logical 1 instead of floating which in some cases might cause some unexpected problems. In the other pics is disabled, this model is different but I couldn't find in the data sheet if it has an internal pull-up or not so you might not need to add a pull-up resistor. Also check
          http://microchipdeveloper.com/8bit:mclr
          I attached below the specific code I used for generating the test firmware for your pic in case you would like to change the configuration options (e.g. to enable PWRT) and do some other tests:
          Attached Files

          Comment


          • #50
            Originally posted by Sacchetti View Post
            Hi Roderico!
            I am looking the source code to understand how it is used the ADC and you are right!

            In this case the Vref is 5V and the end of scale using 20K/6K8 ratio is 19,4V.
            You have found this value in the file "mcu.h".
            This is the line:
            uint8_t g_adc_bat_scale = 0xC2;
            Therefore there calculating 19.4/26800*6800 we have about 4,922V.
            Using the code V1.3 there isn't modification to do using a battery voltage up to 19,4V and 20K/6K8 as R1/R2.

            But if we would obtain an end of scale of 20V then we must change the line in this way:
            uint8_t g_adc_bat_scale = 0xC8;
            Therefore there calculating 20.0/40000*10000 we have 5V.
            Then we can use my schematic with 30K/10K as R9/R10.
            This solution reduce the flow current in R9/R10 (they are R1/R2 in your schematic).
            The 30K resistor exist as E24 (5%) while as E96 (1%) we can found 30K1 but it is the same.

            Using 20K/10K the end of scale can be regulated to 15V but it is too low.
            Instead having 19,4V or 20V both end of scale are without the risk to damage the input pin, using a 12V battery.
            Therefore I have changed the value of R9 to 30K in my schematic but I prefer wait to publish it.
            I would like to test all before.

            You wrote:
            "Although you save a pin connecting 12V directly to the voltage regulator would it be better than going from 8V to 5V?"
            Sorry, please can you explain better?

            I am trying to recompile the code with the microchip C 8 bit compiler.
            Do you have used the free, the 60 days license, do you have bought the license or do you have used ... something else?
            g_adc_bat_scale can be changed in the menu so that the adc reading and the battery voltage match. This is necessary because of resistors tolerance as you mentioned and other components. If you are using different resistors than 20K/6K8 then the actual reading and the battery voltage would be very different but it might be calibrated with the menu (which changes g_adc_bat_scale). However it can be tuned in the firmware for your case with the value you calculated.
            I used the 60 days license for enabling the optimizations (I don't have much time left to expire) but as your pic has more space than the others there is no problem for using the free mode for testing.

            Comment


            • #51
              Originally posted by Sacchetti View Post
              Hi Roderico!
              Reading your datasheet I can think you are using a chinese bulk 1602A.
              It is possible to found them in ebay at very low price.
              If you do a search in internet then you can found also this datasheet for the same LCD!
              [ATTACH]39819[/ATTACH]

              Therefore, are you sure that you are reading the right datasheet?
              There is printed a brand name on PCB?
              If you are not sure at 100%, it is better to use this datasheet.
              Going to page 11, 12, 13 and 14 you can found many informations.
              The voltage and current of backlight led are different and they depends from colours and not only.

              Using 5V without a resistor, also of some ohm, instead of 4,2V or less, can work the same but you risk to damage the led.
              1602A Yellow/Green array LCD has 4,2V with 100mA led,
              1602A White/Blue edge LCD has 3,4V with 20mA led,
              1602A Yellow/Green edge LCD has 3,9V with 20mA.

              To beginners:
              Who don't know the led then it is better to start from a bigger value and after reduce it, if the light is low.
              It is not important to rise the maximum light, if the luminous intensity is enough you reduce the battery consumption .
              I bought some of them in ebay (Yellow/Green) and they are working fine for me and it only says 1602A on the PCB, however I'm not using the backlight thank you for the datasheet...

              Comment


              • #52
                Originally posted by Sacchetti View Post
                You wrote:
                "Although you save a pin connecting 12V directly to the voltage regulator would it be better than going from 8V to 5V?"
                Sorry, I didn't take it immediately.

                You are right, in MD as IDX, TGS, ELDO, etc. the 8V regulator is present.
                It is possible connect it to 8V because 78L05 has about 2V dropout.
                But you must use one wire more.

                The PIC plus the OpAmp plus the LCD absorb few mA then 78L05 doesn't heat up.
                However I prefer to check with a prototype.
                yes that was what I meant. It would be very good if you could test the firmware and check the code and/or if you find bugs and or have improvements would be also very good

                Comment


                • #53
                  Originally posted by roderico View Post
                  With the pull-up resistor the MCLR is guaranteed that it is in logical 1 instead of floating which in some cases might cause some unexpected problems. In the other pics is disabled, this model is different but I couldn't find in the data sheet if it has an internal pull-up or not so you might not need to add a pull-up resistor. Also check
                  http://microchipdeveloper.com/8bit:mclr
                  I attached below the specific code I used for generating the test firmware for your pic in case you would like to change the configuration options (e.g. to enable PWRT) and do some other tests:
                  Hi Roderico,
                  the pull-up resistor was used in the past with PIC having only POR.
                  This one (F876) has also PWRT and OST therefore is not more necessary if you use them.
                  You must connect the resistor only if you continue to use POR but it is worst, it is better to use PWRT or OST.
                  I prefer to attach the page where is explained.
                  page 124 of 16F876 datasheet.pdf

                  Comment


                  • #54
                    Originally posted by roderico View Post
                    Hi again, I adapted and recompiled the code using this pin configuration:

                    Analog inputs:

                    X -> RA0
                    Y -> RA1
                    BAT -> RA3

                    Switches:

                    SW1 -> RB3
                    SW2 -> RB2
                    SW3 -> RB1

                    LCD:

                    RS -> RC7
                    RW -> GND
                    EN -> RC6
                    DB0-3 -> GND
                    DB4 -> RB4
                    DB5 -> RB5
                    DB6 -> RB6
                    DB7 -> RB7

                    The attached file contains an unoptimized firmware only for testing, If I'm not mistaken it should work. It would be good if you could post the schematics for debugging using the above connections...
                    I am going to try to compile it...

                    Comment


                    • #55
                      Originally posted by roderico View Post
                      I bought some of them in ebay (Yellow/Green) and they are working fine for me and it only says 1602A on the PCB, however I'm not using the backlight thank you for the datasheet...
                      This datasheet is more reliable.

                      Comment


                      • #56
                        Originally posted by roderico View Post
                        yes that was what I meant. It would be very good if you could test the firmware and check the code and/or if you find bugs and or have improvements would be also very good
                        I agree.

                        Comment


                        • #57
                          Originally posted by Sacchetti View Post
                          I am going to try to compile it...
                          Hi!
                          I have compiled it using XC8 free license, therefore the code is unoptimized. I am going to update the licence to PRO.

                          I have also done some little corrections/modifications to code (also PWRT) but I can not put here the file because it is not tested yet.
                          Please wait a moment and I will publish all.

                          Therefore stay tuned...

                          Comment


                          • #58
                            Originally posted by roderico View Post
                            Hi Sacchetti, the reason to suggest to ground DB0-3 is to guarantee that their status is always in logical 0, however if you have found that it consumes 2mA more it is better not to ground them, since it appears not to cause any problem if they are not, I'll answer the other comments below..
                            Hi Roderico!

                            A little clarification.
                            I certainly did not explain it well.

                            Not all LCDs have pins that reach -500uA each if you connect them directly to GND.
                            I have found only a few who in certain conditions do so, others absorb less.
                            However on some datasheet is written but if you don't have it the only solution is check with a multimeter.
                            If you use a multimeter with min and max function then you can see also how change the current during the time.

                            Comment


                            • #59
                              Originally posted by Sacchetti View Post
                              Hi Roderico,
                              the pull-up resistor was used in the past with PIC having only POR.
                              This one (F876) has also PWRT and OST therefore is not more necessary if you use them.
                              You must connect the resistor only if you continue to use POR but it is worst, it is better to use PWRT or OST.
                              I prefer to attach the page where is explained.
                              [ATTACH]39823[/ATTACH]
                              Hi Sacchetti, in the other pics MCLR is disabled since it is not used, but they will work without the pull-up resistor, however in microchip forums they recommend to add it even if it is disabled, e.g.
                              http://www.microchip.com/forums/m786296.aspx
                              http://www.microchip.com/forums/m729356.aspx
                              I also found pic16f88 was more stable for weaker signals in the adc reading when adding the resistor, if you could do some tests would be very good...

                              Comment


                              • #60
                                Originally posted by Sacchetti View Post
                                Hi Roderico!

                                A little clarification.
                                I certainly did not explain it well.

                                Not all LCDs have pins that reach -500uA each if you connect them directly to GND.
                                I have found only a few who in certain conditions do so, others absorb less.
                                However on some datasheet is written but if you don't have it the only solution is check with a multimeter.
                                If you use a multimeter with min and max function then you can see also how change the current during the time.
                                thank you for the info, in the tests I did with my LCD I didn't find much difference but I'll see if I can check it more carefully...

                                Comment

                                Working...
                                X