News:

The Savage///Circuits website has been upgraded to a more efficient theme.

Main Menu

Back To The CrowPanel Handheld Computer

Started by granz, Sep 10, 2025, 12:46 PM

Previous topic - Next topic

granz

Well, in my first response (#1,) I showed the program, and it does close the data file, just before printing the date and time on the screen. So, I'm not sure what is going on there.

I just plugged it in, and here is the newly rewritten program:
Date$ = "01-01-2000"
Time$ = "00:00:00"

Do
  Open "b:test-time.dat" For append As #1
  Print #1, Date$, Time$
  Close #1
  Pause 300000 ' Delay for five minutes
Loop
This is basically the same as the above program - missing the display onto the screen.

Since, I had let the battery die, I will leave it plugged in until tomorrow to fully charge the battery. Then I will unplug it and immediately start the program. Hopefully, this will give us something with which to work on finding the troubles.

Chris Savage

Okay, so I guess I am wondering...did you see the time / date stuff being printed more than three times before it died before? I guess what I am wondering is, was the program actually running two or three hours later?

                     Bringing concepts to life through engineering.

granz

Oh, it wasn't running that program. I just let the battery die, so that I could store it more safely. I'll get the experiment started tomorrow.

granz

Okay, I let the program run for a while and then broke it. It showed six entries in the data file.

So, I added a bit of niceness to give a count of how long the thing has been running:
> list
Date$ = "31-12-1999"
Time$ = "00:00:00"

cnt = 0 ' Number of minutes program has been running

Do
  Open "b:test-time.dat" For append As #1
  Print #1, Date$, Time$
  Print #1, "Running for "cnt" minutes."
  Print #1, "----------------------------------------"
  Close #1
  cnt = cnt + 5
  Pause 300000  ' Delay for five minutes
Loop
>
(If is ain't broken, keep playing with it until it is. :P )

I'll let it run for a bit to make sure that it works, then I will run it, and unplug the power. We shall see how long the battery lasts - without any power-saving efforts, like shutting off the screen.

Chris Savage

I'm guessing that there's no way, programmatically, to determine when it is running on battery versus mains?

                     Bringing concepts to life through engineering.

granz

Quote from: Chris Savage on Aug 07, 2026, 08:15 AMI'm guessing that there's no way, programmatically, to determine when it is running on battery versus mains?
I was going to say, no. But then I remembered that the Pico, itself, can read the incoming voltage. It took a while, but looking at the schematic (https://www.elecrow.com/download/product/DIS01135P/CrowPanel_Pico_Display-3.5_V1.0-SCH.pdf,) there is VBAT going to pin GP29 on the RP2040. That is the pin on the Pico that let's the chip read the incoming voltage.

When the experiments end, I will test out that voltage reading, and see if a program can tell if the power is applied, or it is running on battery.

Chris Savage

Quote from: granz on Aug 07, 2026, 08:18 PMWhen the experiments end, I will test out that voltage reading, and see if a program can tell if the power is applied, or it is running on battery.

I was also thinking about having the program suspend when the battery gets below a certain point. I've done something similar on some Z80 systems I built back in the 90s.

                     Bringing concepts to life through engineering.

SMF spam blocked by CleanTalk