Coder Social home page Coder Social logo

larduino_hsp's Introduction

Arduino Hardware Support Package for LGT8F's

Task status

  • PWM & Timers update
  • Fast_IO update
  • Analog Comparator
  • Differential Amplifier update
  • Computation Accelerator

Summary

Larduino_HSP is a 3rd party hardware support package for the LGT8F core based arduino boards. The backend of the HSP is fork from offical arduino distribution. We have try to keep all the standard features compatible with arduino world. So feel free to resuse all of the libraries which designed for arduino platform.

Microcontroller based on LGT8F, e.g LGT8F328P has more advanced features which not covered in standard arduino implementation. so there are also many new features merged to this 3rd party package. Important update and new features as following:

  • External/Internal crystal can be selected at runtime
  • Fast_IO interface for fast I/O speed and small code size
  • Full configurable PWM features, including complementary and dead-band control
  • Differential Amplifier front-end for 12bit Analog-to-Digital converter
  • 1/2 channel 8bit Digtial-to-Analog output, campatible with analogWrite()
  • More standalone I/Os
Fast_IO code snippets
void setup() {
	//set D10 to output
	fastioMode(D10, OUTPUT);

	// driver D10 to low level
	fastioWrite(D10, LOW);
}

void loop() {
	// toggle D10
	fastioToggle(D10);
}
PWM code snippets : Solo mode
void setup() {
	// usage: pwmMode(pin, pwm_mode, freq_mode)
	// PWM_MODE_SOLO: set pwm of D5/D6 to independent mode
	// PWM_FREQ_FAST: set PWM to fast mode 
	pwmMode(D5, PWM_MODE_SOLO, PWM_FREQ_FAST);

	// usage: pwmResolution(pin, res_bits)
	// set PWM resolution to 7bit
	pwmResolution(D5, 7);
	// or we can set PWM frequency directly
	// usage: pwmFrequency(pin, freq_in_hz)
	// pwmFrequency(D5, 500000);

	// usage: pwmWrite(pin, duty)
	// Note that we have set PWM resolution to 7bit
	pwmWrite(D5, 128 >> 1);
	pwmWrite(D6, 128 >> 2);
}
PWM code snippets : Duo/Complementary mode
// dead-band settings for complementary PWM
int deadBand = 8;
int dutyMax;

void setup() {
	// usage: pwmMode(pin, pwm_mode, freq_mode)
	// PWM_MODE_DUO1: set pwm of D5/D6 to DUO1 mode (complementary)
	// PWM_FREQ_FAST: set PWM to fast mode
	// PWM_FREQ_BOOST: boost frequency by x4
	// deadBand: set dead-band cycle for PWM 
	pwmMode(D5, PWM_MODE_DUO1, PWM_FREQ_FAST|PWM_FREQ_BOOST, deadBand);

	// we can set PWM frequency directly
	// usage: pwmFrequency(pin, freq_in_hz)
	// set PWM frequency to 300KHz, return its duty resolution
	dutyMax = pwmFrequency(D5, 300000);

	// usage: pwmWrite(pin, duty)
	// Note: maximum duty is calcuated when set pwm frequency
	pwmWrite(D5, dutyMax >> 2);
	pwmWrite(D6, dutyMax >> 2);
}

More detail will be documented in coming Wiki page

Bootloader

The Larduino HSP bootloader is based on optiboot. Source can be found inside the bootloader directory

  • Bootloader upload baudrate: 57600bps

Installation:

  1. Unzip master.zip
  2. Copy the [hardware] directory to Arduino's sketchbook directory (see below to find out where it normally resides)
  3. Restart Arduino, you will see new board from [Tools]->[Board] menu.

About arduino's sketchbook directory

You can always find this directory via the [File]->[Preferences] dialog. But here is the default sketchbook directory for most popluar system:

System Path of sketchbook
Windows C:\Users\<Username>\Documents\Arduino
Mac OSX /Users/user/Documents/Arduino
LINUX /home/<Username>/sketchbook

Arduino Board based on LGT8F's

Here we list one remarkable arduino board based on the LGT8F, which is designed by OCROBOT, the ALPHA 8F382P-U stick with USB to UART on-board. Very affordable, for a low cost of just RMB 8.00!

Please follow OCROBOT ALPHA 8F832P-U official page for more details.

larduino_hsp's People

Stargazers

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

Watchers

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

larduino_hsp's Issues

bugs for 328d adc/dac reference voltage

BUGS!! in write_analogue.c

