lcd display IIC 1602 with atmega328p

Go To Last Post
54 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When i try this code for test LCD display IIC 1602, on atmega328p arduino.


#define F_CPU 16000000UL
#include 
#include 
#include 
#include "lcd.h"

int main (void)
{
	//Set PORTC to all inputs
	DDRC = 0x00;
	PORTC = 0xFF; //Pull-up
	sei();
	lcd_init();

    lcd_clrscr();
    lcd_puts_P("I2C demo 0.1");
	while(1);
}

I got this error: lcd.h no such file or directory.
But i add the this libraries

lcd.h library

#ifndef LCD_H
#define LCD_H

/*************************************************************************
 Title:     C include file for the HD44780U LCD library (lcd.c)
 Author:    Peter Fleury   http://jump.to/fleury
 File:      $Id: lcd.h,v 1.4 2012/06/01 06:00:34 mmdolze Exp $
 Software:  AVR-GCC 3.3
***************************************************************************/

#if (__GNUC__ * 100 + __GNUC_MINOR__) < 303
#error "This library requires AVR-GCC 3.3 or later, update to newer AVR-GCC compiler !"
#endif

#include 
#include 

/**
 * Definitions for LCD command instructions
 * The constants define the various LCD controller instructions which can be passed to the
 * function lcd_command(), see HD44780 data sheet for a complete description.
 */
/* instruction register bit positions, see HD44780U data sheet */
#define LCD_CLR               0      /* DB0: clear display                  */
#define LCD_HOME              1      /* DB1: return to home position        */
#define LCD_ENTRY_MODE        2      /* DB2: set entry mode                 */
#define LCD_ENTRY_INC         1      /*   DB1: 1=increment, 0=decrement     */
#define LCD_ENTRY_SHIFT       0      /*   DB2: 1=display shift on           */
#define LCD_ON                3      /* DB3: turn lcd/cursor on             */
#define LCD_ON_DISPLAY        2      /*   DB2: turn display on              */
#define LCD_ON_CURSOR         1      /*   DB1: turn cursor on               */
#define LCD_ON_BLINK          0      /*     DB0: blinking cursor ?          */
#define LCD_MOVE              4      /* DB4: move cursor/display            */
#define LCD_MOVE_DISP         3      /*   DB3: move display (0-> cursor) ?  */
#define LCD_MOVE_RIGHT        2      /*   DB2: move right (0-> left) ?      */
#define LCD_FUNCTION          5      /* DB5: function set                   */
#define LCD_FUNCTION_8BIT     4      /*   DB4: set 8BIT mode (0->4BIT mode) */
#define LCD_FUNCTION_2LINES   3      /*   DB3: two lines (0->one line)      */
#define LCD_FUNCTION_10DOTS   2      /*   DB2: 5x10 font (0->5x7 font)      */
#define LCD_CGRAM             6      /* DB6: set CG RAM address             */
#define LCD_DDRAM             7      /* DB7: set DD RAM address             */
#define LCD_BUSY              7      /* DB7: LCD is busy                    */

/* set entry mode: display shift on/off, dec/inc cursor move direction */
#define LCD_ENTRY_DEC            0x04   /* display shift off, dec cursor move dir */
#define LCD_ENTRY_DEC_SHIFT      0x05   /* display shift on,  dec cursor move dir */
#define LCD_ENTRY_INC_           0x06   /* display shift off, inc cursor move dir */
#define LCD_ENTRY_INC_SHIFT      0x07   /* display shift on,  inc cursor move dir */

/* display on/off, cursor on/off, blinking char at cursor position */
#define LCD_DISP_OFF             0x08   /* display off                            */
#define LCD_DISP_ON              0x0C   /* display on, cursor off                 */
#define LCD_DISP_ON_BLINK        0x0D   /* display on, cursor off, blink char     */
#define LCD_DISP_ON_CURSOR       0x0E   /* display on, cursor on                  */
#define LCD_DISP_ON_CURSOR_BLINK 0x0F   /* display on, cursor on, blink char      */

/* move cursor/shift display */
#define LCD_MOVE_CURSOR_LEFT     0x10   /* move cursor left  (decrement)          */
#define LCD_MOVE_CURSOR_RIGHT    0x14   /* move cursor right (increment)          */
#define LCD_MOVE_DISP_LEFT       0x18   /* shift display left                     */
#define LCD_MOVE_DISP_RIGHT      0x1C   /* shift display right                    */

/* function set: set interface data length and number of display lines */
#define LCD_FUNCTION_4BIT_1LINE  0x20   /* 4-bit interface, single line, 5x7 dots */
#define LCD_FUNCTION_4BIT_2LINES 0x28   /* 4-bit interface, dual line,   5x7 dots */
#define LCD_FUNCTION_8BIT_1LINE  0x30   /* 8-bit interface, single line, 5x7 dots */
#define LCD_FUNCTION_8BIT_2LINES 0x38   /* 8-bit interface, dual line,   5x7 dots */

/**
 * Functions
 */

/* Init for display */
extern void lcd_init(void);

/* Clear screen */
extern void lcd_clrscr(void);

/* Print string on display (no auto linefeed) */
extern void lcd_puts(const char *s);

/* Display string from program memory */
extern void lcd_puts_p(const char *progmem_s);

#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))

/* Send command to display */
extern void lcd_command(unsigned char cmd);

/* Send data to display */
extern void lcd_data(unsigned char data);

#endif

I add this libraries inside Libraries folder in avr studio 6.2, and i tryed to add other folder lid folder inside GccApplication1 with this labraries lcd.h and lcd.c .
But always got same error above.
Do i have to change anything on libraries ?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An Arduino has already got a <lcd_i2c.h> library in various flavours. I think that they all work.

