Here's a case of Blink test on a ATtiny202 that is working fine with Arduino on all separate PortA,0,1,2,3,4
(except the PortA map is different dosen't match Microchips datasheet document :
2019 Microchip Technology Inc. Complete Datasheet DS40002159A-page 15 show on the screen cap below)
with GCBasic dosen't work at all on all individual PortA pin (with a successfully compiled message)
Here's the listing of Arduino when compiling follow by GCBasic compiling
'---------------------------------------------------------------------' Microchips ATtiny202/402 Datasheet 2019 Microchip Technology Inc. Complete Datasheet DS40002159A-page 15'---------------------------------------------------------------------'---------------------------------------------------------------------' Arduino ATtiny202 Blink Test Upload Using Programmer'---------------------------------------------------------------------Sketchuses456bytes(22%)ofprogramstoragespace.Maximumis2048bytes.Globalvariablesuse10bytes(7%)ofdynamicmemory,leaving118bytesforlocalvariables.Maximumis128bytes."C:\Users\jackc\AppData\Local\Arduino15\packages\megaTinyCore\tools\python3\3.7.2-post1/python3"-u"C:\Users\jackc\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.11/tools/prog.py"-tuart-uCOM6-b57600-dattiny202--fuses0:0b000000002:0x026:0x047:0x008:0x00"-fC:\Users\jackc\AppData\Local\arduino\sketches\2B4FE903EBF800AD7AF4DD65A9BB73D0/sketch_sep12a.ino.hex"-awrite-vSerialUPDIUPDIprogrammingforArduinousingaserialadapterBasedonpymcuprog,withsignificantmodificationsByQuentinBolseeandSpenceKondeVersion1.3.1-Aug2025UsingserialportCOM6at57600baud.Target:attiny202Setfuses:['0:0b00000000','2:0x02','6:0x04','7:0x00','8:0x00']Action:writeFile:C:\Users\jackc\AppData\Local\arduino\sketches\2B4FE903EBF800AD7AF4DD65A9BB73D0/sketch_sep12a.ino.hexpymcuprog.programmer-INFO-Settingupprogrammingsessionfor'attiny202'pymcuprog.deviceinfo.deviceinfo-INFO-Lookingfordeviceattiny202pymcuprog.serialupdi.physical-INFO-Openingport'COM6'at'57600'baudpymcuprog.serialupdi.link-INFO-STCS08to0x03pymcuprog.serialupdi.link-INFO-STCS06to0x02pymcuprog.serialupdi.link-INFO-LDCSfrom0x00pymcuprog.serialupdi.link-INFO-UPDIinitOKpymcuprog.serialupdi.link-INFO-STCS06to0x02pymcuprog.serialupdi.link-INFO-SettingUPDIclockto4MHzpymcuprog.serialupdi.link-INFO-STCS03to0x09pymcuprog.serialupdi.physical-INFO-Switchingto'57600'baudpymcuprog.serialupdi.application-INFO-SIB:'tinyAVR P:0D:0-3M2 (01.59B14.0)'pymcuprog.serialupdi.application-INFO-DevicefamilyID:'tinyAVR'pymcuprog.serialupdi.application-INFO-NVMinterface:'P:0'pymcuprog.serialupdi.application-INFO-Debuginterface:'D:0'pymcuprog.serialupdi.application-INFO-PDIoscillator:'3M2'pymcuprog.serialupdi.application-INFO-Extrainfo:'(01.59B14.0)'pymcuprog.serialupdi.application-INFO-Using16-bitUPDIpymcuprog.serialupdi.link-INFO-LDCSfrom0x00pymcuprog.serialupdi.application-INFO-PDIrevision=0x02pymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.application-INFO-EnteringNVMprogrammingmodepymcuprog.serialupdi.link-INFO-LDCSfrom0x07pymcuprog.serialupdi.application-INFO-Applyresetpymcuprog.serialupdi.link-INFO-STCS59to0x08pymcuprog.serialupdi.application-INFO-Releaseresetpymcuprog.serialupdi.link-INFO-STCS00to0x08pymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.nvm-INFO-NospecificinitializerforthisproviderPingingdevice...pymcuprog.programmer-INFO-ReadingdeviceID...pymcuprog.serialupdi.application-INFO-SIB:'tinyAVR P:0D:0-3M2 (01.59B14.0)'pymcuprog.serialupdi.application-INFO-DevicefamilyID:'tinyAVR'pymcuprog.serialupdi.application-INFO-NVMinterface:'P:0'pymcuprog.serialupdi.application-INFO-Debuginterface:'D:0'pymcuprog.serialupdi.application-INFO-PDIoscillator:'3M2'pymcuprog.serialupdi.application-INFO-Extrainfo:'(01.59B14.0)'pymcuprog.serialupdi.application-INFO-Using16-bitUPDIpymcuprog.serialupdi.link-INFO-LDCSfrom0x00pymcuprog.serialupdi.application-INFO-PDIrevision=0x02pymcuprog.serialupdi.link-INFO-LDCSfrom0x0Bpymcuprog.serialupdi.application-INFO-DeviceIDfrompyupdi='1E9123'rev'B'pymcuprog.nvm-INFO-DeviceID:'1E9123'pymcuprog.nvm-INFO-Devicerevision:'B'pymcuprog.nvm-INFO-Deviceserialnumber:'b'51523131382045e22d74''Pingresponse:1E9123Settingfuse0x0=0x0Writingliteralvalues...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing1bytesofdatatofuses...pymcuprog.programmer-INFO-Writecomplete.Verifyingliteralvalues...pymcuprog.programmer-INFO-Reading1bytesfromfuses...pymcuprog.programmer-INFO-Verifying...Actiontook0.04sSettingfuse0x2=0x2Writingliteralvalues...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing1bytesofdatatofuses...pymcuprog.programmer-INFO-Writecomplete.Verifyingliteralvalues...pymcuprog.programmer-INFO-Reading1bytesfromfuses...pymcuprog.programmer-INFO-Verifying...Actiontook0.04sSettingfuse0x6=0x4Writingliteralvalues...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing1bytesofdatatofuses...pymcuprog.programmer-INFO-Writecomplete.Verifyingliteralvalues...pymcuprog.programmer-INFO-Reading1bytesfromfuses...pymcuprog.programmer-INFO-Verifying...Actiontook0.04sSettingfuse0x7=0x0Writingliteralvalues...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing1bytesofdatatofuses...pymcuprog.programmer-INFO-Writecomplete.Verifyingliteralvalues...pymcuprog.programmer-INFO-Reading1bytesfromfuses...pymcuprog.programmer-INFO-Verifying...Actiontook0.04sSettingfuse0x8=0x0Writingliteralvalues...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing1bytesofdatatofuses...pymcuprog.programmer-INFO-Writecomplete.Verifyingliteralvalues...pymcuprog.programmer-INFO-Reading1bytesfromfuses...pymcuprog.programmer-INFO-Verifying...Actiontook0.05sFinishedwritingfuses.Chip/Bulkerase,Memorytypeeepromisconditionallyerased(dependinguponEESAVEfusesetting)MemorytypeflashisalwayserasedMemorytypelockbitsisalwayserased...pymcuprog.programmer-INFO-Erase...pymcuprog.serialupdi.nvm-INFO-ChiperaseusingNVMCTRLErased.Actiontook0.02sWritingfromhexfile...Writingflash...pymcuprog.programmer-INFO-Write...pymcuprog.programmer-INFO-Writing456bytesofdatatoflash...[][======]1/8[============]2/8[==================]3/8[=========================]4/8[===============================]5/8[=====================================]6/8[===========================================]7/8[==================================================]8/8pymcuprog.programmer-INFO-Writecomplete.Actiontook0.23sVerifying...pymcuprog.programmer-INFO-Reading456bytesfromflash...pymcuprog.programmer-INFO-Verifying...Verifysuccessful.Datainflashmatchesdatainspecifiedhex-fileActiontook0.09spymcuprog.serialupdi.application-INFO-LeavingNVMprogrammingmodepymcuprog.serialupdi.application-INFO-Applyresetpymcuprog.serialupdi.link-INFO-STCS59to0x08pymcuprog.serialupdi.application-INFO-Releaseresetpymcuprog.serialupdi.link-INFO-STCS00to0x08pymcuprog.serialupdi.link-INFO-STCS0Cto0x03pymcuprog.serialupdi.physical-INFO-Closingport'COM6''---------------------------------------------------------------------' GCBASIC '' ATtiny202 Blink'---------------------------------------------------------------------#chip tiny202, 20' Set pin direction to outputDirPORTA.0Out' Main program loopDoForeverPORTA.0=1Wait500msPORTA.0=0Wait500msLoop'---------------------------------------------------------------------' GCBasic TERMINAL'---------------------------------------------------------------------GCBASIC(2026.09.08(Windows64bit):Build1634)Compiling:ATtiny202BlinkTest.gcbProgramcompiledsuccessfully(Compiletime:3.690seconds)Summary:Compiled:Programlines:8Subroutines:User:0;System:2of501;Total:2Chipresourceusage:ProgramMemory:90/1024words(8.79%)RAM:0/128bytes(0%)OSC:20Mhz(Internaloscillator)AssemblingprogramusingGCASMProgramassembledsuccessfully(Assemblytime:0.071seconds)CodeSegment:95/1024words(9.28%)Downloadingprogram...AVRDUDEUPDIFriendReading180bytesforflashfrominputfileATtiny202BlinkTest.hexWriting180bytestoflashWriting|################################################## | 100% 0.16 s Reading|################################################## | 100% 0.04 s 180bytesofflashverifiedAvrdudedone.Thankyou.ProgrammingsuccessfulDone--------------------------------------------------------------------ProgrammerEditorSetupName:AVRDUDEUPDIFriendFile:C:\GCstudio\AVRDUDE\avrdude.exeCommandLineParametersavrdude.exe-cserialupdi-pt202-PCOM6-Uflash:w:"%filename%":aWorkingDirectoryC:\GCstudio\AVRDUDE
Thanks for any comments this is not urgent (I will survive)
The code modification you made work correctly with all PortA.# assign to the right PortA location
according to Microchips datasheet. (not as the Arduino )
ounce or twice an error message come up, then I had to
switch Off/On the usb port of the Adafruit HV UPDI then re-select 'Make Hex and Flash'
Did several test on all individual pin# of PortA, and the blinking process work just fine.
My next step it's to use the CCL table and see if it's working ok.
here's ZIP of Blink_copy_A.ino.cpp with all the generated files
With the compiler set at AVRASM I tested all PortA.1,2,3,6,7 with Blink and it's work fiine, no need to toggle the USB port switch. (used system.h from link)
did the blink test on all porta.1.2.3.6.7 with system.h from the link, and AVRASM and it's work fine
no need to switch the adafruit HV programmer off/on or to reboot GCBasic
re-did the same as above, except with GCASM and it's not working (with Programming successful)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll send you couples of 2 different batch the one I have here (came from Aliexpress) and the one from here, I'll mark each pcb so you can differentiate them on the bench.
Last edit: Jberg 2026-09-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If this can help in any way.
I did some CCL coding to verify both side Arduino/GCBasic AVRASM compiler
on Arduino I've got a frequency divider by 2 working fine then with GCBasic it compile the code
send it to the chip, but not running at all seem to be stock
Both program consist of the same registers setup only for the CCL .
Here I send you both builds and misc files detailing the ic pinout that I used for either program
your package is in transit.
Hello everyone,
Here's a case of Blink test on a ATtiny202 that is working fine with Arduino on all separate PortA,0,1,2,3,4
(except the PortA map is different dosen't match Microchips datasheet document :
2019 Microchip Technology Inc. Complete Datasheet DS40002159A-page 15 show on the screen cap below)
with GCBasic dosen't work at all on all individual PortA pin (with a successfully compiled message)
Here's the listing of Arduino when compiling follow by GCBasic compiling
Thanks for any comments this is not urgent (I will survive)
on Arduino when 'digitalWrite(2, HIGH);' it mean PortA.2 on Pin 4
here the list
PORT PIN#
PA0 = 2
PA1 = 3
PA2 = 4
PA3 = 5
PA4 = 7
PA5 = 6 UPDI
Found an issue in the memory clear down routine,
Now changed AVR memory clear down: use native SRAM_START symbol instead of CHIP_INTERNAL_SRAM_START.
Please replace the attached into your GCStudio\GCBASIC\include\lowlevel folder replacing the existing file.
Many thanks , I did replace system.h still no blink on any pins
added the build files.
Let us check it is the RAM clear down. I have remove the RAM clear down from the attached. Please test.
The code modification you made work correctly with all PortA.# assign to the right PortA location
according to Microchips datasheet. (not as the Arduino )
ounce or twice an error message come up, then I had to
switch Off/On the usb port of the Adafruit HV UPDI then re-select 'Make Hex and Flash'
Did several test on all individual pin# of PortA, and the blinking process work just fine.
My next step it's to use the CCL table and see if it's working ok.
Many thanks Evan for your great help and support.
Great. We know the root cause - now to fix.
I need the ASM from the Ardunio blink test. If not avaialbe the HEX. I will figure this out.
Need to sort this for other using the same chipfamily.
Will discuss the pictures after we have this sorted.
I need more info from you.
Using the system.h from https://sourceforge.net/p/gcbasic/discussion/579126/thread/fbfc03c6e0/459d/attachment/system.h Please change the compiler option to use AVRASM - this will help me understand if this is a GCASM issue.
You may have guessed. I do not have this chip.
here's ZIP of Blink_copy_A.ino.cpp with all the generated files
With the compiler set at AVRASM I tested all PortA.1,2,3,6,7 with Blink and it's work fiine, no need to toggle the USB port switch. (used system.h from link)
Last edit: Jberg 2026-09-13
Thank you for the archive.
Did you revert to the previous system.h ? i dont think so.
kept the one from link
And, that system.h worked when compiled with AVRASM? oh
Would you be able to send me a Tiny202? I want to proper understand what is going on.
Thank you.
sorry for the delay, yes it worked when compiled with AVRASM
did the blink test on all porta.1.2.3.6.7 with system.h from the link, and AVRASM and it's work fine
no need to switch the adafruit HV programmer off/on or to reboot GCBasic
re-did the same as above, except with GCASM and it's not working (with Programming successful)
anytime I'll send you some attiny202 to study, on monday I'll prepare it ready to ship.
Last edit: Jberg 2026-09-13
Thank you.
You know this one is not easy. Why? It is not fixed. :-)
Looking forward to getting little package. :-)
Ah! but you've got the talent to solve it
I'll send you couples of 2 different batch the one I have here (came from Aliexpress) and the one from here, I'll mark each pcb so you can differentiate them on the bench.
Last edit: Jberg 2026-09-14
Also, send me ASM and HEX produced when using GCASM and the same files when using AVRASM. I can disaamble to see any differences.
no problem I will.
here's GCASM + AVRASM and the system.h used when compiling
for shipping are you able to solder header, (soldering iron) if not I'll send with header on the pcb's
I can do some soldering. :-)
Mark as a gift!!! As it is.
If this can help in any way.
I did some CCL coding to verify both side Arduino/GCBasic AVRASM compiler
on Arduino I've got a frequency divider by 2 working fine then with GCBasic it compile the code
send it to the chip, but not running at all seem to be stock
Both program consist of the same registers setup only for the CCL .
Here I send you both builds and misc files detailing the ic pinout that I used for either program
your package is in transit.