void analogReference(uint8_t mode)
{
	// can't actually set the register here because the default setting
	// will connect AVCC and the AREF pin, which would cause a short if
	// there's something connected to AREF.
	analog_reference = mode;

#if defined(__LGT8FX8E__) || defined(__LGT8FX8P__)
	#if defined(__LGT8FX8E__)
	if(analog_reference == INTERNAL2V56) {
		VCAL = VCAL2;
	} else {
		VCAL = VCAL1;
	}
	#else
	// set analog reference for ADC/DAC
	if(analog_reference == EXTERNAL) {
		DACON = (DACON & 0x0C) | 0x1;
		if((PMX2 & 0x2) == 0x2) {
			GPIOR0 = PMX2 & 0xfd;
			PMX2 = 0x80; 
			PMX2 = GPIOR0;
		}
	} else if(analog_reference == DEFAULT) {
		DACON &= 0x0C;
	} else {
		DACON = (DACON & 0x0C) | 0x2;
		cbi(ADCSRD, REFS2);
		if(analog_reference == INTERNAL2V048) {
			VCAL = VCAL2;	// 2.048V
		} else if(analog_reference == INTERNAL4V096) {
			sbi(ADCSRD, REFS2);
			VCAL = VCAL3;	// 4.096V
		} else	{
			VCAL = VCAL1;	// 1.024V
		}
	}
	#endif

	ADMUX = (analog_reference << 6);
#endif
}


dear friend,
I looked at this code,find that if I was 328d, there is a sentence on page 204,
使用内部基准(1.25V/2.56V)注意事项:
芯片上电后,默认将内部基准校准为 1.25V,用户如果使用 1.25V 的内部基准,可以直
接使用,无需其他操作。但如果需要使用 2.56V 的内部参考电压,需要自行更新内部基准的
校准值。 2.56V 的校准值在上电后被加载到寄存器 VCAL2(0xCE),在程序初始化时,将 VCAL2
的值读入并写入到 VCAL(0XC8)寄存器即完成 2.56V 的校准。
需要注意的是,当更新了 VCAL 寄存器后,会导致 VCAL1 即 1.25V 的校准值同时更新为
VCAL2,因此如果需要在后续使用过程中重新选择 1.25V 基准,需要提前将 VCAL1 的值保存
到变量中以供后续使用。

after power on, system set calibrate to 1v25 as default, no other operation needed. to using 2V56 as VCAL, need read calibrate value from VCAL2(0xce) and write to VCAL(0xC8). However when update the calibrate of VCL, the calibrate value in VCL1 will update to VCL2 simultaneously , so we must save calibrate of VCL1 in case we use 1v25 again after changing to 2V56.

so there seems a bug:
	#if defined(__LGT8FX8E__)
	if(analog_reference == INTERNAL2V56) {
		VCAL = VCAL2;
	} else {
		VCAL = VCAL1; // if  we use 1v25 again after changing to 2V56. VCAL1 store the calibrate value of 2V56
	}
	#else

To workout, I see in the main.cpp,GPIOR1 save the calibration,

main.cpp-#if defined(__LGT8FX8E__)
main.cpp-// store ivref calibration 
main.cpp:       GPIOR1 = VCAL1;
main.cpp:       GPIOR2 = VCAL2;
main.cpp-

can we replace VCAL1 with GPIOR1 here to workout this problem?


	#if defined(__LGT8FX8E__)
	if(analog_reference == INTERNAL2V56) {
		VCAL = VCAL2;
	} else {
		VCAL = GPIOR1; // will it get some side effect? 
	}if 
	#else

or are there some other good way to work around? does GPIOR1 be overwritten by other program?
Thanks!

larduino w/LGT8F328D-SSOP20 can't build sketch on arduino IDE

ERROR