The beauty of the Arduino LCD libraries is that they all use the same methods. So you simply include the library that matches your module.

OTOH, AVR C libraries tend to have a different API for each author. Hence an app written for Fleury LCD has different calls to a Stang or CodeVision one. And heaven help us. It certainly won't work with the MrLCD library written by A. Pratt.

There seems little point in writing a new one for an Arduino.

Having said that, I have written a <lcd_twi.h> and <lcd_i2c.h> library for Codevision C that shares the same API as the regular CV <alcd.h> library.

Quite honestly. If you want to run an app on an Arduino UNO, use the Arduino language and libraries. You know it makes sense.

Oh, and in answer to your question, the Fleury "lcd.h" is written for a non-I2C HD44780 module. If in doubt post a link to the particular Ebay module you are using.

DAvid.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you included the libraries with the solution explorer?
'right click -> add -> existing item'

I am struggling with this to, the same test code, the errors I am getting are:
-ld returned 1 exit status
-undefined reference to `lcd_puts_p(char const*)
-undefined reference to `lcd_init()'
-undefined reference to `lcd_clrscr()'

I can't get any further.

edit: I am using Atmel studio 6.1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its a school project, i can´t use arduino language i have to use avrstudio, so im just testing, do u have the link to yours libraries ?
Ebay module im using : Ebay module you are using http://www.ebay.com/itm/Starter-kit-motor-servo-RFID-Ranging-relay-Tempe...
IIC 1602 lcd display

edit:yes i tried to include libraries with solution explorer that but same error.
My avrstudio 6.2

Last Edited: Mon. Jun 2, 2014 - 03:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

very simple just paste the lcd.h file to your installation directory include folder. it should work..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You certainly get a lot of goodies in this kit!

Yes, it looks like a regular 16x2 LCD with an I2C adapter.

Quote:
With User Manual and Example Ardino Code , it will Email to you after you get your kit .

So you should have working examples for everything.

Regardless of what your school wants, I would build all the Arduino example projects. Then adapt each example to make it my own project. Using the Arduino language.

That is what the Arduino is for. Having ideas and implementing them in an easy way.

I will tell you now. Writing C code from scratch for every "goody" in your kit will take an inordinate amount of time and effort.

Developing many ideas with the Arduino libraries is quite practical. And you might make a single 'major' project with the Arduino.

If your teacher sneers at Arduino, you can translate your finished major project into C. (and we don't mind helping with the translation. I could even give you a library in C)

But seriously, your learning time is best spent with the best tools available to you. i.e. your kit, a UNO and the Arduino language.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well figured the problem now i got no errors uploaded to atmega328p, the LCD is on but don´t show any letter or number, GND and VCC are connected right, but the SDA and SCL i don´t know what pin i should connect them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

God gave you the Arduino.
Why not use it ?

Or did your teacher not give you the example code promised by the Ebay vendor.

Seriously, with Arduino, you would be learning at top speed.

By the sound of your SCL,SDA question, you are a very new learner of AVR and C. Believe me, Art students can make good projects with Arduinos. And they are probably drunk/stoned/stupid. Engineering students at least start with a brain.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have tested this lcd on arduino code, and it worked ( hello world), so my next step is make it work with avr.
I am using chip PCF8574T and lcd HD44780, but on those libraries they aparently use on code PCF8574 without the 'T', same with lcd HD44780U which have adicional 'U', so i have to change anything on lcd.c, lcd.h, twi_master.h, twi_master.c libraries ?
And the traget is atmega8 and my is atmega328p so do i have to change something on libraries ?
When i brought the lcd it was already solder as shown in this link ( so i hope to not have to change pins. LCD Version 1 - Marked "YwRobot Arduino LCM1602 IIC V1" http://arduino-info.wikispaces.com/LCD-Blue-I2C#v1 . Got no errors when uploaded to atmega328p, the LCD is on but don´t show any letter or number, GND and VCC are connected right, but the SDA and SCL i don´t know what pin i should connect them.

twi_master.c


/*
* TWI (aka I2C) implementation of Master Transmit mode. Based on AVR155.
*
* This library only implements as much as is needed to send data to a PCF8574
* 8-bit I/O expander.
*
* Target: ATmega8
*
* Original Author: Asmund Saetre
* License: Unknown
*/

#include "twi_master.h"

/****************************************************************************
Internal functions
****************************************************************************/

static void Wait_TWI_int(void)
{
while (!(TWCR & (1<<TWINT))) // Wait for TWI interrupt flag set
;
}

/****************************************************************************
Public functions
****************************************************************************/

void i2c_init(void)
{
TWBR = SCL_CLOCK; // Set SCL frequency
TWCR = (1<<TWEN);
}

unsigned char i2c_write(unsigned char data)
{
Wait_TWI_int();

TWDR = data;
TWCR = ((1<<TWINT)+(1<<TWEN)); // Clear int flag to send byte

Wait_TWI_int();

if(TWSR != MTX_DATA_ACK) // If NACK received return TWSR
return TWSR;
return SUCCESS;
}

unsigned char i2c_send_start(void)
{
TWCR = ((1<<TWINT)+(1<<TWSTA)+(1<<TWEN));// Send START

Wait_TWI_int();

if((TWSR != START)&&(TWSR != REP_START))// If status other than START
return TWSR; // transmitted (0x08) or Repeated
return SUCCESS; // START transmitted (0x10)
// -> error and return TWSR.
// If success return SUCCESS.
}

void i2c_send_stop(void)
{
TWCR = ((1<<TWEN)+(1<<TWINT)+(1<<TWSTO));// Send STOP condition
}

unsigned char i2c_send_adr(unsigned char adr)
{
Wait_TWI_int();

TWDR = adr;
TWCR = ((1<<TWINT)+(1<<TWEN)); // Clear int flag to send byte

Wait_TWI_int();

if (TWSR != MTX_ADR_ACK) // If NACK received return TWSR
return TWSR;
return SUCCESS; // Else return SUCCESS
}

twi_master.h


/*
* TWI (aka I2C) implementation of Master Transmit mode. Based on AVR155.
*
* This library only implements as much as is needed to send data to a PCF8574
* 8-bit I/O expander.
*
* Target: ATmega8
*
* Original Author: Asmund Saetre
* License: Unknown
*/
#ifndef TWI_MASTER_H
#define TWI_MASTER_H

#include <avr/io.h>

/****************************************************************************
TWI configuration
****************************************************************************/

#define PCF8574_ADDR 0x4E // Slave address of PCF8574
#define SCL_CLOCK 72 // Set SCL to 100 KHz at 3.6 MHz xtal
// See application note AVR315, table 1
/****************************************************************************
TWI status register definitions
****************************************************************************/
/* General Master status codes */
#define START 0x08 // START has been transmitted
#define REP_START 0x10 // Repeated START has been transmitted

/* Master Transmitter status codes */
#define MTX_ADR_ACK 0x18 // SLA+W has been transmitted and ACK received
#define MTX_DATA_ACK 0x28 // Data byte has been transmitted and ACK received

/* Other TWI related settings */
#define SUCCESS 0xFF // return code for success

/****************************************************************************
TWI functions
****************************************************************************/
void i2c_init(void);

unsigned char i2c_send_start(void);

void i2c_send_stop(void);

unsigned char i2c_send_adr(unsigned char adr);

unsigned char i2c_write(unsigned char data);
#endif

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want I2C/TWI for avr-gcc that "just works" then Google "fleury i2c". Don't waste your time trying to reinvent the wheel if the only goal here is to make the LCD work.

Of course if it is to learn I2C/TWI then carry on but at the least get Fleury to compare operation and see where you went wrong.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Download the Fleury I2C and the Fleury LCD libraries. You don't need to edit any of the files.

Copy "lcd.h", "i2cmaster.h", "twimaster.c", "lcd_i2cmaster.c" into your project directory.

"lcd_i2cmaster.c":


/*
* lcd_i2cmaster.c
*
* Created: 03/06/2014 11:08:07
* Author: David Prentice
*/
#define PCF8574A 0x27 // for your solder blobs.

#include "i2cmaster.h" //Fleury I2C
#include "lcd.h" //Fleury LCD
#define I2C_INIT() i2c_init()

uint8_t I2C_WRITESEQ(uint8_t slave, uint8_t *seq, uint8_t n)
{
uint8_t ret = 1;
if (i2c_start(slave << 1) == 0) {
uint8_t i;
for (i = 0; i < n; i++)
i2c_write(seq[i]);
ret = 0;
}
i2c_stop();
return ret;
}

#include <util/delay.h>
#include <stdint.h>

#pragma used+
static unsigned char _base_y[4]={0x80,0xc0};
unsigned char _lcd_x,_lcd_y,_lcd_maxx;
#pragma used-

static char wr_lcd_mode(unsigned char c, unsigned char mode)
{
char ret = 1;
unsigned char seq[5];
static unsigned char backlight = 8;
if (mode == 8) {
backlight = (c != 0) ? 8 : 0;
return I2C_WRITESEQ(PCF8574A, &backlight, 1);
}
mode |= backlight;
seq[0] = mode; // EN=0, RW=0, RS=mode
seq[1] = (c & 0xF0) | mode | 4; // EN=1, RW=0, RS=mode
seq[2] = seq[1] & ~4; // EN=0, RW=0, RS=mode
seq[3] = (c << 4) | mode | 4; // EN=1, RW=0, RS=mode
seq[4] = seq[3] & ~4; // EN=0, RW=0, RS=mode
ret = I2C_WRITESEQ(PCF8574A, seq, 5);
if (!(mode & 1) && c <= 2)
_delay_ms(2); // CLS and HOME
return ret;
}

// set the LCD display position x=0..39 y=0..3
void lcd_gotoxy(unsigned char x, unsigned char y)
{
wr_lcd_mode(0x80 | (_base_y[y] | x), 0);
_lcd_x=x;
_lcd_y=y;
}
// clear the LCD
void lcd_clrscr(void)
{
wr_lcd_mode(0x01, 0);
_lcd_x = _lcd_y = 0;
}
// home the LCD
void lcd_home(void)
{
wr_lcd_mode(0x02, 0);
_lcd_x = _lcd_y = 0;
}
void lcd_putc(char c)
{
if (_lcd_x>=_lcd_maxx || c == '\n')
{
lcd_gotoxy(0,++_lcd_y);
}
if (c != '\n') {
++_lcd_x;
wr_lcd_mode(c, 1);
}
}
// write the string str located in SRAM to the LCD
void lcd_puts(const char *str)
{
while (*str) lcd_putc(*str++);
}
// write the string str located in FLASH to the LCD
void lcd_puts_p(const char *progmem_s)
{
uint8_t c;
while ((c = pgm_read_byte(progmem_s++)) != 0) lcd_putc(c);
}
void lcd_command(unsigned char cmd)
{
wr_lcd_mode(cmd, 0);
}
void lcd_data(unsigned char data)
{
wr_lcd_mode(data, 1);
}
// initialize the LCD controller
void lcd_init(unsigned char command)
{
unsigned char i;
// High-Nibble von Byte 8 = Display Control:
// 1DCB**** D: Disp on/off; C: Cursor on/off B: blink on/off
char init_sequenz[] = { 0x33, 0x32, 0x28, 0x0C, 0x06, 0x01 };
_lcd_maxx = LCD_DISP_LENGTH;
_base_y[2] = _base_y[0] + _lcd_maxx;
_base_y[3] = _base_y[1] + _lcd_maxx;
I2C_INIT();
_delay_ms(30); // 30 ms Delay nach power-up
for (i = 0; i < sizeof(init_sequenz); i++) {
wr_lcd_mode(init_sequenz[i], 0);
_delay_ms(5);
}
wr_lcd_mode(command, 0);
}

void lcd_backlight(char on)
{
wr_lcd_mode(on, 8);
}

And here is a trivial test program.

lcd_i2cmaster_test.c:


/*
* lcd_i2cmaster_test.c
*
* Created: 03/06/2014 11:07:15
* Author: David Prentice
*/

#include <avr/io.h>
#include <util/delay.h>
#include "lcd.h"
extern void lcd_backlight(char on); //not in lcd.h

int main(void)
{
lcd_init(LCD_ON_DISPLAY);
lcd_backlight(0);
_delay_ms(500);
lcd_backlight(1);
_delay_ms(500);
while(1)
{
lcd_clrscr();
lcd_gotoxy(0, 0);
lcd_puts_P("Hello World");
lcd_gotoxy(1, 1);
lcd_puts("Second Line");
_delay_ms(1000);
}
}

From memory, the Fleury files #include <i2cmaster.h> instead of "i2cmaster.h". Since your Fleury files are in your local directory, you should use "lcd.h" and "i2cmaster.h".

Please let me know if you build ok.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the link to download the files: "lcd.h", "i2cmaster.h", "twimaster.c", i found some files but idk if they are modificated or have any newer version.
twimaster.c http://pastebin.com/mXZGVThE
i2cmaster.h http://pastebin.com/17CbY0af
And lcd.h is file i have already ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should have just Googled for "Fleury I2C library" and got [url]http://homepage.hispeed.ch/peterfleury/avr-software.html[/url]

then downloaded "i2cmaster.zip" and "lcdlibrary.zip"

Do NOT attempt to use modified files from unknown places.

Yes, it looks as if you need to edit "twimaster.c" to include "i2cmaster.h"

Believe me. It is worth making a fresh start with known files.

You also need to add the F_CPU=16000000 to your AS6 Symbols.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here my image of Desktop, seems my folders are not in correct place, i don´t want to use the full path of #include "lcd.h" so i got a error exactly in this line.
lcd.h: No such file or directory.[/img]

edit: don´t have that error above anymore, but i got this error: PORTA undeclared in this line:
lcd.h ...


#define LCD_PORT PORTA /**< port for the LCD lines */
#define LCD_DATA0_PORT LCD_PORT /**< port for 4bit data bit 0 */
#define LCD_DATA1_PORT LCD_PORT /**< port for 4bit data bit 1 */
#define LCD_DATA2_PORT LCD_PORT /**< port for 4bit data bit 2 */
#define LCD_DATA3_PORT LCD_PORT /**< port for 4bit data bit 3 */
#define LCD_DATA0_PIN 0 /**< pin for 4bit data bit 0 */
#define LCD_DATA1_PIN 1 /**< pin for 4bit data bit 1 */
#define LCD_DATA2_PIN 2 /**< pin for 4bit data bit 2 */
#define LCD_DATA3_PIN 3 /**< pin for 4bit data bit 3 */
#define LCD_RS_PORT LCD_PORT /**< port for RS line */
#define LCD_RS_PIN 4 /**< pin for RS line */
#define LCD_RW_PORT LCD_PORT /**< port for RW line */
#define LCD_RW_PIN 5 /**< pin for RW line */
#define LCD_E_PORT LCD_PORT /**< port for Enable line */
#define LCD_E_PIN 6 /**< pin for Enable line */

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

PORTA undeclared in this line:
lcd.h ...

PORTA is defined in io.h so ensure the preprocessor has already seen io.h before it gets to see lcd.h.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have your project in GccApplication19/GccApplication19 folder.
You should have these files in this folder:

lcd.h
lcd_i2cmaster.c
i2cmaster.h
twimaster.c
lcd_i2cmaster_test.c

It should not matter what PORTA is.
The "lcd.h" file is only used for the LCD constants like LCD_DISP_LENGTH and function prototypes like extern void lcd_clrscr(void);

DAvid.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In that folder i have also lcd.c .
Well it seems PORTA error disapear, but i have other error
in image:
lcd_i2cmaster.c
multiple definition of ´lcd_gotoxy´, lcd_clrscr, lcd_home, lcd_putc, lcd_puts_p, lcd_command, lcd_data, lcd_init .

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Remove your "libraria".

Your project files are just the :
lcd.h
lcd_i2cmaster.c
i2cmaster.h
twimaster.c
lcd_i2cmaster_test.c

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not lcd.c ?
Now i got this error undefined reference to 'lcd_init'.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Follow my original instructions. i.e. copy virgin Fleury files to a fresh project. Copy-paste my two files to your project.

The project should only use the files that I said.
It should build just fine. (change the <i2cmaster.h> )

If you are getting in a state, I can email you an AS6 project in a ZIP.

It would be a lot easier if you learned the Arduino first.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The lcd still works (show letters/numbers) tested on arduino software.
I tried other different codes(avrstudio), build no errors or warnings, but the lcd don´t display anything, only black boxes on first line.
In run out of ideas, idk what is problem/s or issues on avrstudio with lcd.
Do any1 have some project(avrstudio code) that it might work on my lcd ?

Arduino Uno, ATmega328p, f clock 16MHz, chip PCF8574T, LCD LCM1 1602 IIC V1, HD44780, SDA-A4, SCL-A5.

Last Edited: Wed. Jun 11, 2014 - 05:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also want to test an ultrasonic range module HC-SR04, on arduino software works.
Just picked this code to start, how do u visualize distance ?, i know in arduino is in tools -> serial monitor, but on avrstudio idk how to visualize the distance.


#define F_CPU 16000000
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>

int num_pulses;
int echo_rec;

int main (void)
{
DDRC = 0b11111110; // set PC0 to input
PORTC = 0b00000001; // set PC0 to high
DDRD = 0b11110111; // set PD3 to input
PORTD = 0b00000000; // set PD3 to low

EIMSK |= _BV(INT1); //Enable INT1
EICRA |= _BV(ISC11) //Trigger on rising edge of INT1
| _BV(ISC10);
sei();

num_pulses = 5;
echo_rec = 0;

while (1)
{
echo_rec = 0;
for (int i=0;i<num_pulses;i++)
{
PORTD = 0b00010000; //sensor output
_delay_us(12);
PORTD = 0b00000000; //sensor output
_delay_us(13);
}

_delay_ms(1000);

if (echo_rec == 0)
{
PORTC = 0b00000001;
}
}
}

ISR(INT1_vect) //If input PD3 gets high (interrupted)
{
PORTC = 0b00010001; //midden aan
echo_rec = 1;
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can any1 give some tips ?
thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I PM'd you about your LCD.

Get that working, and I will reply to your HC-SR04 question(s).

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can any1 help ? (first and second post on page 2)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did exactly what David has said and I got the result. The lcd1602 works great.

The only thing that I changed was the line "#define PCF8574A            0x27" in which 0x27 was replaced by 0x3F.

I would like to thank David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

good day!
 
i can't run my LCD (many var. code this topics)
working scheme, in a low-cost/PCB circuit, with a working project
 
thank
 
I2C LCD modules mjkdz, addr: 32/0x20

linux x32, avr-gcc

if I'm wrong, correct this and do not criticize :o)

Last Edited: Thu. May 31, 2018 - 01:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most I2C backpacks map RS, WR, EN, BL, D4, D5, D6, D7 to pins P0..P7 of the PCF8574.

 

The mjkdz map D4, D5, D6, D7,  RS, WR, EN, BL to pins P0..P7 of the PCF8574.

It is simple enough to change the coding to suit.

 

Codevision lets you map the PCF8574 port pins in any order.

Codevision even lets you bit-bang the I2C on non-TWI pins e.g. on a Tiny.

Arduino libraries let you map the pins in any order.

 

If you want help,  say what the target is.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes, i need help :o)

 

I transfer/move my experience/projects from Arduino to avr-gcc C (not C++)

 

in older projects I used Arduino library I2C NewliquidCrystal
only this library (in some modification) worked correctly with the I2C-MJKDZ LCD module

 

to quickly transfer NewliquidCrystal to SI did not work, because used classes C++ are used, so I decided to look for a natural solution for "avr-gcc I2C-MJKDZ LCD"

 

could not revive the display with this topic

 

thanks for the answer, I will think

 

p.s.

question: in nature there is generally a library on pure avr-gcc or other avr-c (not C++)

if I'm wrong, correct this and do not criticize :o)

Last Edited: Thu. May 31, 2018 - 02:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"do not criticize"?

 

Firstly, you hijack this thread with your first post, which I then split off into its own new thread where you participate, but then you come back here and hijack it again!

 

Be careful who you annoy...

 

Moderator

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely this is the appropriate thread.   i.e. LCD with I2C backpack on m328

 

Here is an AS7 project.   Untested with your LCD.   I have set Slave=0x20 and mkjdz wiring.

 

David.

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Firstly, you hijack this thread with your first post, which I then split off into its own new thread where you participate, but then you come back here and hijack it again!

Be careful who you annoy...

not quite clear (English is not my native language)
describe again more in detail, what happened to my messages, why "the other topic itself was created"?

 

...

 

LCD_fleury.zip

thank you, i'm testes ... but no ...

 

I already tested several such libraries, but without result (and yours did not help either, the display is not initialized)

 

...

 

I specify, just in case:

- build OK, no errro

- avr-gcc & linux

 

I2C modules as:

http://remotesmart.wdfiles.com/local--files/i2c-converter/www.mjkdz.com.JPG

 

if I'm wrong, correct this and do not criticize :o)

Last Edited: Thu. May 31, 2018 - 03:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did say that it was Untested.   You MUST always have external pullup resistors on the I2C bus.

 

Your photo does not show whether it is PCF8574 or PCF8574A

Or whether there are onboard pullups or what Slave address is selected.

 

Please post the Malpardita constructor that works for your backpack.

 

I would seriously consider buying a regular backpack.   They are very cheap.   Most have pullups.   All have configurable Slave address i.e. A0, A1, A2 selection.

 

David.

 

 

 

 

Last Edited: Thu. May 31, 2018 - 04:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
I did say that it was Untested.

I noticed that F_CPU is set to 4MHz in one of the .h or .c files, this will need to be changed in order for the timing to be correct for the clock used, this must be done so the LCD can init correctly.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

connection diagram 100% working (wires, connection of electric circuit, pull-up etc...)

 

LiquidCrystal  constructor

#define LCD_I2C_ADDR  0x20
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);

...

 

about F_CPU

#ifndef F_CPU
#define F_CPU 4000000UL
#endif

and correct value set on makefile ...

 

...

 

I did say that it was Untested

this is not a claim - but as it is (that is, this report - checked the code and wrote the result smiley)

 

thanks

if I'm wrong, correct this and do not criticize :o)

Last Edited: Thu. May 31, 2018 - 04:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the constructor.    That clarifies the wiring and Slave address.

 

F_CPU is set in the AS7 Properties.

 

I hooked up a PCF8574A with address 0x38 and wired it to a LCD using the scheme from your constructor.

 

PCF8574 Slave address defined as 0x38 in lcd_fleury.c

USE_MJKDZ defined as 1

 

The code works, admittedly the Backlight is active-high and was wrong.    Obviously I have pullup resistors on the SDA, SCL lines.

 

If this was the Arduino Forum,   I would expect people to just say "it don't work"

Since you have declared that you want to write code in C,   I would expect an accurate reply.   e.g. whether there are pullups.

 

David.

Last Edited: Thu. May 31, 2018 - 05:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since you have declared that you want to write code in C,   I would expect an accurate reply.   e.g. whether there are pullups.

I already said: the project is transferred from arduino to avr-gcc

in other words: the project is a worker, finished and collected correctly by 100% (ready and at the moment has been in the works for a long time)

therefore, all pull-up resistors are in place

 

F_CPU is set in the AS7 Properties.

clarification: I do not work with avr-studio and etc ...
only linux, makefile (manual edit), command line, avr-gcc etc ...
F_CPU is set in the makefile

 

The code works, admittedly the Backlight is active-high

 i'm tested this code - LCD can't start ...

 

... add some thoughts:

 

//
// lcd_fleury.c
//
                D7 D6 D5 D4 BL EN RW RS
Port PCF8574 :  3  2  1  0  7  6  5  4 //USE_MJKDZ=1

//
// LiquidCrystal_I2C
//

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);
RS          P6
RW          P5
E           P4
D4          P0
D5          P1
D6          P2
D7          P3
Backlight   P7

-->

RS & EN - swap :o)

I will rift the code in this direction ...

if I'm wrong, correct this and do not criticize :o)

Last Edited: Thu. May 31, 2018 - 06:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My apologies. You said linux in #27.
.
The real mystery is why command line, makefile ?
The Arduino IDE works fine in Linux. You have already got it working with Malpartida library. Why write in C?
.
Even more apologies. The mkjdz is wired RS on P6, E on P4. Your constructor in #35 is wrong.
Now that I have hooked up some hardware, I will correct the mkjdz case
.
David.

Last Edited: Thu. May 31, 2018 - 06:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, yes, like that like this smiley

thanks

...

 

Even more apologies. The mkjdz is wired RS on P6, E on P4. Your constructor in #35 is wrong.

this code/constructor get from work programm, that is, he "like this" works "as is"

I think that the problem is in the version of I2C : mjkdz (the network has little information about the difficulties of launching this equipment)

I also worked very hard to launch

 

module mjkdz - it is such a special (I would say lurid), but it works

 

NewliquidCrystal - written on Wired/C++, but the project moves to clean AVR-GCC C (not Arduino and C++)

 

I understand that you can insert С++ code into the main С project, but you have to understand programming very well, that would understand and know all the subtleties of this, so while I'm trying to do this with a little work

(many words, I hope clearly described the situation)

 

several links to similar modules (just so - the marking of the chip is wiped)

http://gcbasic.sourceforge.net/library/DISPLAY/Set%20address%20for%20mjkdz%20I2C%20lcd1602%20Module.jpg

 

I got the device address using i2c_scan

 

thanks

 

p.s. I2C mjkdz module has not yet made it work on C code (on C++ / NewliquidCrystal - work OK)

 

//
// this MJKDZ ver. constructor is WORKED on Arduino-Wired version of project
//

//                            addr, en, rw, rs, d4, d5, d6, d7, bl, blpol
LiquidCrystal_I2C lcd(LCD_I2C_ADDR,  4,  5,  6,  0,  1,  2,  3,  7, NEGATIVE);

E           P4
RW          P5
RS          P6
D4          P0
D5          P1
D6          P2
D7          P3
BL          P7
BL_POL      NEGATIVE

 

to david.prentice

help, I can not understand where it is redefined this pins/data

 

Port PCF8574 :  7  6  5  4  3  2  1  0 //USE_MJKDZ=0
Port PCF8574 :  3  2  1  0  7  6  5  4 //USE_MJKDZ=1
Port 74HC595 :  7  6  5  4  3  2  1  0
               D7 D6 D5 D4 BL EN RW RS

 

analyzing many versions of libraries, found the common common symptom, visne on the loop, here is an example of the code of one of the libraries

 

lcd_init(void)
{
i2c_init();
i2c_send_start();

i2c_send_start(void)
{
TWCR = ((1<<TWINT)+(1<<TWSTA)+(1<<TWEN));// Send START
Wait_TWI_int();

Wait_TWI_int(void)
{
while (!(TWCR & (1<<TWINT)))

hang in this code

while (!(TWCR & (1<<TWINT)))

 

UPDATE companion topic/task/issue

 

task: to transfer one of the libraries from arduino/wired/c++ to avr-gcc/pure c

 

NewliquidCrystal https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/

hd44780.bill_perry https://github.com/duinoWitchery/hd44780

 

it is these two libraries that are of interest. Only they work normally with a custom I2C_mjkdz module

 

the question: whoever has already dealt with this or similar?

 

clarification (counter-questions)

 

1. There are already many workers and combat projects

2. The main reason (why these two libraries) is the correct operation with the I2C module (the cat is used in projects)

3. All other libraries searched for libraries, saw, tried, but they do not support I2C_mjkdz directly or it is necessary to finish (they require a lot of time and effort)

I2C_mjkdz is such a problem specific module: o)

Thank you

 

if I'm wrong, correct this and do not criticize :o)

Last Edited: Fri. Jun 1, 2018 - 09:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sunjob wrote:
libraries, saw, tried, but they do not support I2C_mjkdz directly

What do you mean, "support I2C_mjkdz directly" ?

 

The whole point of an I2C Library is that it gives you the basic transport functions to address a slave, send data to it, and read data from it.

 

These are standard, basic functions; they are the same for any & all devices that comply top the I2C standard - they are not specific to any particular module or device.

 

It is up to you to write the higher-level code which builds on those basics and uses them to communicate with the particular device(s) you have.

 

Just like a basic putchar() for a UART just sends a character - it neither knows nor cares whether that character is part of an AT command, or a user menu, or anything else.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

More Big Apologies.    My posts were largely from memory about the LiquidCrystal_I2C constructor().   I should have double-checked Arduino libraries and Malpardita docs.    (I was expecting the arguments to be in I2C, RS, RW, EN, D4, ... sequence)


//LiquidCrystal_I2C lcd(I2C,EN, RW, RS, D4, D5, D6, D7, BL, POLARITY);  // Malpartida
LiquidCrystal_I2C  lcd(0x27, 2,  1,  0,  4,  5,  6,  7,  3, POSITIVE);  // common backpack
LiquidCrystal_I2C  lcd(0x20, 4,  5,  6,  0,  1,  2,  3,  7, NEGATIVE);  // mjkdz backpack

There is a good description https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!configurable-i2c-address-modules

 

Anyway,  I rearranged my AS7 project for both styles of backpack.   And tested them on real hardware.   I understand that you are no longer interested.

 

Why do you want to convert an existing Arduino C++ library into C?

If the code is running on Arduino compatible hardware,   it is easier to use the regular Arduino core and libraries.

 

I can understand someone wanting to add the functionality of a C++ library to a C project. by unrolling inheritance and creating unique names for overloaded C++ class methods.

If that is what you want to do,   just say so.

 

I was brought up on command line tools and Make.   It is a perfectly good way to work.

Our younger readers have probably only used IDEs and GUIs.

 

It seems wise to stick to the most common format when posting on the Forum

e.g. pasted snippets of C, C++, ASM, ... in CODE windows

e.g. complete AS7 projects attached as ZIP files

e.g. complete Arduino sketches pasted into CODE windows or as file attachment

 

Incidentally,   the Codevision C Compiler comes with support for I2C backpacks with any wiring, any slave address,  TWI or bit-bang I2C.

The Codevision libraries work straight out of the box.    And are fully supported by HPInfoTech (Pavel)

 

David.

Last Edited: Fri. Jun 1, 2018 - 03:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why do you want to convert an existing Arduino C++ library into C?

apparently, me will have to transfer the display library to C++

 

If that is what you want to do,   just say so.

 

the task is to transfer to avr-gcc, as much as possible in С (or, if the module can not be easily transferred to С then transferred to С++)

 

It seems wise to stick to the most common format when posting on the Forum

yes, of course, only while there is nothing to publish, there will be fighting bugs and mistakes, then, welcome, we'll fill up the top of the head

 

... Codevision ...

 

no windows and windows-IDE smiley i'm use Linux

unfolding the win-development environment in VBox, then searching, testing and migration to avr-gcc will take more time

Despite this, I am well-disposed towards such decisions (even forced ones)

...

 

at the moment I'm inclined to believe that the library should be moved to C++

 

p.s.

 

There is a good description ...

yes, a little clarification

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!mjkdz

MJKDZ version - this is a real headache and a fun puzzle game smiley

 

if I'm wrong, correct this and do not criticize :o)

Last Edited: Fri. Jun 1, 2018 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sunjob wrote:
the task is to transfer to avr-gcc,
You do know that avr-gcc is both C and C++ compilers (the cc in gcc means "compiler collection") so using avr-gcc can mean using C++ just as much as it means using C. In fact Arduino is just a wrapper around avr-gcc. the C++ compiler it uses is the one that comes with avr-gcc.

 

So given that it's all GCC then it's a question of why move from C++ to C? Looks like a step back in time to me. C++ is undoubtedly a "better" language than C (because it had the chance to correct a lot of the design flaws in the original language).

 

If your issue is really about moving Arduino (avr-gcc / C++) to "plain" avr-gcc / C++ then isn't it simply the case of exposing the "hidden" bits of Arduino such as the main.cpp it provides or all the support it comes with in wiring*.c and the other supplied *.cpp ? And again, to what goal, what's wrong with it being "in" Arduino anyway? At the end of the day and Arduino "sketch" :

void setup() {
    // stuff
}

void loop() {
    // stuff
}

is nothing more than the complete C++ program:

void setup();
void loop();

int main(void) {
    arduino_internal_setup();
    setup();
    while(1) {
        loop();
    }
}

void setup() {
    // stuff
}

void loop() {
    // stuff
}

That is pretty much all that sets "Arduino" apart from plain C++

 

(also it has a rather annoying tendency to allow function calls without header inclusions which teaches young programmers a bad technique - even if it does make writing the code a bit simpler).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am well aware that Codevision and AS7 are Windows-only programs.

As far as I know,   all retail Desktop and Laptop PCs come with Windows.    It is your choice to remove Windows.

 

Unfortunately some applications only run on Windows.    In an ideal world they would all run on Linux.

 

I still do not understand your objective.    If your hardware is Arduino compatible,   I would use Arduino.

If you want to use a C++ library,   I would make a C++ project in the first place.    GCC projects can use C++, C, ASM.

In fact,   Arduino uses all three types.

 

Converting some C++ libraries to straight C is easy.    In fact a lot of Arduino libraries are C with a C++ wrapper.

Other C++ code is more difficult.    Especially inheritance and overloading.    Think about it.    lcd.print(expr) has lots of variants e.g. integer, f-p, char[], String, ...

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I understand the situation with arduino-gcc enough, the situation is ambiguous! and just here and so to take and stick the library Arduino/C++ in the project AVR-GCC - this is a non-trivial task (even this will be a project on the AVR-GCC/C++, not critical, it is possible and on С++)

 

take Bill Perry's hd44780 library and try to do it in three steps ?!

https://github.com/duinoWitchery/hd44780

 

I will work in this direction.
thanks for the help

 

...

 

It is your choice to remove Windows.

thank you, fell under the table, funny ... smiley

I write, mainly with the help of an interpreter, therefore, perhaps not accurately expressing my thoughts. why are you so worried? explain

 

### UPDATE ###

 

I'm torturing Bill's library

 

lib/Arduino.h:105:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 int atexit(void (*func)()) __attribute__((weak));
 ^
/usr/bin/avr-ld:/home/sun/tmp.ram/build/main.o: file format not recognized; treating as linker script
/usr/bin/avr-ld:/home/sun/tmp.ram/build/main.o:1: syntax error
collect2: error: ld returned 1 exit status
make: *** [main.elf] Error 1
Compilation failed.

 

if I'm wrong, correct this and do not criticize :o)

Last Edited: Fri. Jun 1, 2018 - 05:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Explain what you want to do.

You will get constructive advice.

 

A regular C program tends to use

extern void lcd_init(uint8_t dispAttr);
extern void lcd_gotoxy(uint8_t x, uint8_t y);
extern void lcd_putc(char c);
extern void lcd_puts(const char *s);
extern void lcd_puts_p(const char *progmem_s);
...

and your C application calls them in the regular way.    The Fleury functions are popular in C programs.

Other APIs exist.    There is no worldwide convention in C LCD functions.

 

Arduino provides LCD specific C++ methods and inherits all the Print class methods too.   Very useful to keep a consistent API style.    It means that Arduino programs are understood all over the world.

You will find it very difficult to port Bill Perry's code directly to C.     And quite honestly,  you probably do not want all of it anyway.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A regular C program tends to use

Yes! but only when you connect a pin-to-pin (without using an I2C module)

 

 Using the arduino library, we have everything in one place right away

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);
lcd.begin(16,2);
lcd.backlight();
lcd.setCursor(0, 1);
lcd.print("    Bye  Bye    ");

how to work directly in Fleury libraries? Obviously, you need to lay a (wrapper) to work through I2C (this requires a lot of labor and time, so it's not possible yet)

 

to all else, has the fact of a non-standard module called mjkdz

this is a very "wayward" and "dirty" module
from all the libraries that we applied to it, and this is more than 40 versions of libraries for LCD-display, normally earned only 2

 

I agree that this is "like pcf8574"!
but which B, B, C or Z is not known, and this module is unpredictable: o)

the original project is working, or anything will not change, only the software, therefore, I want to somehow adapt the WORK SOLUTION (one of the 2 libraries)

or write everything from scratch (well, almost from scratch) - which is NOT POSSIBLE in this situation

 

...

 

now I'll try to explain what I want and what I'm doing

 

1. I want to use one of these two libraries
2. The project where the library is transferred is written to AVR-GCC C, without using IDE & especially Arduino-IDE
3. Used
- avr-gcc or atmel-toolchain (by circumstance or by choice)
- geany as editor
- target hardware arduino-nano (on board ATmega328P)
- makefile - modified by hands under itself (already as best I could, and could: o)

 

total, need to transfer your library to avr-gcc (it will be correct if C++)

 

if there are unsolvable problems with the connection of the C++ module (your library) to the C project, in this case, the entire project will be С++, this is not a problem (I'm not harmful :o)

 

(now I'm studying this issue, writing examples, editing the makefile, etc.)

 

... what is at this stage

 

1. created a test project C++
2. directory for all project libraries - @PRJ_ROOT@/lib (inside the project)
3. Copy the necessary files from library to the lib directory (all you need for the I2C LCD)
4. Copied all the necessary arduino-files to the lib directory
5. I try to collect, get an error

 

if necessary I will make an archive

 

 

 

 

if I'm wrong, correct this and do not criticize :o)

Last Edited: Sat. Jun 2, 2018 - 08:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sunjob wrote:

A regular C program tends to use

Yes! but only when you connect a pin-to-pin (without using an I2C module)

Nonsense.

 

The whole reason why regular C programs tends to use that approach is precisely because it is entirely independent of the underlying hardware!

 

EDIT: See #40 - it's just the lower-layer functions that need to be concerned with hardware details.

 

this module is unpredictable: o)

Eh??

 

The wiring is fixed - it cannot magically change with time!!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Jun 2, 2018 - 09:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

everything is ready, chief, but there are nuances ...

 

intermediate results, error avr-studio4

static void __empty() {}
void yield(void) __attribute__ ((weak, alias("__empty")));

hooks.c:11:6: error: 'void yield()' aliased to undefined symbol '__empty'

 

thank

 

### UPDATE ###

 

link trouble

 

Attachment(s): 

if I'm wrong, correct this and do not criticize :o)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

### update ###

 

library LCD_fleury_ver.2018 - is very good, speed test is !!! 18.3 mS !!!

if I'm wrong, correct this and do not criticize :o)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

hello, would you have the project in zip format

 

please

 


 

Ícono de validado por la comunidad

 

 

Pages