Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - thesko

Pages: 1 2
1
Hey Ben!

Glad to get an answer :)
So to make sure I got it right:
Code: [Select]
Bat+
 |
[1M ohm]
 |
 |--> Analog A4
 |
[1M ohm]
 |
GND

If that is the case I could hack it into the board I have here and use the example from here to read it:
https://tinycircuits.com/blogs/learn/tinyscreen-battery-voltage


About the bootloader:
I have a CP2102 USB to TTL converter, but in any case, since the TinyScreen+ does not have any visible headers for a programmer I fear this will be too risky just for getting a bootloader screen :P
Getting the battery readout is all I really needed compared to the previous version.

So if you can verify my ASCII diagram above I'm good :)

EDIT: I just realized that the schematics were attached to this post:
http://forum.tinycircuits.com/index.php?topic=1779.msg3786#msg3786

Cheers and thanks!
Andreas

2
New Product Ideas / Tiniest possible arduino
« on: July 12, 2018, 10:31:07 AM »
Recently I've discovered this design for a 0.4" x 0.4" arduino compatible board:
https://hackaday.io/project/3117-a-even-smaller-nanite

My proposal:
  • a similarily sized Tinyduino, possibly powered by a small battery cell
  • a neopixel addon board which can be soldered to the bottom side of the board (using spacers)