`Arduino: 1.8.7 (Windows 7), Board: "Larduino w/ LGT8F328D-SSOP20"

Build options changed, rebuilding all
C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp: In function 'void unlockWrite(volatile uint8_t*, uint8_t)':

C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:51:11: error: 'PMX1' was not declared in this scope

if(p == &PMX1)

       ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:52:9: error: 'PMX0' was not declared in this scope

cp = &PMX0;

     ^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp: In function 'void pwmMode(uint8_t, uint8_t, uint8_t, uint8_t)':

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:146:8: error: 'TCKCSR' was not declared in this scope

sbi(TCKCSR, F2XEN);

    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:146:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, F2XEN);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:146:16: error: 'F2XEN' was not declared in this scope

sbi(TCKCSR, F2XEN);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:146:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, F2XEN);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:148:16: error: 'TC2XS0' was not declared in this scope

sbi(TCKCSR, TC2XS0);     

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:148:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, TC2XS0);     

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:149:24: error: 'TCKCSR' was not declared in this scope

} else if(bit_is_set(TCKCSR, TC2XS0)) {

                    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:149:32: error: 'TC2XS0' was not declared in this scope

} else if(bit_is_set(TCKCSR, TC2XS0)) {

                            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:152:16: error: 'F2XEN' was not declared in this scope

cbi(TCKCSR, F2XEN);    

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:152:4: note: in expansion of macro 'cbi'

cbi(TCKCSR, F2XEN);    

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:162:4: error: 'DTR1L' was not declared in this scope

DTR1L = dband;

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:163:4: error: 'DTR1H' was not declared in this scope

DTR1H = dband;

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:166:8: error: 'TCKCSR' was not declared in this scope

sbi(TCKCSR, F2XEN);

    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:166:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, F2XEN);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:166:16: error: 'F2XEN' was not declared in this scope

sbi(TCKCSR, F2XEN);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:166:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, F2XEN);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:168:16: error: 'TC2XS1' was not declared in this scope

sbi(TCKCSR, TC2XS1);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:168:4: note: in expansion of macro 'sbi'

sbi(TCKCSR, TC2XS1);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:169:24: error: 'TCKCSR' was not declared in this scope

} else if(bit_is_set(TCKCSR, TC2XS1)) {

                    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:169:32: error: 'TC2XS1' was not declared in this scope

} else if(bit_is_set(TCKCSR, TC2XS1)) {

                            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:172:16: error: 'F2XEN' was not declared in this scope

cbi(TCKCSR, F2XEN);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:172:4: note: in expansion of macro 'cbi'

cbi(TCKCSR, F2XEN);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:175:13: error: 'TCCR3B' was not declared in this scope

pTCCRX = &TCCR3B;

         ^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:177:8: error: 'TCCR3C' was not declared in this scope

cbi(TCCR3C, DTEN3);

    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:177:4: note: in expansion of macro 'cbi'

cbi(TCCR3C, DTEN3);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:177:16: error: 'DTEN3' was not declared in this scope

cbi(TCCR3C, DTEN3);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:177:4: note: in expansion of macro 'cbi'

cbi(TCCR3C, DTEN3);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:178:8: error: 'TCCR3A' was not declared in this scope

cbi(TCCR3A, COM3B0);

    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:178:4: note: in expansion of macro 'cbi'

cbi(TCCR3A, COM3B0);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:178:16: error: 'COM3B0' was not declared in this scope

cbi(TCCR3A, COM3B0);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:178:4: note: in expansion of macro 'cbi'

cbi(TCCR3A, COM3B0);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:180:8: error: 'TCCR3C' was not declared in this scope

sbi(TCCR3C, DTEN3);

    ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:180:4: note: in expansion of macro 'sbi'

sbi(TCCR3C, DTEN3);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:180:16: error: 'DTEN3' was not declared in this scope

sbi(TCCR3C, DTEN3);

            ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:180:4: note: in expansion of macro 'sbi'

sbi(TCCR3C, DTEN3);

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:181:4: error: 'TCCR3A' was not declared in this scope

TCCR3A = (TCCR3A & ~_BV(COM3B0)) | (wmode & 0x10);

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:181:28: error: 'COM3B0' was not declared in this scope

TCCR3A = (TCCR3A & ~_BV(COM3B0)) | (wmode & 0x10);

                        ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:182:4: error: 'DTR3A' was not declared in this scope

DTR3A = dband;

^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:183:4: error: 'DTR3B' was not declared in this scope

DTR3B = dband;

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp: In function 'uint16_t pwmFrequency(uint8_t, uint32_t)':

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:224:22: error: 'TCKCSR' was not declared in this scope

boost = bit_is_set(TCKCSR, TC2XF1);

                  ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:224:30: error: 'TC2XF1' was not declared in this scope

boost = bit_is_set(TCKCSR, TC2XF1);

                          ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:226:12: error: 'ICR3L' was not declared in this scope

pICRX = &ICR3L;

        ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:227:10: error: 'TCCR3B' was not declared in this scope

csxs = TCCR3B & 0x7;

      ^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\wdt.h:41,

             from C:\Users\Duong\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:19:

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp: In function 'uint32_t pwmResolution(uint8_t, uint8_t)':

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:276:22: error: 'TCKCSR' was not declared in this scope

boost = bit_is_set(TCKCSR, TC2XF1);

                  ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:276:30: error: 'TC2XF1' was not declared in this scope

boost = bit_is_set(TCKCSR, TC2XF1);

                          ^

C:\Users\myuser\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\main.cpp:278:10: error: 'TCCR3B' was not declared in this scope

csxs = TCCR3B & 0x7;

      ^

exit status 1
Error compiling for board Larduino w/ LGT8F328D-SSOP20.`

