Code Monkey home page Code Monkey logo

blackboard-stc15's Introduction

blackboard-STC15

A firmware for STC15L2K32S microcontroller on Black Board T5 ESP-13

Use SDCC to compile

Use STC MCU ISP flash tool to programm

Install both sdcc and stcgal per instructions (or use distribution packages for sdcc)

Programming the MCU is via a USB to serial converter connected to connector 3P, the BetaBlack MCU programming pins on /dev/ttyUSB0 Modbus communications is via the alternative pins connected to the ESP8266 via jumpers. These jumpers can be removed and a second USB to Serial converter used for testing via /dev/ttyUSB1. Refer here for MCU connection details.

cd blackboard-STC15
make
make install # will download to the MCU

Build the modbus-master program for testing communication

make modbus-master

Build ESP8266 code Use Arduino ESP8266 generic

  • Open blackboard-ESP8266
  • Edit SSID.h to suit your wifi network
  • Remove the bridges between the WFI_GND, WFI_TX and WFI_RX
  • Connect ESP8266 to USB-Serial converter to the WFI side (USB RX -> WFI_TX and vice versa)
  • Bridge jumper WiFi_0 to enable ESP8266 programming mode
  • Power on the BetaBlack
  • Upload to the ESP8266
  • Power off the BetaBlack
  • Remove the USB serial and re-insert the bridges
  • Power on the BetaBlack
  • The ESP8266 will join your network and your DHCP will give it an address. You need to find the IP address it has joined as by looking at your router for address allocations
  • curl http://your_ip_address (Gives the current register values)
  • curl http://your_ip_address/status (Gives the modbus comms status)
  • curl http://your_ip_address/relayon
  • curl http://your_ip_address/relayoff
  • curl http://your_ip_address/beepon
  • curl http://your_ip_address/beepoff

What it supports for now:

  • STC15 UART (baudrate: 115200)
  • Reading on-board DHT11 values
  • One-wire communications (DS18B20 temp sensor) via P1.5 (pin 4 of 5-pin header)
  • I2C communications via pins 2 and 3 (SDA/SCL) of 5-pin header (tested with BH1750 light sensor)
  • Using PWM to flash on-board RGB LEDs
  • On-board beeper
  • On-board relay
  • Second uart for communicating with the ESP8266
  • MCU Modbus client communication to read/write some of the peripherals based on https://github.com/angeloc/simplemodbusng
  • Linux modbus-master test program based on libmodbus for bypassing the ESP8266
  • Implement a timer to power off the ESP8266 by the STC15
  • Implement modbus master in ESP8266 for read state of MCU peripherals
  • Implement writes to the beeper and relay over http

TODO

  • Control the LEDs via http

blackboard-stc15's People

Contributors

darrylb123 avatar qalex avatar

Stargazers

Gerard Braad avatar Ziga Stegu avatar Jens J. avatar Matthew Hilton avatar Costin Stroie avatar  avatar

Watchers

 avatar James Cloos avatar Matthew Hilton avatar  avatar  avatar  avatar

blackboard-stc15's Issues

Unable to Compile

I'm having trouble compiling. I'm using a RPi with Debian Jessie.
Here is the error after editing the makefile to used sdcc instead of sdcc-sdcc

sdcc -c main.c
delay.h:7: syntax error: token -> 'Delay2' ; column 18
Makefile:13: recipe for target 'main.rel' failed
make: *** [main.rel] Error 1

Here is the output from the sdcc-v command

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8                    3.4.0 #8981 (Jul 11 2014) (Linux)
published under GNU General Public License (GPL)

I have also tried compiling on windows via cygwin, however i get a different error.

sdcc -c main.c
main.c:20: error 98: conflict with previous definition of 'putchar' for attribute 'type'
from type 'int function ( int fixed) fixed'
  to type 'void function ( unsigned-char fixed) fixed'
Makefile:13: recipe for target 'main.rel' failed
make: *** [main.rel] Error 1

Windows is using the following version

sdcc -v
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.6.5 #9842 (MINGW64)
published under GNU General Public License (GPL)

I have managed to get it to compile under windows by commenting out the putchar function in main.c but i think this has broken something else.

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.