Giter Site home page Giter Site logo

stm8-hd44780's Introduction

Simple small HD44780 LCD library for STM8

Files:
=====
	main.c - test and demo

	delay.h - delay functions
	hd44780.c - implementation
	hd44780.h - header

	readme - this file
	COPYING - licence

Example compilation:
=====	
	$ make clean && make && make flash

flash target assumes you are using stlinkv2 programmer. Should you use another
version, modify the Makefile to your needs.

The example should print a message to the display. Tested on STM8S-DISCOVERY dev kit. 

Connections:
	Connections are redefinable as long as the whole data bus is on the
	same port. This was chosen to make the code more compact and smaller.

	E     - PD0
	RS    - PD1
	D4-D7 - PD2-5

Usage:
=====

Include hd44780.h and delay.h in your code, add the c file to the build
path. Define F_CPU_K as CPU speed in KHz. Note that in this project the macro is defined in the Makefile!

delay.h contains LibC-AVR style functions _delay_ms() and _delay_cycl(), and 
a macro _delay_us(). All three let you use a variable as a parameter, in contrary to LibC-AVR.

I found sdcc can do *weird things* with those so always check the corresponding .asm file. A badly expanded macro may result in calls to word mul and div, which take extra amount of time!

Happy hacking!

stm8-hd44780's People

Contributors

polprog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vult0306

stm8-hd44780's Issues

Clean up test expressions

` uint8_t a = 98;

PB_DDR = 0xFF;
PB_CR1 = 0xFF;`

Those are test lines that were left by me when testing SDCC code generation, they aren't necesary here.

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.