Viewing 8 posts - 1 through 8 (of 20 total)
  • Author
    Posts
  • #9933
    piero55
    Participant

    I'm making a timer for a particular application. I have to run a small 12V pump for “n” times a day for a while “m”. So far no problem. Without using an RTC, I wanted to keep the PIC working even in the absence of the 230V network. Or, the clock must work properly by keeping only the PIC powered in order not to use a too large battery. I will be using PROTON Basic and the question I wanted to ask is the following: when the power is cut off, the PIC continues to work safely then the clock continues counting. When the network returns, power returns to the whole circuit but, I think, of having to reinitialize only the LCD. E’ feasible with PROTON? Of course with an RTC like the DS1307 I wouldn't have this problem but it would make the program itself very complicated.

    #9935
    Picmicro675
    Moderator

    Perhaps we need to study how to send commands to the display. To send a byte the command is used Print $FE, then I think you should see what byte to send to reset the LCD.
    I know about these commands

    $define DisplayOff Print $fe,$08
    $define DisplayOn Print $fe,$0c
    $define CursorOff Print $fe,$0c
    $define CursorBlink Print $fe,$0f
    $define BackLight_On Print $fe, 3                  ' dipende se usato con interfaccia I2C
    $define BackLight_Off Print $fe, 4

    I think for the reset it is Print $fe,$01
    Trying to interpret the source of arduino, it seems that you have to send 3 times it $03, interspersed with 4,5 milliseconds.

    #9939
    piero55
    Participant

    Thank you, as soon as I have time, I'll try.

    #9945
    Picmicro675
    Moderator

    I also asked the proton basic forum. You see who

    #9960
    piero55
    Participant

    Thanks for everything, interesting information.
    I had already used the system to keep the pic and lcd powered precisely because of the problem of initializing the LCD, but this time I want to move on to something different. I think the DS1307 is the best solution and am experimenting with it. I have never used it and having some in the drawer, I got to work: on the site for PROTON, I've found some examples of how it works and I'm playing with them. I just noticed that the simulation is very slow, it's normal?

    #9962
    Picmicro675
    Moderator

    For the display it is convenient to be able to disable it and also remove the backlight. For the water filter I did this (apart from the one on Arduino), then I left a white LED pointed at the Plexiglas that tells me if everything is on. Not very visible during the day..

    With the simulator sometimes you go at the speed of milliseconds as if they were seconds. I don't know exactly what that slowdown could be, It is likely that adding discrete components will take longer to do the calculations. If by chance you use resistors only for on / off then maybe in the properties you can put the digital format. Then eventually exclude certain parts from the trivial simulation. Maybe you put the battery and the quartz on the DS1307 which don't count in the simulation.
    You can make a diagram for the simulation and one for the development of the printed circuit. The second would perhaps be the one that produces the slowdowns.

    #9964
    piero55
    Participant

    For slowing down in the simulation, I meant by proteus. Instead for debugging always with proteus, the program does not read the ds1307. A little bad, i have already made the circuit on breadboard and everything is fine.

    #9966
    Picmicro675
    Moderator

    I have not had the opportunity to test A DS1307 on the simulator, but with the DS3232 there are no problems. Maybe you could try another RTC enough to try the rest of the program.

Viewing 8 posts - 1 through 8 (of 20 total)
  • You must be logged in to reply to this topic.