3
still no answer...  :( I guess there is no way to do this?

4
Tiny Arcade & Pocket Arcade / Re: Truly Random Numbers
« on: July 10, 2018, 05:34:00 AM »
I haven't deeply looked into it yet but will need that too...
My current approach is to use analogRead(0)+analogRead(1)+millis().

My only idea for now was to change millis() for micros(), but in my case I set the seed in setup().
And since it should take exactly the same amount of cycles each time I fear my random will not be very random :/

Cheers
the_sko

5
Also those standard beginner tutorials should mention the bootloader key-combo for the specific device.
I had quite a lot of trouble uploading my first sketch to the TinyScreen+ until I found the note on the product page for the reset.

6
Hi John,

I'm myself pretty new to the TinyCircuits hardware, but knowing from my TinyScreen+, these devices have a bootloader mode that you can reach to upload sketches regardless of what is uploaded right now.

For your case with TinyArcade I've found the following post by Ben that might be helpful for you and your son:
http://forum.tinycircuits.com/index.php?topic=1676.msg3157#msg3157

TL;TR:
 - Set your Arduino IDE to "Internal 32KHz Oscillator" (should be in the build menu)
 - switch the Arcade off, then while pressing both buttons, switch it back on

Usually this should show up a black screen with a white text saying someting about "Bootloader Mode"

Note: Even if the screen is still black at that stage, try uploading anyway.
One of four TinyScreen+ I own have a different bootloader and do not show that text screen, while still being in the bootloader mode.

Cheers
Andreas

7
I have the exact same problem! Nothing happens beyond rf22.init();

I have also tried the code from the football example:
https://tinycircuits.com/blogs/learn/121634375-football-play-calling-watch-tutorial

But here the lockup also happens on manager.init()

EDIT:
This also happens with all TinyScreen code removed (even the include), so I assume a hardware/pin issue?

@Ben: Any idea what is going on? Is the LORA board incompatible with the TinyScreen+?
If so, I have wasted money on those chips that instead I could have put into alternatives :(((


EDIT2:
Ok I have no clue what changed over night, but today the same code just works....  :o
Here is the Example I'm using for the TinyScreen+

Important: I'm using the latest version of RadioHead available on their site!

Code: [Select]
#include <Wire.h>
#include <SPI.h>
#include <RHReliableDatagram.h>
#include <RH_RF22.h>

//#define NOSCREEN

#ifndef NOSCREEN
#include <TinyScreen.h>
TinyScreen display = TinyScreen(TinyScreenPlus);
#endif

//define the address
#define CLIENT_ADDRESS 1

bool started = false;

RH_RF22 driver(7,3);
// Class to manage message delivery and receipt, using the driver declared above
RHReliableDatagram manager(driver, CLIENT_ADDRESS);


// This function gets the battery VCC internally, you can checkout this link
// if you want to know more about how:
// http://atmel.force.com/support/articles/en_US/FAQ/ADC-example
float getVCC() {
  SYSCTRL->VREF.reg |= SYSCTRL_VREF_BGOUTEN;
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->SAMPCTRL.bit.SAMPLEN = 0x1;
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->INPUTCTRL.bit.MUXPOS = 0x19;         // Internal bandgap input
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->CTRLA.bit.ENABLE = 0x01;             // Enable ADC
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->SWTRIG.bit.START = 1;  // Start conversion
  ADC->INTFLAG.bit.RESRDY = 1;  // Clear the Data Ready flag
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->SWTRIG.bit.START = 1;  // Start the conversion again to throw out first value
  while ( ADC->INTFLAG.bit.RESRDY == 0 );   // Waiting for conversion to complete
  uint32_t valueRead = ADC->RESULT.reg;
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  ADC->CTRLA.bit.ENABLE = 0x00;             // Disable ADC
  while (ADC->STATUS.bit.SYNCBUSY == 1);
  SYSCTRL->VREF.reg &= ~SYSCTRL_VREF_BGOUTEN;
  float vcc = (1.1 * 1023.0) / valueRead;
  return vcc;
}

// Calculate the battery voltage
float getBattVoltage(void) {
  const int VBATTpin = A4;
  float VCC = getVCC();

  // Use resistor division and math to get the voltage
  float resistorDiv = 0.5;
  float ADCres = 1023.0;
  float battVoltageReading = analogRead(VBATTpin);
  battVoltageReading = analogRead(VBATTpin); // Throw out first value
  float battVoltage = VCC * battVoltageReading / ADCres / resistorDiv;

  return battVoltage;
}

void setup()
{
  Wire.begin();
  SerialUSB.begin(9600);
  // give 5 sec to connect the serial monitor
  delay(5000);
 
#ifndef NOSCREEN
  display.begin();
  display.setFlip(true);
  display.setBrightness(15);
  display.clearScreen();
  display.setFont(thinPixel7_10ptFontInfo);
 
  display.fontColor(TS_8b_White, TS_16b_Black);
  display.setCursor(0, 0);
  display.print("TinyLORA starting..");
#endif 
  SerialUSB.println("starting rf22..");
  started = manager.init();
  if (started)
  {
#ifndef NOSCREEN
    display.setCursor(0, 10);
    display.print("TinyLORA started.");
#endif
    SerialUSB.println("..started.");
    delay(2000);
    display.clearScreen();
  }
  else
  {
#ifndef NOSCREEN
    display.setCursor(0, 10);
    display.print("init() failed!");
#endif
    SerialUSB.println("init() failed!");
  }
}

void loop()
{
  if (!started) return;
   
  uint8_t buf[RH_RF22_MAX_MESSAGE_LEN];
  // Send a message to manager_server2
  #define SERVER_ADDRESS 2
  uint8_t len = sizeof(buf);

#ifndef NOSCREEN
  display.fontColor(TS_8b_White, TS_16b_Black);
  display.setCursor(0, 0);
  display.print("Sending:");
  display.setCursor(0, 10);
#endif
 
  uint8_t data[2];
  int voltage = getBattVoltage() * 100;
#ifndef NOSCREEN
  display.print(voltage);
#endif
  data[0]=voltage>>8;
  data[1]=voltage;
  if (manager.sendtoWait(data, sizeof(data), SERVER_ADDRESS))
  {
    uint8_t from;
    //check if we received a reply
    if (manager.recvfromAckTimeout(buf, &len, 2000, &from))
    {
      SerialUSB.print("got reply from : 0x");
      SerialUSB.print(from, HEX);
      SerialUSB.print(": ");
      SerialUSB.println((char*)buf);
#ifndef NOSCREEN
      display.setCursor(0, 20);
      display.print("Received:");
      display.setCursor(0, 30);
      display.print((char*)buf);
#endif
    }
  }
  delay(10);
}

8
Hey Ben, thanks for the reply!

Since I was unable to order your batteries to Germany I will have to check if the once am using right now also have such a protection, but I fear not.

In that regard, I suppose there is no way to trigger a shutdown via code of the whole device, is there?
If not, my approach would be this:
< 3.5V = Disable all logic and render a "final" (low battery) image to the tiny screen
< 3.3V = call display.off()

Are there any other steps I should consider for reducing total power usage to a minimum? Are there any sleep states available for the chip that are compatible with the Tinyduino system?

Cheers and kind regards
Andreas

9
Any infos on this @TinyCurcuits team?

I also realized that my second TinyScreen is unable to read the battery state using the new tutorial.
Is it possible that I have two different hardware revisions?
And if so, is it possible to update also the hardware somehow for the voltage reading?

Please help!
- the sko

10
Hi,

After implementing the battery voltage read-out from https://tinycircuits.com/blogs/learn/tinyscreen-battery-voltage
I noticed that the TinyScreen keeps running even on a very low battery level (below 3.5V).

Is there a threshold built into the board that shuts it off after reaching a critical voltage, or does it run until it falls below 3.3V due to being out of power?
Is that ok for the battery life or should we implement some kind of shutdown on a different voltage level?

Cheers
thesko

11
TinyDuino Processors & TinyShields / Re: Tinyscreen+ Vbat reading
« on: June 19, 2018, 04:22:32 AM »
Works like a charm!! Now I just have to find the fitting values for a battery display with my configuration/power consumption :)

Thanks a lot!

12
TinyDuino Processors & TinyShields / Re: Tinyscreen+ Vbat reading
« on: June 15, 2018, 07:19:41 AM »
That is awesome news! I can really make use of this for my current project! Thanks for the update  :)

13
New Product Ideas / TinyScreen++
« on: June 08, 2018, 05:56:28 AM »
Hey folks,

first of all, thanks for these great products :)
So my suggestion would bascially be this:
  • TinyScreen+ with the upcoming mini connector
  • onboard eeprom (as an option maybe?)
  • Sharp Color ePaper (like in Pebble Time)

The important part here is the sharp color display.
The ePaper display is not the same as an eInk display. It features a normal refresh rate like LCDs but still comes with a very low power consumption on static images and good daylight visibility. Because of that it requires backlight for visibility in darkness.

It was used on the pebble time and any product after that, featuring good refresh rates, low power usage, and I think also 16 bit colors.

I could not find it on the sharp website, but might be worth a call or mail to ask for pricing and possibilities. The display itself should not be bigger than the wifi Tinyduino board.

14
Hm sounds like the TinyScreen board. Did you try the bootloader mode?
Quote
If you were able to upload a sketch to the TinyScreen+ and now it does not respond, you may need to force this into bootloader mode. To do this, power off the TinyScreen+ using the slide switch. Plug the USB cable into the TinyScreen+ and your computer. Then press and hold the button closest to the USB connector while sliding the switch to the ON position. Then try uploading your program to the TinyScreen+ and it should work. You may need to try this several times if it does not work the first time.

15
Hi,

I have two TinyScreen+ for my project, but it looks like both are running a different version of the bootloader.
When I go into the bootloader mode on both, one of them shows a black screen, while the other prints a text like "Bootloader Mode".

Is there an easy way of getting access to the latest bootloader and updating the tinyscreen with it?
It's just difficult to make out if the Tinyscreen is running in Bootloader mode of being turned off when there is nothing on the screen.

Cheers
thesko

Pages: 1 2
SMF spam blocked by CleanTalk