SoftwareSerial - 32Mhz support

In 32Mhz Mode SoftwareSerial does not work.

#error This version of SoftwareSerial supports only 20, 16 and 8MHz processors

Maybe it only needs new DELAY_TABLE for F_CPU == 32000000 in SoftwareSerial.cpp?

LED_BUILTIN

In /hardware/LGT/avr/variants/standard/pins_arduino.h I would like to see added the line
#define LED_BUILTIN 13
to bring it more inline with standard Arduino Nano library

Delay() dont function.

Hey. I compiled a sketch that worked perfectly on the original Atmega328. I see that the delay() function does not work at all, and millis() behaves very strangely, instead of the interval of 15 seconds, I get about 30. How can I properly configure the MCU?

Larduino mini LCd 16x02 問題,

Larduino mini 板用在LCd 16x02 出現不穩定問題, 嘗試過更換新的LCD, 增加電容, 全不能解決, 試驗了很長時間, 最後再換了 arduino nano 便沒有問題, 請問如何處理???

LGT8F328D - SSOP20 / can not load sketch with Optiboot bootloader

I have some bare chip LGT8F328D (not P) and I successfully loaded the Optiboot bootloader into these chips with LGT SWDICE (I plugged a LED to pin PB5 and it flashes in triple then stop then flashes again, same as LGT8F328P). I have tried the following Optiboot

optiboot_lgt8f328d_intosc.hex
optiboot_lgt8f328d.hex
optiboot_lgt8f88ds20.hex

However, when connect the bare chip via USB TTL CP2102 but I can not load any sketch with Arduino IDE, avrdude reports the following error

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x19

With "resp=0xXX" change everytime I tried to reload.
I also tried to reset the chip manually by providing a reset button to GROUND line for reset (the chip is actually reset as it stops flashing), but it doesn't work.

I noted that only this bootloader make the LED @ PB5 flashed: optiboot_lgt8f328d_intosc.hex, the others don't. Is this compiled correctly since I tried to read the source codes and found that it includes lgtx8e.h / not lgtx8p.h.

I tried the chip LGT8F328P with optiboot_lgt8f328p.hex and it works like a charm without any problem, I tried with ~ 5 chips LGT8F328P and 3 chips LGT8F328D and experience the same problems, all the P chips work like a charm.

Have anyone successfully done with LGT8F328D?

WatchDog Interrupt

The Watchdog Timer interrupt is used as the tick timer by freeRTOS but the LGT8F appears to have the WOTON fuse incorrectly set to allow this to happen..

SPI Clear Interrupt Flag

Hi All,

I'm facing a strange problem. I'm writing some assembly code to LGR8F328P(SSOP20) as a SPI slave. The interface is working well sending some bytes, but when I'm using SPI interrupt I'm not getting a way to clear SPIF in SPSR. Have someone a working code C/Assembly to deal with SPI interrup and clear the SPIF flag?

Regards

Optiboot Source for LGT8F328P

I found when I compile the Bootloader for the LGT8F328P from the source coming with this core, the hex file differs from the supplied one and it also does not work when flashed on the chip. While the supplied hex works like charm I wonder with what source it was built. Anyone has a clue?

Nothing compiled

Hi,
I can not compile anything. Although fully complied with all the conditions specified in the file readme. The installation path is correct. All is correct, but I have error
"C:\Users\Konstyantyn\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-gcc" -c -g -Os -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_LARDU_328E -DARDUINO_ARCH_AVR "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f" "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\variants\lgt8fx8p" "D:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\wiring_analog.c" -o "C:\Users\KONSTY1\AppData\Local\Temp\arduino_build_105324\core\wiring_analog.c.o"
"C:\Users\Konstyantyn\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-gcc" -c -g -Os -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_LARDU_328E -DARDUINO_ARCH_AVR "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f" "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\variants\lgt8fx8p" "D:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\hooks.c" -o "C:\Users\KONSTY
1\AppData\Local\Temp\arduino_build_105324\core\hooks.c.o"
"C:\Users\Konstyantyn\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-gcc" -c -g -Os -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_LARDU_328E -DARDUINO_ARCH_AVR "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f" "-ID:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\variants\lgt8fx8p" "D:\Konstyantyn\Documents\Arduino\hardware\LGT\avr\cores\lgt8f\wiring_pulse.c" -o "C:\Users\KONSTY~1\AppData\Local\Temp\arduino_build_105324\core\wiring_pulse.c.o"
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.

exit status 1
Ошибка компиляции для платы LGT8F328P-LQFP32 MiniEVB.

In this case, I just tried to compile one of the examples for your board.
Will there be any help from your side?

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.