/ circuitpython

Microcontroller Monday - Serpente

CircuitPython slithers onto a new board, but this board looks a bit familiar!

If you like what you read...

Would you like to buy me a cup of coffee? It helps me to pay for hosting this blog, and to buy stuff to hack from Poundshops / Dollar Stores which are used in free projects on this blog. Thanks!

So what is it?

Screenshot-from-2019-09-30-11-38-34
Serpente is a tiny CircuitPython prototyping board from arturo182 on Tindie.
It looks very similar to an ATTINY85, which is why I picked up two of them from arturo182 store.

Serpente-Attiny85-1
I bought a USB C version, here next to a micro USB ATTINY85 for comparison.

Serpente-Attiny85-2
And I bought a USB A version, again next to the equivalent ATTINY85.

pinout
The pinout for Serpente is almost the same as an ATTINY85 but each of the 6 GPIO pins are both analog and digital! We also have SPI and I2C as well as 2 serial ports. All of the pins are PWM too! From such a tiny board.

So why is this better than an ATTINY85?

Firstly it is a lot easier to use. As it uses Circuit Python we can use a code editor such as Visual Studio Code or for those new to coding we can use Mu which comes with CircuitPython compatibility baked in! and using these editors we can write code directly to the board as if it were a USB flash device. Just save some code as code.py and Serpente will reset and run the code.

Secondly Serpente is much more powerful when compared to an ATTINY85.

ATTINY85

  • AVR MCU, 8K FLASH, 512B RAM, SPI.
  • Controller Family/Series:AVR Tiny.
  • Core Size:8bit.
  • No. of I/O's:6.
  • Program Memory Size:8KB.
  • EEPROM Memory Size:512Byte.
  • RAM Memory Size:512Byte.
  • CPU Speed: 8/16 MHz internal clock, up to 20MHz external clock.

Serpente

  • ATSAMD21E18A 32-bit Cortex-M0+ running at 48MHz
  • 256KB flash and 32KB RAM
  • 4MB Flash for storing files and CircuitPython code
  • 6 highly customizable GPIOs
  • 250mA LDO
  • 3.3V logic and power
  • Powered either from USB or external source
  • User-controlled RGB LED

So what did I do to test it?

I made a quick and simple button and LED project.
You press the button and the LED will flash for a certain number of times.
Here is the code.

import board
from digitalio import DigitalInOut, Direction, Pull
import time

led = DigitalInOut(board.D0)
led.direction = Direction.OUTPUT

button = DigitalInOut(board.D1)
button.direction = Direction.INPUT
button.pull = Pull.UP

while True:
    if button.value == 0:
        for i in range(10):
            led.value = True
            time.sleep(0.2)
            led.value = False
            time.sleep(0.2)
        time.sleep(0.1)

And here is the circuit that I built. Many thanks to arturo182 for the Illustrator file.
Serpente-1

So is it any good?

Yes! I have quite a few CircuitPython boards, from Gemma M0 to the PyPortal. But the Serpente is a good buy. We have enough GPIO pins and they offer so many different options (analog, PWM, I2C, SPI, Serial) that we can drop this tiny board into a project and let it do many different things. Much more than the humble ATTINY85.

So where can you get one?

Screenshot-from-2019-09-30-11-38-34
Head over to arturo182's store and grab one.