Giter Club home page Giter Club logo

sduino_uno's Introduction

sduino UNO

The sduino UNO is an attempt at creating a mechanically and electrically Arduino-UNO-compatible development board based on the STM8S105K6 microcontroller. Both, mechanical and electrical design are to a notable degree based on the Arduino UNO board.

sduino UNO board

Components and silkscreen can be viewed in more detail in a picture of the component side and a picture of the back side of the assembled board.

Pin mapping

Number UNO pin name ATMEGA328 pin name STM8S105K6 pin name
0 IO0/RX PD0/RXD PD6/UART2_RX
1 IO1/TX PD1/TXD PD5/UART2_TX
2 IO2 PD2/INT0 PD7/TLI [TIM1_CH4]
3 IO3 PD3/INT1/OC2B PD2 (HS)/TIM3_CH1 [TIM2_CH3]
4 IO4 PD4/T0/XCK PD0 (HS)/TIM3_CH2 [TIM1_BKIN]/[CLK_COO]
5 IO5 PD5/T1/OC0B PD4 (HS)/TIM2_CH1 [BEEP]
6 IO6 PD6/AIN0/OC0A PD3 (HS)/TIM2_CH2/ADC_ETR
7 IO7 PD7/AIN1 PD1 (HS)/SWIM
8 IO8 PB0/ICP1/CLKO PC1 (HS)/TIM1_CH1/UART2_CK
9 IO9 PB1/OC1A PC3 (HS)/TIM1_CH3
10 IO10/SS PB2/NSS/OC1B PC4 (HS)/TIM1_CH4
11 IO11/MOSI PB3/MOSI/OC2A PC6 (HS)/SPI_MOSI
12 IO12/MISO PB4/MISO PC7 (HS)/SPI_MISO
13 IO13/SCK PB5/SCK PC5 (HS)/SPI_SCK
14 AD0 PC0/ADC0 PB0/AIN0 [TIM1_CH1N]
15 AD1 PC1/ADC1 PB1/AIN1 [TIM1_CH2N]
16 AD2 PC2/ADC2 PB2/AIN2 [TIM1_CH3N]
17 AD3 PC3/ADC3 PB3/AIN3 [TIM1_ETR]
18 AD4/SDA PC4/ADC4 PB5/AIN5 [I2C_SDA]
19 AD5/SCL PC5/ADC5 PB4/AIN4 [I2C_SCL]
20 AD6 -- --
21 AD7 -- --
22 AREF AREF PF4/AIN12
23 IO23 -- PC2 (HS)/TIM1_CH2
24 IO24/SS -- PE5/SPI_NSS
-- RESET NRESET NRST
-- -- PB6/TOSC1/XTAL1 PA1/OSCIN
-- -- PB7/TOSC2/XTAL2 PA2/OSCOUT

For evaluation purposes, most of the sduino UNO's functionality can be imitated with an STM8-DISCOVERY board and a USB to Serial converter, as described in this document.

Differences

The following paragraphs highlight the most important differences between Arduino UNO and sduino UNO.

Mechanical

The gap between the upper socket strips has been reduced from 0.06 to 0.05 inches. This should not significantly impact mechanical compatibility with Arduino UNO shields and increases the available radius around the center of the upper left M3 mounting hole from 2.286 to 2.54 millimeters, which should be just enough to fit in a standard M3 spacer (5mm wrench).

Electrical

Most importantly, the sduino UNO can be switched between 5V and 3.3V operating voltage. The RX and TX LEDs are connected to the RX and TX lines (IO pin 0 and 1, respectively) via 1k resistors, rather than to the USB interface chip.

Functional

Like many Arduino UNO clones, the sduino UNO uses a CH340G USB to serial converter instead of an Atmega16U2 for communication with the host PC. The USB interface Chip therefore cannot be repurposed as a coprocessor or keyboard/mouse simulator.

There is no analog comparator in the STM8S105K6 microcontroller and AREF is actually an additional analog input. Its use as reference voltage for A/D conversion has to be imitated in software. IO11 has no hardware PWM functionality for analog_write, IO8 and IO4 have. IO2, AD0, AD1 and AD2 can be used as PWM outputs via alternate function mapping.

Likewise, IO10 does not serve as hardware-slave-select line for the SPI bus. This, however, can mostly be overcome by software-emulation, because the STM8 allows for slave-select to be controlled in software, e.g. in an interrupt handler. The actual slave-select line has been made available via an exra pin.

Software

Unfortunately, there is no free C++ compiler available for the STM8 platform, yet. The Arduino language along with the large pool of existing Arduino sketches can therefore not be used without modifications.

Fortunately, there is the C-based sduino library that in fact inspired the creation of the sduino UNO and that this board borrows its name from. By using the sduino library, the changes required to run many exsting Arduino sketches on an STM8 platform can be kept within manageable bounds.

Possibilities to bring C++ support to the STM8 platform with a free compiler are being evaluated.

Copying

Even though the sduino UNO CAD files have been created from scratch and the design is not identical, to avoid legal ambiguity, the CAD files for the sduino UNO board are released under the same creative commons license as those of the Arduino UNO board:

This work is licensed under the Creative Commons Attribution-ShareAlike 2.5 Generic License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

sduino_uno's People

Contributors

roybaer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sduino_uno's Issues

comments on the schematic and PCB

This looks amazing! I am looking forward to see the first prototypes!

Looking at the schematic I would like to comment on the hardware:

  • to initially program a serial bootloader it would be very handy to have a ST-Link compatible 4-pin SWIM connector. I suggest using the same pinout as used for the stm8sblue PCB: RST, GND, SWIM, MCUVCC
  • The serial connection between the CH340 and the CPU looks weired to me. Really through the LEDs? Maybe the pins RN2-2 and RN2-3 are supposed to connect to MCUVCC and the IO0/RX and IO1/TX labels should be connected to RN3-7 and RN3-8?
  • it might be useful to be able to open the connection between CH340/TXD and STM8/RxD in case the pin is used as an output pin. Solderbridge? Jumper?
  • Does J2 really connects to RESET two times? Maybe RESET and GND?
  • I am not sure if Q1 is always guaranteed to connect USBVCC to +5V if UIN is not present. U5 is not powered before Q1 is active, but Q1 can't be active before U5A outputs a valid signal. Possible deadlock? Maybe use the unused resistor RN1/3-6 to pull Q1/G to GND?

If you are planning to develop this design further into a commercial product it might be worth to:

  • add decoupling filters to VBUS and DC to reduce EM emissions (ferrite beards 220r@100MHz and 1nF+100nF capacitors)
  • additional ESD protection on the USB port might be useful

general:

  • for people not familiar with kicad it might be convenient to add the schematic as pdf to the repository

PCB:

  • a GND guard ring from pin 4 around Y2 and the clock signals would help a lot with the EM values.
  • the via for SCL under Y2 might connect to the crystal housing after assembly
  • SDA is a very sensible signal, but it is routed right under Y2, even on the top side. Might cause malfunctions in I2C communication later.
  • rearrage C1, C2 and Y1 is in Atmel application note AVR186

IMHO it would be worth the effort to move Y2 closer to the CPU and get the I2C signals out of the way. It might help to use a smaller cyrstal. E.g. the FA-238 series in size 3225. The price difference to a HC49-type is only a few cents. Resonators with integrated capacitors are another option, e.g. AVX PRQC series or Abracon AWSCR series

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.