Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with uart on attiny1624 #38

Open
marco-117 opened this issue Feb 7, 2022 · 1 comment
Open

problem with uart on attiny1624 #38

marco-117 opened this issue Feb 7, 2022 · 1 comment

Comments

@marco-117
Copy link

Hi,

i wanted to use the new implemented attiny1624, but i have issues with the two UARTs.
I tried the code in PlatformIO and in the Arduino IDE. In the Arduino IDE the UARTs are sending and receiving. In PlatformIO at least on UART dont work, i didnt check wich UART dont work or if both dont work.

I hope somone can help.

@JorgeTorres01
Copy link

hi marco-117

In the last few days, I tested the new Attiny series (attiny426). I'm checking if the PWM, I2C, SPI, ADC, DAC, UART... on PlatformIO works with "functions Arduino"

The PCB that I used does not use some pins, ex. PB2, PA3, ... so I didn't test the RxD (PB3), TxD (PB2) (Serial). Only the *RxD, *TxD with Serial1 and its work :

#include <Arduino.h>

FUSE_t fus;
LOCKBITS = LB_RWLOCK_gc;

void setup () {
	fus.WDTCFG    = FUSE_WDTCFG_DEFAULT;
	fus.BODCFG    = FUSE_BODCFG_DEFAULT;
	fus.OSCCFG    = FUSE_OSCCFG_DEFAULT;
	fus.SYSCFG0   = FUSE_SYSCFG0_DEFAULT;
	fus.SYSCFG1   = FUSE_SYSCFG0_DEFAULT;
	fus.APPEND    = FUSE_APPEND_DEFAULT;
	fus.BOOTEND = FUSE_BOOTEND_DEFAULT;

	Serial1.begin(115200);
}

void loop () {
	Serial1.println("test");
	delay(1000);
}

image

platformio.ini

[env]
platform = https://github.com/platformio/platform-atmelmegaavr.git
board = ATtiny426
framework = arduino

[env:Upload_using_pyupdi]
upload_protocol = custom
upload_speed = 115200
upload_port = COM21
upload_flags =
  -t
  uart
  -d
  $BOARD_MCU
  -u
  $UPLOAD_PORT
  -c
  $UPLOAD_SPEED
upload_command = pymcuprog write $UPLOAD_FLAGS -f $SOURCE -C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants