RalphBacon / LGT8F328P-Arduino-Clone-Chip-ATMega328P

An improved ATMega328P with this cheap clone Logic Green LGT8F328P
GNU General Public License v3.0
142 stars 37 forks source link

Serial number problem #4

Closed RudolfAtHome closed 1 year ago

RudolfAtHome commented 3 years ago

Your instructions only give me the output "F3". I'm using the Arduino package from dbuezas/lgt8fx. there are definitions of GUID0 ... GUID3, where GUID0 has a value of F3

What's this GUID then? Each LGT8F328P has a unique GUID (serial number) built in. Useful for encrypting things. To retrieve the number (it's read-only) do this in your sketch setup(): uint32_t guid = (uint32_t)&GUID0;

To display that number in its intended HEX format do this: Serial.println(guid, HEX);

Simples, right?

RalphBacon commented 3 years ago

Simples, agreed! Thanks for the update, appreciated, Rudolph.

Gjorgjevikj commented 1 year ago

Actually it should be uint32_t guid = (((uint32_t)GUID3)<<24) | (((uint32_t)GUID2)<<16) | (((uint32_t)GUID1)<<8) | ((uint32_t)GUID0);

RalphBacon commented 1 year ago

OK, Dejan, I'll take that at face value because I am not going to test it out. But thanks for the update @Gjorgjevikj 👍