I have some experience with the Arduino IDE (A-IDE) and a Raspberry Pi Pico. I'm on Linux, A-IDE ver. 2.0.3. I've never owned an actual Arduino.
I'm trying to do what they do on this website. That is: I'm trying to "convert" a CardKb keyboard (from the M5Stack range of "gadgets") into a keyboard that will work with UART. See picture below, my setup looks exactly like it because I bought the very same programmer and adapter:
I have to admit that I didn't think it would be this difficult: I'm in over my head. I don't know what a programmer is. I'm confused as to where the Atmel ATMEGA328P chip is : on the programmer or on the keyboard. I have no idea what the program avrdude is.
I really, really, really tried and have been on the internet for about a day or two straight through the night but I'm pulling my hair out getting crazy. No matter what I do I can't get the Arduino IDE to "program" the CardKb keyboard.
I don't even know if I have to choose "Run bootlader" (I don't know what that is) or to simply upload the sketch.
The error that I get is somewhat the same every time (I even tried on an ancient Win 10 32 bit machine w/ Arduino IDE 1.8). The compiling of the sketch always goes well but the process hangs at the point of uploading the sketch or compiled firmware (I do not know what I'm actually doing).
I do not understand why I cannot choose a port. The internet says that the programmer does not behave like a COM port (or: tty (teletype) in Linux land) but it is another sort of USB device or class. If that's so then why can't I say to the Arduino IDE where to find it??? Sorry for the newbe questions but I really, really tried.
Error with or without (!) the programmer attached to my computer (duh!):
Failed uploading: no upload port provided
Error with the programmer (but not the keyboard attached) when I try to upload the sketch and choose /dev/ttyS0 (in Windows you'd call that COM1) as port:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
I can see that it tries to use the program avrdude (???) to upload something.
Error when I try to "Burn bootloader" (I've no idea what that is) it tries to use the program avrdude again (?):
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/my_name/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/my_name/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : usbasp
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: auto set sck period (because given equals null)
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Failed chip erase: uploading error: exit status 1
On the official website documentation for the CardKb is says: "The default Address is 0x5F". Should I somehow choose that as the "PollValue" instead of 0x53?
The A-IDE screen is supposed to look like this:
But mine looks like this and I therefore cannot determine, for instance, the used clock frequency:
Sometimes I get an error (that i can'r reproduce right now) about the programmer's USB particulars, which are (dmesg):
New low-speed USB device number 7 using ehci-pci
New USB device found, idVendor=16c0, idProduct=05dc, bcdDevice= 1.04
usb 1-1.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.1.4: Product: USBasp
usb 1-1.1.4: Manufacturer: www.fischl.de
and (lsusb):
Bus 001 Device 007: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
And then there's the warning from the website from which I got the sketch:
This board uses the internal oscillator. It is important that you do not accidentally choose an external oscillator, or else you won't be able to program it again unless you actually attach an external oscillator to the board. I found this out the hard way. I now have two dead keyboards.
Did I brick my CardKb?
Oh, and by the way, here's the .ino.