-
Notifications
You must be signed in to change notification settings - Fork 0
My AVR code.
License
DevxMike/avr
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
I`m creating some libraries helpful to use while programming AVR uC. At work: -LED_4x4_DISP (with shift register, hope it`s gonna work somehow :D) Already done: -LCD_DISP{ lib for hd44780 LCD display (I`m proud of this one), 4-bit interface This library allows you to properly initialize the display and get it working. Functionality: write_byte(uint8_t); - write a byte to the display function calls write_half(uint8_t); twice to send one byte read_byte(void); - read a byte from the display`s memory (DDRAM or CGRAM, you have to locate it before read), function calls read_half(void); twice to read one byte from memory locate_ddram(uint8_t, uint8_t); - change location of actual cursor`s position in ddram. Each for read or write. locate_cgram(uint8_t); - change location of actual cursor`s position in cgram (helpful when defining your own patterns) write_to_cgram(uint8_t, const uint8_t*, uint8_t); - write your own pattern to cgram void write_data_byte(char); - write a single char to dd/cgram void write_string(char*); - write whole string to ddram uint8_t busy_flag(void); - get busy flag value uint8_t read_data(void); - read and return byte of data void write_instruction(uint8_t); - send command to the display } -LED_4x4_DISP{ common anode LED display In this simple library, I`m using 8-bit timer/counter to generate interrupts with certain frequency (didn`t calculate it, value at a guess). When the interrupt occurs, the variable that holds the actual anode set to 1 is shifted to the left, anode is set to 0 (it`s no longer active), and the next one in a row is set to 1. Before this procedure, the value of kathode port register is properly set to display desired value. Each segment is able to display val in range from 0 to 9 in decimal. Some day I`m gonna make displaying hex vals possible. }
About
My AVR code.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published