Podchaser Logo
Home
#637 – CH32V003…fun! with CNLohr

#637 – CH32V003…fun! with CNLohr

Released Sunday, 25th June 2023
Good episode? Give it some love!
#637 – CH32V003…fun! with CNLohr

#637 – CH32V003…fun! with CNLohr

#637 – CH32V003…fun! with CNLohr

#637 – CH32V003…fun! with CNLohr

Sunday, 25th June 2023
Good episode? Give it some love!
Rate Episode

Episode Transcript

Transcripts are displayed as originally observed. Some content, including advertisements may have changed.

Use Ctrl + F to search

0:00

This is the Empire Podcast. Released

0:03

June 25th, 2023. Episode 637. CH32V003. Fun with Cian Lor.

0:31

Welcome to the Empire. I'm Chris Gamill of Contextual Electronics.

0:34

And I'm Cian Lor. I've got a YouTube channel

0:36

and do a lot of online open source

0:38

and open source hardware work.

0:40

Welcome Cian. You are doing some

0:42

awesome stuff. And in fact, you are doing stuff

0:44

that I kind of always wish I would have done, namely

0:47

like do anything with that CH32 part.

0:50

And we're definitely gonna talk about that here. So thanks for

0:53

not only showing us the world, showing the world what

0:55

you're doing with the CH32 part, but also

0:57

building some tooling around it. Yeah, it was

1:00

the CH32V003 was kind of

1:02

the first time I looked at one of these cheap Chinese

1:04

devices in the world of like giga

1:06

devices and Poya. And it was like, this

1:09

is it. This is the one. And when I looked

1:11

too, there was really no good tooling

1:13

around it. It was either the proprietary

1:15

SDK,

1:16

which was really overburdened,

1:19

or like the platform IO,

1:21

which was also overburdened. I was like, no, I

1:23

think that this is the time to act

1:26

when if we can make some tooling around this to

1:28

really open up the power of the chip, while

1:30

this is hot, like I think a lot of people are going

1:33

to have a lot of fun with this. I

1:35

actually didn't realize there was a platform

1:37

IO plugin for it. So that

1:40

that's been around since the beginning, almost? About the beginning.

1:42

Yeah, it was it was enough to get the chip

1:44

off the ground, but just barely. It it

1:47

used all the same Mound River EVT

1:49

stuff. So Mound River is the proprietary

1:52

sort of development kit environment for

1:54

the CH32V003 and really

1:57

the whole CH32V line. CH being

1:59

WCH, the semiconductor

2:02

in China. Yep. Yep. And V,

2:05

meaning RISC-V.

2:06

Oh, the V003, right. Yep. Oh,

2:08

yeah. Yeah. Yeah. The RISC-V is

2:11

CH32V. Yep.

2:13

Right. Yeah. And actually, so

2:14

Dave, my co-host, has also done, I think,

2:17

you referred to your video. You referred to his video. But

2:19

like the Moon River, Mound River?

2:21

Mound River, yeah. Yeah. Yeah. And

2:23

it's just like an eclipse-based IDE, right? It's nothing fancy.

2:26

It looks kind of just standard-style tooling.

2:29

No, the IDE is just fine.

2:31

It's just a lot of it has to do with sort

2:33

of the issue, I think, is that this

2:35

entire space has sort of acquired

2:38

a baggage surrounding it because of a lot

2:40

of decisions that ST made about 10 years

2:42

ago. And all the way

2:44

down to, like for instance, the

2:47

minimum blink program

2:50

for the CH32V003 is

2:53

like, I think, over a kilobyte.

2:55

And it also has to do like software

2:57

divide and multiply on boot up. Like

3:00

it's just a bunch of,

3:02

any

3:03

time you do pretty much anything with it, it brings

3:05

in far more than you would hope that

3:08

it should bring in.

3:09

That's like in the, what, like the STM32F0 line? Where

3:13

did that come from? Oh, yeah. So in

3:16

the STM32 world, they

3:18

have sort of this how, they call

3:20

it, the hardware abstraction layer. In order to

3:22

abstract all of the hardware from most

3:24

user programs, in order to facilitate people

3:27

moving between processors

3:29

in the STM32 family. And

3:32

it kind of sort of worked-ish

3:35

for them. It also had this interesting

3:37

effect of sort of vendor lock-in, at

3:39

least up until recently, because like,

3:42

yes, you could be able to take your code and port

3:44

it to something else if you were conscious about it. But

3:46

if you're already using the entire

3:48

SDK from ST microelectronics,

3:51

then it's a little bit harder to get out

3:53

of that ecosystem.

3:55

And it worked out like really well. And it also

3:57

made it easier for some programmers to be able

3:59

to hop in.

3:59

and like get started, it's

4:02

just that it's still an abstraction. It still

4:04

adds sophistication and complication and

4:07

problems to the overall software development

4:09

process.

4:10

Yeah. Yeah. I think that, and it sounds

4:13

like a mistake that's been many times in a lot of

4:15

different platforms as well. Not just, not just there,

4:17

just like the making it, making it easier

4:19

and making the support load easier for the company

4:21

that are building these chips.

4:22

Yeah.

4:23

Yeah. And, and, and to an extent

4:25

that kind of makes sense. If somebody says, Hey, I'm

4:28

having trouble with my code. And it's like this

4:30

gnarly drawn out piece

4:33

of very hard to follow C code.

4:35

That's going to be hard to support as, as a company,

4:38

but if they're already forced to use

4:40

your howl, your, your abstraction layer, then

4:42

that gets a little bit easier of like, Oh, well you're doing

4:44

this wrong. So you don't have to worry about some of the lower

4:47

level things in that support burden. So I

4:49

understand where those desires came from, but

4:52

the tax is just so

4:53

heavy that comes with it. It's

4:56

just for me, I've always kind of struggled to find

4:58

some way out from underneath that, that

5:00

load. That's

5:01

interesting. So like, if you find a new part, say

5:04

you found, you know, let's just say vendor X, so there's some

5:06

brand new vendor. Are you like, are you more

5:08

likely to throw away like a howl that

5:10

they provide and then

5:13

go write your own?

5:14

I think it depends on what my goals are. If

5:16

I, my goal is to use this part to accomplish

5:19

a specific project, then no,

5:21

I will absolutely use their howl 100%. And

5:23

I think it is crucial for programmers to understand

5:26

these howls and why they exist. And

5:29

I think that for me, using those howls sort

5:31

of like keeps me up to date with that and keeps

5:33

me my, my understanding of what they're

5:36

trying to accomplish. Like it makes that very

5:38

clear to me. If my

5:40

goal is much more sort of like,

5:42

this seems like a gateway to

5:45

a lot of projects and

5:47

a lot of really interesting stuff

5:49

that could be done, then yes, I'm,

5:51

my goal would hopefully be to

5:54

engineer a new

5:56

sort of like minimal SDK surrounding it.

5:58

But the effort that is, I think, is really important.

5:59

it takes to build one of those SDKs

6:02

to go all the way back to the metal

6:04

and just build something that's fast

6:07

and simple for users to use. It's

6:09

a couple months of investment, so I only

6:11

do so very judiciously. Yeah,

6:14

that's a lot of cozying up to

6:16

a data sheet on a Saturday night with a glass

6:18

of wine sort of thing, huh? A

6:21

lot of register maps in your future. Yes,

6:24

there had been many nights

6:26

in the last couple of months where I'm sitting there on my

6:28

cell phone, paging through the technical reference

6:31

manual in bed, making sure that

6:33

I'm not missing something. It's

6:35

one of those things where it's like, this is really hard

6:37

to do if a data sheet is a thousand pages.

6:40

But when a data sheet is only 300, 400 pages,

6:43

it becomes tenable for one person to actually

6:46

... And for several people to actually understand

6:49

what makes this chip tick. I

6:52

think that that's a really interesting part too

6:54

about the CH32V is that it isn't

6:56

a thousand page technical reference manual. It

6:59

is something where you can sit down

7:02

and over the course of a few weeks, you can

7:04

really understand, maybe not all

7:06

of the details of every bit and every register, but

7:08

you can understand how the chip kind

7:10

of fits together

7:12

and how you can leverage

7:14

that in your own sort of engineering.

7:17

Yeah, that makes sense. I think

7:19

especially like as you're saying, collaborating and not

7:21

having to compartmentalize. There's

7:23

abstraction layers, but then there's also just compartmentalizing

7:25

for

7:26

as your team needs to grow, if you want to have a faster

7:29

timeline, then you start to grow how many people are a part

7:31

of it. And then you start to compartmentalize and say

7:33

like, well, I'll just do the ADC, but then

7:35

you have to start agreeing on

7:37

APIs and all that other stuff.

7:40

Yeah, a lot of people, I guess, so

7:42

going back to it, when I mentioned, oh, if

7:44

I need to just do this one specific

7:46

thing, I'll just use whatever HAL is available. But

7:48

also if I have a team of like 30

7:51

people and it's going to be some really big effort,

7:54

like that's there, 10 people,

7:56

five people, about five people, I think is where

7:58

this tradeoff happens. That's when

8:01

other environments like free RTOS and stuff like

8:03

that start to actually make sense even

8:05

though they themselves are a massive

8:08

tax to debug ability and and General

8:11

like like the number of times that I

8:13

found where it's like we're like, okay

8:16

now we have the thing almost working But we're

8:18

having to like balance the size of each one

8:20

of the stacks and trying to get like like

8:22

oh But it's it becomes so burdensome

8:25

But the answer is like we wouldn't have

8:27

been able to even get to where we were in the

8:29

speed We were able to unless we had like

8:31

a framework that a lot of people could speak a common

8:33

language into It just bothers me

8:35

that the tax is so high So when

8:37

it comes to something that it's gonna be me alone

8:40

or me with a few other people gonna be working on things

8:42

Then I think there's a lot of value and

8:44

just jettisoning a

8:46

lot of that complexity

8:48

yet also is interesting thinking about like how

8:50

How far you would expect

8:53

the chip to go so like there's the complexity you've already kind

8:55

of talked to like just in like You know,

8:57

sometimes they talk about like killer lines of code But even

8:59

yeah, I think actually data sheet pages is a good

9:01

like kind of hardware firmware crossover one Yeah,

9:05

but

9:05

then like how if

9:07

it was like, you know, so I'm using this nRF 91

9:10

60 a lot and if it's like a dual core M33

9:13

plus Cellular

9:15

interface like craziness, right? It's like that's

9:18

probably gonna have more

9:20

needs for outside libraries and like Interface

9:23

layers to like other, you know third-party

9:26

plug-in type things and then like at that point

9:28

then it probably makes sense to to have

9:31

More stuff than you might want to try and do with it You

9:34

know, it's kind of like how far how far are you gonna try and take

9:36

this thing? That's sort of thing like this specific part

9:38

I think that that that comes down to two pieces

9:41

one is sort of like some of what you've described

9:44

like if you were going to do something that requires

9:47

significant and sophisticated Integration

9:49

with really advanced IP stacks like

9:52

okay fine. You're gonna use like free RTOS

9:54

and lightweight IP or something but

9:56

also it comes down to the programmer like like a lot

9:59

of

9:59

programmers who have lived in

10:02

that world are really only comfortable in that

10:04

world, and there are other programmers who have not lived in

10:06

that world and can go much further on just

10:08

sort of the bare metal. And it's, I

10:10

don't know, I would encourage, I

10:13

would really encourage as many programmers

10:15

as possible to sort of explore

10:17

the

10:18

bare metal arena to see how far they

10:20

can push it because you can

10:22

go so far so fast and you can

10:24

produce products that don't have the

10:27

sort of like the long tail of

10:30

problems that sort of

10:32

come with more sophisticated and deeper

10:34

systems where you're like, yeah, 1% of

10:36

customers, 1 out of every thousand

10:39

times they turn on the device, it doesn't

10:41

turn on. And they have

10:43

to like reboot it. And you're like, okay, well, great.

10:45

That's like, how do you debug that? And it's a lot

10:47

of that is a function of just

10:50

how much complexity has been hidden

10:53

away. Like when you when you shovel complexity

10:55

under the rug, it's still there.

10:58

Like it's not like the complexity goes away just

11:00

because like, Oh, well, my application

11:02

is only 40 lines of code and it does all

11:05

of this cool stuff. Yeah, but like, that's

11:07

great. Like you were able to do that

11:09

quickly. But like at the end of the day, as

11:12

you keep abstracting things up, like

11:14

you now you acquire all

11:17

of the burden and all of the technical

11:19

debt of all of the pieces underneath

11:21

of the whole umbrella. See, now that's interesting

11:23

because that so we've been talking about our tosses and

11:25

like kind of the the dangers

11:26

of an RTOS. But that also sounds to me when you

11:29

say like, it's only 40 lines of code. That

11:31

sounds like kind of more modern interpreted

11:34

languages that people are pushing down onto micros

11:36

as well. But like, yeah, it's only like, you

11:38

know, it's like one line to get a to

11:40

get a network connection is like, okay, sure.

11:43

Yeah, but I mean, there

11:45

is a sort of trade off there if it is a hobby. Yeah,

11:48

like, yeah, like there is no doubt there's a lot

11:50

of ease of use versus like, like

11:52

long longevity and yeah,

11:55

security.

11:56

Yeah, that's interesting. So

11:59

you said, you know,

11:59

You're cozying up to the data sheet quite often.

12:02

Given your experience, I actually had a friend tell

12:05

me recently, he's like, the thing I'm most scared

12:07

about switching from arm to risk five

12:09

is actually just that I know the arm instruction

12:12

set pretty well, the card sex M instructions

12:14

said pretty well. Is it like,

12:16

is it like reading a new language or is it like, I'm

12:19

not going to sugar coat it. I'm just not going to sugar coat

12:21

it. It's it is. I

12:23

know arm assembly pretty well.

12:26

I know extensive assembly better and

12:28

I know X86 assembly better than that. And

12:30

it has actually been a struggle because there's

12:33

an actually, I guess I know AVR assembly

12:35

the best and it has been a struggle

12:38

with the, the risk five architecture because

12:40

there are,

12:41

there are so many situations and it sounds

12:43

really nitpicky, but that

12:46

is what we're here for. Cien this is what we're here for, but

12:49

this is what the amp hour that's basically like a sub

12:51

subtext of the amp hour. It's really nitpicky

12:54

about electronics. The, the, the funny

12:56

part is like there are things

12:58

which on every other sane architecture

13:00

are just a single instruction

13:03

and in, in like the

13:05

risk five world, that's just not

13:07

the case. Like, like if you wanted

13:09

to compare, like there's no, like, as far

13:11

as I know, maybe I'm misremembering, but I don't think

13:14

that there's any,

13:15

any sort of like compare this register

13:17

against an immediate and jump if there's

13:19

no like flags for like an

13:22

overflow flag or like a negative

13:24

flag or something like that. All of these things

13:26

are, it's, it's, it's

13:28

very C centric

13:30

instead of assembly centric

13:32

and it's very like, and I say

13:34

assembly centric, it's still assembly, but it's like,

13:37

there is sort of like when you code things in assembly,

13:39

there's some nice things to have that

13:41

like aren't necessarily in C or like that,

13:44

that risk five is kind of geared around

13:46

like, no, we wanted to make a processor,

13:49

which is going to be like the

13:51

reduced instruction set, and it's going to be

13:53

able to compile from C to this

13:56

very effectively. And they, they really accomplished

13:58

it, but it means that when. you're writing

14:00

the assembly code for RISC-V, which inevitably

14:03

you will always have some of. We're

14:06

going to get to that, I'm sure. With the

14:08

USB stuff, I'm sure you were down in the depths.

14:10

Yeah. Well, I mean, it's not just that. It's

14:12

a lot of places you find yourself writing assembly

14:15

for a lot of things. But

14:18

it's like, yeah, I did spend a lot of time writing

14:20

assembly for the USB thing. But

14:22

anyway, it is sort of like,

14:25

okay, I have to actually do

14:27

all of the actions at a very low level

14:29

and very carefully. And it has taken

14:32

me about as long to

14:34

really learn RISC-V assembly as it has

14:36

just about any other assembly. It's not like,

14:39

it's not that it's like so close to some other one

14:41

I was able to just jump to it. Maybe there is,

14:43

I guess like maybe MIPS it's probably very similar to,

14:45

but I never learned MIPS assembly.

14:48

So it's been a bit annoying.

14:51

Yeah, that's an interesting take. I mean,

14:52

like we've kind of described here, you are kind of in the

14:55

depths of the data sheet and you're doing all this stuff anyway.

14:57

So it sounds like

14:59

a good thing to learn anyways

15:01

and the switchover is kind of tough. So

15:04

it's good to know. Yeah. And

15:06

I would say like no matter what architecture you're on, if you know

15:08

the assembly,

15:09

like you're going to make better decisions

15:12

when you're coding for it. Like

15:14

if for instance, if you're on extensa,

15:16

like extensa, the ability to

15:18

go load a 32 bit

15:20

like immediate, like a 32 bit

15:22

value and load it into register or do something

15:24

with it is actually really slow.

15:27

But like, that's not the case on, on risk five

15:30

on risk five, it's two instructions, but

15:32

it's, it's much slower on extensa. And so sort

15:34

of like the way that you will write your C code

15:37

should be slightly changed

15:40

in order to kind of think through how, how

15:42

is this going to really be compiled on the system?

15:45

Yeah. I wonder, is there additional benefits

15:47

to knowing

15:49

the low level stuff because it's,

15:51

it doesn't seem like the extensive stuff is often, you know,

15:54

when we're talking about the, you know, when we say extensa these days, I feel like,

15:56

all right, we're talking about expressive, right? Yeah.

15:59

Yeah. It's not like a lot of people

16:02

are using extents otherwise though it does exist. And

16:04

it's like, okay, so it's on expressive parts, but

16:06

those things are beasts, right? I mean, like they are really beefy

16:09

processor. They're, they're like 150 plus

16:11

megahertz cores and like, but

16:14

they're not targeting it down at the low level

16:16

stuff. Whereas the risk five stuff is trying to

16:18

play in that low, that low end environment.

16:21

That is true.

16:22

It's the same token. The risk five stuff is

16:24

just generic. It just happens to be that

16:27

somebody is playing with it in the really

16:29

like low end space. And like going

16:31

back to that, even like the,

16:34

it is funny cause risk five

16:37

in sort of the space of where the CH 32 V

16:39

double O three lives. Actually, let's just clarify.

16:41

C H 32 V double O three is a risk

16:43

five processor. It's got 48 megahertz. It's

16:46

got 16 kilobytes of flash, two

16:48

kilobytes of Ram. I was literally about to ask us

16:50

to zoom out and ask about this. This is perfect. Yeah.

16:53

So it, it's, it is like,

16:55

it's basically an 80 mega one 68 with more Ram.

16:59

Like it's,

17:02

that's basically what it is. It's

17:04

a little bit faster.

17:05

It's got, it's got 18 GPIOs. It's

17:07

got you are spy. I swear to see, I'm reading the TV

17:09

page. I, some spy, I swear to see

17:12

eight channel, 10 bit ADCs timers,

17:15

four different types of packages, what

17:17

else?

17:18

Anything? Oh, yeah. I mean, it's,

17:20

it's basically an AVR. And

17:22

like, I think that's kind of what drew me to it

17:25

is just that it really is this basic part,

17:28

except that it is, it's uses risk five, which is

17:30

really nice for a few reasons. One is that

17:32

like all of the existing compiler

17:34

tooling is being done for you. You

17:37

even get GDB, you get all of

17:39

the extra, like the, the sort of

17:41

low level tools work

17:43

and they work really well because they've been tested

17:46

across a wide variety of things versus like AVR

17:48

GCC is

17:51

like, I'm trying to remember. There was actually like

17:53

a product I was working on where we

17:55

found out every now and then it like

17:58

lost an

17:59

individual. And it's

18:01

hard to explain like why that's important, but like it was

18:03

literally just like X plus plus

18:06

and now X isn't right. And we dug into it. It turns

18:08

out there was a compiler bug where it

18:10

literally couldn't reliably

18:13

add a nut, like, like I equals I plus

18:16

one on a 32 bit end. And it's like, how

18:18

does that even happen for a mature

18:20

compiler? But like, I mean, I would be.

18:23

I understand that it's just because the

18:25

AVR GCC doesn't have as much mileage on

18:27

it as some of the other compilers, but it's still just

18:30

wolf. Yeah, it is interesting too, because

18:32

like you it seems like you're still not

18:34

still you're in that interstitial space, you

18:37

know, where it sounds like you're kind of talking like

18:39

a like a grumpy gray beard, right? Of like

18:41

I code assembly and I've dealt with

18:43

tools that have this other stuff. And then, you

18:45

know, someone listening now, they're like, well, of course everything works.

18:47

Of course you have all free tooling. Of course you have compilers

18:50

that are reliable. Like, you know, like that kind of like

18:52

difference in perspective.

18:54

Some of that is number of miles

18:56

on you in terms of like how many projects you've done. But

18:59

it's also kind of bridging the gap from the

19:01

old microcontroller way into some of the new microcontroller

19:04

ways. It feels like.

19:05

Yeah, I think that that Espressif

19:07

was

19:08

a very good picture

19:11

of that, that there was only going to be one of these

19:13

in the history of all of computing. And

19:16

what happened with Espressif was they

19:19

they use their extensor core and they use

19:21

proprietary cadence

19:24

GCC. The extensor GCC

19:26

was not open source. It was. I

19:29

mean, it was kind of open source, but only half open

19:31

source. And to use the ESP8266

19:34

core, that was not open source.

19:36

You had to use proprietary compiler. And

19:38

it was only through the efforts of a handful

19:41

of people out in the community who like took

19:43

it and was like, this is an amazing chip.

19:45

If this had an open source tool chain, it would

19:48

be amazing. And

19:50

they did it. And sort of like, I think the only

19:52

reason Espressif opened up and people might not

19:54

remember that originally Espressif was completely

19:57

closed. They didn't care at the beginning.

19:59

They did turn, which is great. I mean, like

20:02

they recognize the power of it. They're like, Oh wow, look at,

20:04

look at this community stuff. That's great.

20:06

They definitely have invested in a lot, but

20:08

they only turned after the

20:11

community stepped up and was

20:13

like, this is so much more

20:15

powerful than you guys realize. Right.

20:17

And people started exploring that space and

20:20

an expressive embraced it. So

20:22

instead of like trying to fight it and doing takedown

20:24

notices off of like, like literally all

20:26

of the early ESP8266 development

20:30

was done on this like leaked

20:32

VM from some partner customer

20:34

of expressive. Oh, really? Oh, interesting.

20:37

XB virtual machine that you run in virtual

20:39

box and it had a copy of like the compiler.

20:43

Sounds like there's going to be a book about this someday, huh? Maybe.

20:46

Uh, I mean, I hope it was because it was

20:48

such a significant thing. Like people,

20:50

people just don't.

20:53

I guess like it was always the norm

20:55

for all of the really interesting

20:57

processors to be totally closed and

21:00

like AVRs were the exception,

21:02

but that's not the case anymore. Now

21:04

more and more, the companies are starting to understand

21:07

that like, no, actually, if we make it available

21:09

to people first, it's,

21:12

it's going to go better. And I think that that like

21:14

WCH also realized that like, that

21:16

was, I think part of their, their big effort

21:19

was they really wanted to make sure that even

21:21

if not a hundred percent of it

21:23

was open, at least it

21:25

was usable by anybody,

21:27

even on their, on their official mound

21:29

river SDK. And, and

21:32

if it wasn't for expressive having

21:34

this fortune that they had where like, because

21:37

expressive

21:39

didn't resist it because expressive

21:41

embraced it, expressive grew,

21:43

I don't, I don't know what their market cap was 15 years

21:46

ago versus like today, but I'm

21:49

pretty sure it's way bigger. It's way bigger.

21:51

Yeah. I mean, they're listed on the Shanghai exchange now. Yeah.

21:54

It's not because they, it's not because

21:56

they had some magic silicon. The silicon

21:58

was no more interesting. than any of the real

22:01

tech silicon or any of the media,

22:03

I guess media tech is bigger, but

22:05

their silicon wasn't

22:07

that interesting.

22:09

It was just interesting that you could

22:11

actually do something with it. Like you

22:14

think about the single like one by one USB, Wi-Fi dongles, those

22:18

existed at that time, but nobody

22:21

had sort of a way of which, oh,

22:23

well, you can go code it and actually flip some GPIOs.

22:26

And it was like, it seems so silly

22:29

that like literally all any of these other companies

22:31

had to do was just, okay, make it

22:33

so other people can flip your GPIOs. But

22:35

I really think it all comes down to that one

22:38

leaked VM. Like, like

22:40

I really think we would be in a different world today

22:42

if that, if that VM had not leaked.

22:44

Doesn't cost plan or the, I mean, like some of it is,

22:47

I mean, I just, you know, much like we're talking about

22:49

the CH32 V double three as well,

22:51

like

22:52

cost is a headlining feature in

22:54

all of these spaces as well. It feels like, I

22:57

feel like that can't be ignored, you know, like, yes, that,

22:59

that is absolutely true. And I think that

23:02

like, so if you look at the time TI sort of had

23:04

there, I forgot the name of the part, but their CC

23:06

series 24. Yeah,

23:09

that one. Yeah.

23:10

And that was, it was functionally

23:14

almost as good as the ESP8266.

23:16

Like if, if they had made the right play, it

23:18

would have been, it would have been the thing that

23:20

hobbyists would have used. But, but

23:23

there is sort of, you're right that there is a sort of

23:25

magic change that happens when

23:28

the modules that you can go plug

23:31

into your part is $5. You

23:33

can get wifi for $5. And

23:35

in reality, like, like we,

23:38

we, people kept finding out ways of making that

23:40

cheaper and cheaper. And so like, by

23:42

the end of it, it was like, okay, well, the reality of it

23:44

is now it's a sub dollar part that

23:47

you can go include on your schematic. And

23:49

now you have wifi or, or the sub dollar part

23:51

is your microcontroller and your wifi. Right

23:54

now it's just like,

23:56

you know, if you have any reason to have any connectivity,

23:58

you'd be a crazy. to do anything

24:00

else.

24:01

And that is an interesting point. Because

24:03

like, so there were other companies

24:05

who were playing in the space that like the cheap Chinese

24:08

or Taiwanese

24:10

like chip market that had wifi at the time, but

24:13

their stuff didn't leak. And so they weren't able to

24:15

make it. And you had these

24:17

other companies like TI who were playing in the space, but

24:20

their stuff was really

24:22

expensive comparatively. Yeah,

24:24

right. And sort of like, I guess

24:26

you're right that it is a confluence. It was a matter of

24:28

them being cheap and it was a matter

24:31

of them also like having the availability

24:33

to do interesting things. Yeah.

24:36

Well, read my book in 24 months as

24:39

I read about the history. I'm just kidding. I'm never writing

24:41

a book like that. That would be terrible. I am

24:43

unfortunately not an author at all. So somebody

24:45

else is gonna have to write that. Yeah.

24:49

Yeah, it's interesting.

24:51

So we were talking a little bit before the show and about

24:53

specifically with the 8266. So

24:56

a lot of it, when I look at the expressive

24:58

stuff, I think

24:59

the community-based growth is definitely

25:02

when the Arduino port started happening. That

25:04

really opened up a lot of things as well.

25:05

But then that was layered on top of an

25:08

RTOS I believe.

25:09

Yes, yeah, it was RTOS, yeah, yeah.

25:12

Yeah, but then you

25:14

started, so you have a YouTube channel, which people should

25:16

go check out of course. And you have some experiments on

25:18

there where you're like, yeah, we don't need

25:20

an RTOS. And you kind of alluded to that earlier

25:22

too. So what did that look like in that

25:25

space?

25:26

It was, well, okay. I guess the 8266 is

25:28

interesting for, there's a caveat

25:31

here. Well, okay, let me say what

25:33

I did and then I'll explain the caveat. So

25:35

one of the things I did was I was like, well,

25:38

the ESP8266 is really interesting

25:40

and fast, but there were aspects

25:43

of it that were kind of being burdened.

25:45

So they called their

25:48

original SDK the non-OS

25:50

SDK, alluding to it being

25:53

a pretty simple and Spartan

25:56

development environment. It had timers

25:58

and it had maps.

25:59

And

26:01

that's really about it as far as their

26:04

OS environment goes. And it

26:06

was a really good thing to write stuff in.

26:10

And then on top of that is how they built

26:12

their Wi-Fi

26:15

stack and their IP stack on to

26:17

like LWIP and their

26:19

proprietary Wi-Fi stack on top of that. And

26:23

it worked out pretty well. It was not nearly

26:25

as heavily burdened as FreeRTOS

26:27

was on the part. So later

26:30

on there was a community port of FreeRTOS

26:33

to the ESP2.66 and the non-OS SDK was

26:39

a lot cleaner and booted much faster and

26:41

more powerful. I would say, well, powerful

26:44

depending on your definition of powerful than

26:46

the FreeRTOS stack. But eventually

26:50

the company really decided like, no, we're going

26:52

to go in the direction of the FreeRTOS. And so I

26:54

was like, well, what happens if you just go the other direction? Just

26:56

kind of as like an experiment. And I was just

26:58

curious, like, because like now all of a sudden you don't have any

27:00

of the same restrictions surrounding like how the hardware

27:03

should be used. You can just use it to do whatever you want.

27:05

And so I explored, I called it no SDK 8266.

27:10

And the answer was like, oh, you can actually just like get

27:12

it to wake up, blink, do some basic stuff,

27:14

use some of the basic IO. Like you could use the DMA

27:17

on the I2S engine to

27:19

send and receive like 80 megahertz

27:21

bit streams and stuff like that with

27:23

like a kilobyte worth of code, which

27:26

also then opens it up like, oh, well now you can just run

27:28

everything from RAM because now you don't

27:31

have to have this huge amount

27:33

of like space that is

27:35

filled with all of the code to support the system.

27:37

Oh, and you can also now flash it like in half

27:40

a second. Like you're compiling and flashing

27:42

processes basically instant. When

27:45

you when you get all of those pieces together, it is kind

27:47

of this fun environment. And a couple of people did

27:49

take that and like do some other fun little projects with

27:51

it. Oh, the one of the other parts about that makes

27:53

it interesting is that when you're in that mode,

27:56

you don't have to work at 80 or 160 megahertz,

27:58

you can just take the part up to around

27:59

on 380 megahertz and it works just

28:02

fine. Wow. Like if

28:04

you're not limited by the same, like

28:07

sort of like assumptions, because like

28:09

they made sure that all of everything

28:12

surrounded the Wi-Fi chip. And

28:14

the way the part is configured, you really can't

28:16

use the part at anything other than 80 or 120

28:19

and still use the Wi-Fi effectively. But

28:21

like if you're not using the Wi-Fi, which

28:23

no SDK 2.66 didn't do, that's

28:26

the caveat. When I wrote this

28:28

non-OS stack, it didn't have Wi-Fi, but

28:30

it is a pretty interesting microcontroller

28:33

at that point anyway.

28:34

And it goes crazy fast and

28:36

yeah.

28:37

So it

28:40

was a fun, interesting

28:42

experiment. Ultimately it was never really adopted

28:45

by any major projects or anything like that. I

28:47

didn't really expect it to be. It was such a strange

28:50

thing to take this part that people are

28:52

like trying to now like go more in the

28:54

direction of free RTOS with. Yeah. And

28:56

then be like, well, what happens if we just tear it all out? It

28:59

was a fun. Yeah, yeah, contrarian. It was just an experiment

29:01

and it, yeah, it was fun, but there really

29:03

wasn't that much that was that interesting about

29:06

it, I think.

29:07

It's interesting. So that is usually the

29:09

point that I have a

29:12

marker in the sand

29:14

that says when there's a networking stack, when there's stuff that's gonna

29:16

be like internet based,

29:18

I think it's into RTOS land.

29:20

Is that a

29:23

fair characterization from your perspective or

29:25

do you put that marker in a different spot given

29:27

our conversation here? I

29:30

don't,

29:33

well, there's really two parts. One is like I acknowledge

29:36

that is usually where the marker is, but

29:38

I acknowledge that only begrudgingly. In

29:41

that like I have done things with

29:44

like IP stacks. One of the videos

29:47

I did was Minecraft on a microscope slide

29:49

where I literally made a circuit board on

29:51

a clear glass microscope slide that

29:53

had an AVR and a

29:56

ENC-424J600, which is

29:58

an ethernet,

29:59

or Ethernet Mac and Fi. Oh,

30:02

yeah.

30:03

And I ran Minecraft on it and a whole

30:05

Minecraft server, multiplayer Minecraft server

30:07

with, I think it supported up to eight players

30:10

and it

30:11

had an SD card to store the chunks

30:13

on. And all of that was on this little

30:16

ATmega 168. Oh, no, it was 320

30:18

ATmega 328. So

30:21

it's got like 32 kilobytes of flash, about

30:23

two kilobytes of RAM. And

30:26

it had no problem doing this. And it could also like

30:28

serve web pages and stuff

30:30

like that while it was working. So like there's

30:32

nothing that stops you from using. Sure.

30:35

Okay. Yeah. These are rules

30:37

of thumb that are probably not applying to CnLore. Is that

30:39

fair? Well, it's not just me. Like there are a lot

30:41

of other people who sort

30:44

of play in this space. Like

30:46

I was definitely not the first one either. Like I

30:48

can't remember his, I know he goes by Igor

30:51

online.

30:52

Igor Plug was one of the

30:54

projects he did, where

30:57

he did a similar thing where it was just like, like

30:59

you say I BitBanged on, like you mentioned I BitBanged

31:02

on the ATtiny85 at some point. Like, yeah,

31:04

I did do BitBanged. But as soon

31:06

as that article hit Hackaday, everybody

31:08

was like, hey, 10 years ago,

31:10

this other guy did it. And Hackaday

31:12

published the article about it. And it was

31:15

like, I had no idea. People

31:17

in a Hackaday comment section pointed out

31:19

as something being done before. That's so odd.

31:22

I mean, it was kind of embarrassing

31:24

that like I had not actually done

31:26

the prior work and realized that they're like, like check

31:28

for it and be like, yeah, no, somebody had already done

31:31

this like 10 years ago. And

31:33

so it's kind of a thing that's been done a fair

31:35

bit. I've

31:37

also sort of in

31:40

working for other people, like

31:42

I've

31:43

seen a lot of custom TCP IP stacks

31:45

out there. Like lightweight IP is not

31:47

the only game in town. And I think

31:50

a lot of people forget that and

31:52

that there's a lot of other trade-offs that can be made. You're

31:54

not limited to that. And

31:57

the same thing goes for things like lightweight USB, which

31:59

is a total.

31:59

It's a huge USB stack. I

32:02

don't really know why it's even called lightweight. Maybe it

32:04

started off as lightweight, but

32:06

like there are lots of other options out there

32:09

and a lot of times, like I think engineers are scared

32:12

of or project managers are

32:14

scared of like, Oh no, it's just USB. We

32:17

can just write that or Oh

32:19

no, it's just ethernet. Like it's okay. We

32:23

can do that. Like, like

32:25

you don't need to do that. All of

32:27

these crazy

32:28

stacks. So like, I don't want the flag

32:30

to be it when you're using IP. Well,

32:33

now you're using free art house because

32:35

like I've seen times where that's not

32:38

true and I just, I don't want, I wish engineers were

32:40

not limited to that thinking. Cause

32:46

I, okay. Let me put on my project project manager had

32:48

here then.

32:50

So like, what about, so what do you, what do you say to

32:52

a project manager who is like, well,

32:54

what about support burden? Cause I feel like support burden is,

32:56

is the main

32:57

reason in my head that I think like,

33:00

don't write that from scratch. Is

33:02

that fair or unfair?

33:05

I think the problem here is that it's,

33:07

I don't think I would win an argument in this because I have

33:10

been around the block and my experience says that

33:12

no, there is a

33:16

massive amount of support burden with

33:19

free art toss. I mean, I think it's a big deal. With

33:21

free art toss,

33:22

I'm picking that free art toss, but that's

33:25

only because that's where I'd have it. And

33:27

it's not because free art toss is bad. It's

33:29

not because there's some bug in it. It's because

33:32

of the type of code that people who are

33:34

using free art toss, right.

33:36

Inherently

33:37

like free art toss is great if you

33:39

have like one thread, but the reason you're using

33:42

free art toss is because you have a lot of threads.

33:44

That's right. Yeah. And, and when you start doing

33:46

that, you start finding these really rough

33:49

situations that you run into because the, the

33:52

burden of pushing and popping things off of cues

33:54

inside of interrupts instead of just doing

33:57

the work in the interrupt is so. high

34:00

that you end up burning a lot of your CPU.

34:03

And even though you started with 144 megahertz or something,

34:05

it's just, well, now you've burned

34:09

it all. And I think one of the problems

34:12

is if you put on the business hat, you're like,

34:14

well, we'll just buy the next more expensive processor

34:16

and just solve it by putting in a more expensive processor.

34:19

Right. Right. Right.

34:22

We have the margin. We can need it. Yeah.

34:26

depending on the price of your CPU, you're spending 30

34:28

cents more per

34:29

thing. That's $300,000. Whereas

34:32

if you just

34:33

made a different decision up front to be a little

34:35

bit more dainty with your

34:38

resources, then you

34:41

wouldn't be in this position.

34:43

So it's something- It's an interesting

34:45

take for sure. And I think about it with the...

34:48

So I've been working in the Zephyr

34:50

ecosystem and in my head at least when

34:52

I think about these arguments, it's like, well,

34:55

someone else is maintaining that. It's like there's a

34:58

bug fix, there's a critical, there's a hard bleed style

35:00

thing where something has to be updated. Now

35:03

your internal company

35:05

that

35:05

hasn't developed a stack, someone else

35:08

has developed it and you're pulling it in or the community is

35:10

pulling it in, then

35:12

you get that benefit. You get that network effect

35:15

from an ecosystem of an RTOS.

35:19

That's non-zero time as well because moving

35:22

up to the next version, so it might

35:24

be equivalent in a best case scenario as well.

35:26

Yeah, it is a tough one

35:29

to articulate around and really

35:31

think through. I don't think

35:34

that it's 100% clear when

35:37

because if you think about the attack

35:39

surface of a lot of these other

35:41

things,

35:43

you end up bringing in far more

35:45

features and far more lines of code

35:47

that are far more... Each one of those lines

35:49

of code are more susceptible

35:52

because there's so many... Sorry, not each one,

35:55

each one of the lines of code is the same level of susceptibility.

35:58

And yes, it's going to be fewer.

36:00

holes per line of code, but

36:03

they're still going to be there. They still get discovered.

36:06

They still like

36:07

it's shocking how

36:10

far things can go before

36:12

bugs are found that

36:15

may or may not have been

36:17

introduced in a base like

36:19

if you were to do it yourself. Like there was a stack

36:21

that I used for a commercial job. I

36:23

did a long time ago, which was this is literally

36:26

certified for aircraft. The stack was certified

36:28

for use on aircraft. And

36:30

we couldn't figure out why we're about

36:33

one out of every 65,000 packets we sent through. It

36:36

didn't, it didn't go through and we could resend

36:38

it and it would never go through. And it's like,

36:41

but like, like the last place we thought to look

36:43

was inside of this, this stack. And

36:45

no, it turned out that they, they had missed one

36:48

of the rules surrounding UDP UDP

36:50

checksum. So like, even though that was really

36:52

mature and it was really sort of

36:55

like,

36:55

it was in a world where it's like, this is clearly

36:58

a commercial product that was made by experts.

37:00

They're still bugs. They're still holes. And,

37:03

and like, right. And you had the burden of finding

37:06

that too. It wasn't like there was an announcement that came

37:08

down. You also found it. So then you also had to push it

37:10

back up and say, you guys go fix this. And then

37:12

it comes back down. You have to like implement the tasks. Yeah.

37:14

So it's like

37:15

those sorts of things, like they shouldn't happen.

37:18

But

37:19

so like, if you reason about like sort

37:22

of the, the rationality surrounding

37:24

why you would always, always,

37:26

always want to use light weight IP or always, always,

37:28

always want to use one of these commercial IP stacks or

37:31

always, always, always want to leverage this. It's

37:33

like in the nominal case that is a hundred

37:35

percent true and it's irrefutable, but

37:37

in the like actual boots on the ground case,

37:40

it's like, I think I would still use them like 90%

37:42

of the time. Like if, if, if I had

37:44

to go do something for a commercial job, I would still just

37:46

use lightweight IP. I guess that's not always true,

37:49

but

37:49

more so than not. But

37:52

if there were situations where that might

37:54

not make as much sense, or it might be

37:56

a more constrained system or something like

37:58

that, it, I mean.

37:59

I mean,

38:01

like full disclosure, I did actually use

38:03

that Minecraft stack, the IP stack that I

38:05

wrote for the Minecraft thing in a commercial project once.

38:10

It made sense. I had it and it was the right

38:12

solution in that situation. So I used

38:14

it and it worked fine as far as I'm

38:17

aware of. I've been in contact with

38:19

that customer for a while and have had

38:21

no complaints. So I mean,

38:24

maybe I just got really lucky. I don't know.

38:27

But

38:29

it's very strange to reason about because

38:31

the nominal

38:33

case is 100% always you should be

38:36

using like the extra

38:38

free RTOS stack or any of the RTOS stacks

38:41

and like an established set

38:43

of libraries for all of the stuff. But in

38:46

reality, I

38:47

guess I feel a little bit less

38:49

clear.

38:50

You know, I kind of think about it like

38:53

there's like a lot of pushback about not a lot of pushback, but

38:55

there's like people like, oh, you don't need a

38:57

college degree. You can prove out your, you

39:00

know, this is me saying this too, right? It's like, you know, some

39:02

I've seen, I've met a lot of very interesting people that could

39:04

prove their

39:05

abilities and they've learned on their own

39:07

and they could prove it through like projects and their past work.

39:10

And like a college degree does not

39:11

bestow that. But like in the general broad case,

39:14

it's still like companies are like, yeah, but it's a pretty good

39:16

indicator that I could hire some and teach them. Because

39:18

it kind of feels like the same thing where it's like this kind of general

39:21

use case. It's probably, you know, it's a general

39:23

rule of thumb and like, yeah, use this thing. But then,

39:26

but there's going to be corner cases always. And

39:28

this sounds like that might be one of them. That's

39:30

a really, really good description

39:33

of it. Like I have never heard

39:35

anybody make that comparison, but I really,

39:37

I really like that a lot. That's

39:40

because it

39:41

really is like the college degree.

39:43

It is a piece of paper. There's somebody who went

39:45

and did a bunch of unit tests and yeah,

39:47

they're unit tests probably didn't test your one

39:50

specific situation, but it does give

39:52

you a pretty good baseline of expectation for

39:54

the competency of that tool.

39:57

And that's, that's a really good expression of

39:59

it.

39:59

I've worked with people who are absolutely stellar

40:02

without college degrees, but you know,

40:04

in general,

40:05

if you don't really know, it's hard to hire

40:07

it that way, right? You see like you're at Microsoft and you're

40:09

like, all right, we got to hire 2000 engineers this time. It's

40:12

like, how many, how many project portfolio sites are you

40:14

going through? Like that's a little tougher,

40:16

you know? That's yeah, that's a really,

40:18

really good metaphor. I really like that.

40:21

Thanks.

40:21

That's nice of you to say. I just

40:24

thought of it. I

40:26

would, so, okay, let's, let's talk about now. Let's talk about

40:28

a corner case because there's interesting corner

40:30

cases that you've been working on specific to the

40:32

CH32V003. And I'm getting better

40:34

at saying that part number thanks to you.

40:37

Let's talk about USB. So you have

40:40

implemented USB stuff. I'm

40:44

not sure the full extent of the USB.

40:46

I'm just following your Twitter account

40:47

and it's in the bootloader. So what's going on with that?

40:50

So a couple pieces here.

40:52

One is I had actually, I have already

40:54

kind of coded my own USB stacks in the past

40:56

for a variety of things. So I do have

40:58

like a background in USB and

41:01

it's something that like, I always kind of like side

41:04

eye. I'm like, like looking at it and I'm like, can I,

41:06

can I somehow work this in? And

41:09

quick question about that. Sorry. Sorry

41:11

to cut you off. The, the hardware that you have for, so one thing that's

41:13

always scared me about USB is like,

41:15

I, I don't have any protocol decoder

41:17

or anything like that. You know, I know that

41:19

even the big one, I have a Luna on

41:22

order with all apologies to great Scott gadgets.

41:24

I have a Luna on order for 18 months and it's, it

41:27

is languishing and I can't figure out a cancel my order. And

41:30

so that's been one of the big scary things for me. I assume

41:32

you have, do you have hardware on hand for decoding?

41:35

Yes, I absolutely do. I will say

41:37

I, I don't think I would

41:39

have been able to, cause

41:42

like if, if, I don't know anybody

41:44

out there is familiar with VUSB,

41:45

but somebody had actually coded a AVR

41:47

software only

41:49

USB stack for the USB

41:52

low speed.

41:53

And I don't know how they did it.

41:55

Like I literally do not know cause

41:57

they did it in an age where there weren't.

42:00

Cheap, easy to access. Yeah. USB

42:03

things. Now we're at the point where like. Never discount

42:05

someone bringing a tool home from work though, too. I,

42:08

that's a decent point. Yeah. If somebody had, but

42:11

it is extremely difficult

42:13

to code a protocol like USB without,

42:15

without some sort of protocol decoder of some sort

42:17

and, and like being able to get all the timing to match

42:20

up and all of that, it's, it's very

42:22

hard.

42:23

But when you have all of those tools so that

42:25

you can go like, write some code, fire

42:27

it up, see what it looks like, see how

42:29

this worked and then just keep iterating.

42:32

Yeah. Step, step, step, step. Oh, there's the error.

42:34

Right. And then it's like, it's basically like a, yeah, it's a

42:36

debugger basically in the physical realm.

42:38

Yeah. Like if you have all of that and I

42:40

do so like on my live stream, I actually, uh, so

42:43

I did, I did all of the development of the base

42:45

USB stack live on YouTube.

42:48

Wow. But it,

42:50

it like it worked. Don't get me wrong. It worked out to

42:53

like five live streams each like seven hours

42:55

a piece. Like it, I'm

42:57

just really impressed with people who can do live streams. I cannot

43:00

concentrate. I'm like so like worried.

43:02

I'm always like looking at the camera and like, Oh,

43:05

people are watching right now. And I get like so anxious,

43:07

you know, like I,

43:08

it's, I'm very impressed with people who can do that. I,

43:11

uh,

43:13

I, I ignore the camera.

43:15

I don't know. I didn't watch it. I don't ignore the

43:17

camera, but I guess

43:19

it's

43:20

there's, there's, so it's kind of two piece one is

43:22

like, yeah, you spend more time like thinking out

43:24

loud and talking to people, but that also

43:26

means that they're a rubber ducky. So if you say something

43:29

stupid, you're like, Oh wait, no, that's not right. Let me

43:31

go fix it. And better

43:33

than that, there's actually a, somebody on my discord

43:35

server named duck who is rubber

43:37

duckies who would like be like watching

43:40

over as you're coding. They're like, Hey,

43:42

no, line 49 fix line 49. And

43:44

it's something like, yeah,

43:46

exactly. So there's, there's, there's both a multiplier

43:49

and a distractor from it. But

43:50

like,

43:51

I think overall it's, it's about neutral.

43:53

It's way more stressful. I'll tell you that, but

43:56

it's as far as like actual getting

43:58

stuff done, it's concerned, it's probably.

43:59

not a strict loss. So

44:02

the idea though, I guess backing up.

44:04

So I had done my own USB stacks. I

44:06

had actually done ESP USB,

44:09

which was USB on the ESP8266

44:12

where I bitbanged the USB

44:14

on it. So like the idea is it runs

44:16

at 160 megahertz. And then I every 53.333 cycles, don't worry

44:22

about how that works. You go either write

44:24

or read a bit on the USB bus and

44:27

you implement the USB bus protocol and

44:30

that just worked. So I was able to go make

44:32

a low speed device on the

44:35

ESP8266 with it. I've done a

44:37

lot of USB devices. Like I first started learning

44:39

on VUSB for the AVRs. I

44:42

had also done a couple USB stacks for

44:44

the STM32F042 and the ATmega328U4 and

44:50

U8 or ATmega32U4

44:52

and 32U8. And sort of like I was just ready to go with

44:54

this because this is a 10 cent

44:57

chip.

44:58

And I want to be able to say

45:00

plug a potentiometer into it and get a joystick

45:03

out of it. Or I want a mouse jiggler.

45:05

I want to something like I want to be able to take

45:07

input from the real world and control something

45:09

in electronics. Or I want to be able to from

45:12

software on my computer, send messages

45:14

to this device to go control some I squared

45:16

C thing or magnetometer or accelerometer

45:20

gyro thing or you name it

45:22

like any of this weird interconnection. Normally

45:25

you need something which is a minimum

45:27

of an STM32F042 at 70

45:29

cents or I guess that's what 80 cents

45:31

now. And then or an ATmega32U4 which

45:35

is a like a very favorite processor of

45:37

a lot of people to use. But it's it's kind

45:40

of slow and it's also like a dollar 40.

45:43

So it's like not that cheap. But

45:45

for this this this it's like no this is a 10 cent

45:48

processor. This is 10 cents. You

45:50

have no excuse for just putting into something.

45:53

So I want to be able to control these things. I want

45:55

to be able to do all this stuff. And by the

45:57

way it's

45:58

not just 16 kilobytes. of flash.

46:00

It's 16 kilobytes of flash plus this 1920

46:03

byte special boot area. And so like the gauntlet

46:07

was on. It's

46:10

like, okay, if I can turn this into an

46:12

Arduino where I can flash the part

46:14

over USB, so I don't

46:16

need a programmer, then like

46:19

that's interesting to me. Yeah, totally.

46:21

Another interesting thing that's about this too

46:24

is like the,

46:25

you know, every, every thing

46:27

that you add, you, I'm going

46:29

to say you CN, but also like the

46:32

community, like

46:34

that encourages cloning. Like

46:37

other manufacturers might look at it and be like, Oh, we

46:39

can make a part like that. Or that encourages more parts

46:41

like this. Like it's this weird, like

46:43

that network effect, but like this weird groundswell

46:46

that might drive other low

46:48

cost parts and like other people

46:50

implementing it. It just, it actually could have

46:53

an influence on the market. I

46:55

really hope it does. And on top

46:57

of that, like

46:59

there's always the situation with providers

47:01

where like, like manufacturers and chips

47:04

and stuff like that. So if you have a product and

47:06

you have a vendor A and vendor B,

47:09

you might 100% know you're going with

47:11

vendor A. Yeah. Like you might

47:13

know that like vendor A is it, this is

47:15

like, we have to use them, but that

47:18

doesn't mean you shouldn't like, like the thing you're

47:20

looking for shouldn't be in the last place you look,

47:22

because if you look at vendor

47:24

B and you start talking to vendor B and

47:26

vendor B can do it for 10 cents on

47:28

a dollar

47:29

that a can, well, now you can go back

47:31

to vendor A and be like, look, I know you guys

47:33

are better, but these guys are

47:35

making a really compelling case here. This

47:37

is, this is 10 cents. This isn't a dollar 40

47:40

can, can we do a little bit better? And

47:43

I sort of see some of this is doing that

47:45

at,

47:46

at sort of a macro level instead

47:49

of a micro level. And I really hope that that

47:51

happens. You're right. I do think that this could be a sort of

47:53

groundswell. I do think that like with

47:55

ever since sort of like the padoox started

47:58

to take in, like started to dig in.

47:59

into the space, Paduk is a, uh, an

48:02

eight bit, uh, yeah, three cent. Uh, well

48:04

it really, the good ones are like six cents, but

48:08

five or six cent micro.

48:10

I think that that kind of started to make people like,

48:12

yeah, actually, yeah. We could probably do this. We could

48:14

probably make these, these,

48:16

these things interesting in that space. And they did.

48:19

And I think that I really hope,

48:21

I hope we can look back in 10 years

48:23

and be like, ah,

48:25

WCH hit it.

48:27

Like before they were really only known

48:29

for being like cheap USB to serial

48:31

adapters that you'd go plug up next year, expressive

48:33

chip,

48:34

like I hope that we can look back

48:36

and remember my first, my first

48:38

experience with WCH chips were like, oh, I'm

48:41

not going to download that, that, that windows driver

48:43

from that site. Just

48:47

like, cause they were going on like cheap Arduinos,

48:49

I think. And I think that was my first thing. And I was

48:51

like, WCH to CH in there. Are they,

48:53

are they Swiss? Like, I don't know why I thought

48:55

that was Swiss. Is CH something Swiss? I

48:57

think so. Yeah. Yeah. Yeah. I just thought

48:59

it was Swiss for some reason. And then I'm like, no, this is

49:02

shady, shady looking site,

49:04

but

49:05

yeah, they're growing for sure. Yeah. And I, I really

49:08

hope that we can look back and sort of see, I really

49:10

hope that they get rewarded in the, the

49:12

grand scheme of things for sort of taking the risks

49:15

and taking the, the stance that they have.

49:17

Like there's no reason.

49:20

I mean, other than I guess, Poya trying to be

49:22

poised for the space. I

49:24

think I just feel like there's no reason

49:26

for WCH to have done what they've

49:29

done and I just really hope that they they're

49:31

rewarded for it. Yeah.

49:33

Yeah. I mean, we're, we're basically a commercial for like

49:35

market systems at work right now. Like

49:38

capitalism reward

49:40

the winners. But

49:42

yeah, I

49:43

mean that, yeah, sure. Going back, I

49:45

guess just to finish the USB discussion. So

49:47

idea was get this, this, this

49:50

USB stack up and running. And the idea is like, it's

49:52

just, it's an interrupt that gets fired when

49:54

the host sends a message to the device

49:57

and, and you just look at each one of the bits. Each

49:59

one.

50:00

It's 1.5 megabaud for USB low

50:03

speed. And so every 0.66

50:05

microseconds later, you do another check, you

50:08

do another check, you do another check, and

50:10

you go read a message. And then I

50:12

do all that in assembly, and then I kick the

50:14

message out to C, and then

50:16

I process the USB packet in C,

50:18

and then I go send a response back to the host

50:21

in assembly.

50:22

This has kind of been done before with Granium, but

50:24

Granium, there was a lot

50:27

of compromises. Like Granium never checked CRCs.

50:29

They just assumed everything was fine. Granium

50:31

never... I'm trying to remember what were some of the other things that

50:33

they did that was just rough.

50:36

It was never the right answer.

50:39

It was just sort of like theirs was an experiment to see

50:41

what is the minimum possible thing you

50:43

can do and get a USB device to enumerate.

50:45

And Granium is for 48 megahertz

50:48

ARM zeros, like the really tiny

50:50

micros that have no USB

50:53

5, but they're really cheap. And so

50:55

for me, it was like, no, my

50:57

flag in the sand, the thing I'm going for

51:00

is it's going to compute the polynomial

51:02

for the CRC in line while it's receiving

51:05

the messages. It's going to compute

51:07

all of the stuff surrounding the packet type and stuff

51:09

like that as it's going. It's

51:12

going to do all of these things as

51:14

it's going so that... There's

51:17

this funny thing that happens with things like LUFA

51:20

and tiny USB, where when

51:22

they get a message that says, hey, the

51:25

host says it wants data, their first

51:27

response is always to knack it and say, like,

51:29

nope, I don't have the data ready. Then they'll go

51:31

and they'll have a user space, like let

51:33

the user code figure out what to put there. And

51:36

they'll be like, okay, I'm ready. Here's your data.

51:38

And so I was like, no, I don't want to do that. I want to just... When

51:40

the host says, give me the data, I want to have the data

51:42

for it. And so I sort of like made

51:45

sure that from the get go, all of those

51:47

pieces were already designed into the low end

51:49

stack.

51:52

Interesting. And also having

51:54

to do things like retiming, which is where you...

51:58

When the USB packet is sent from the host...

51:59

well, maybe the processor

52:02

was doing something that was time critical in that time, and

52:04

now we started in the middle of a USB preamble

52:07

and having to resync ourselves to it.

52:09

So all of those aspects, making sure

52:11

that I handled all of that, so my goals make

52:13

a really robust USB low-speed

52:15

stack that can run on the device, and

52:17

then build the other part on top of

52:19

it. And so the idea is

52:22

for the normal stack, what I want to do

52:24

is just make it so it's not space constrained, and

52:26

so you can have whatever features you really want. And

52:29

it is low speed, so you can't be like a USB

52:31

MIDI device or something like that, but you can

52:33

be a lot of fairly interesting things. And hid

52:35

devices are way more interesting, I think people

52:37

give them credit for, because on Windows

52:40

and Linux and all platforms that I'm aware of, you

52:42

can just, as a user space application,

52:45

be like, hey, open

52:48

this hid device. Oh, send

52:50

this message. And it's not like, so with

52:52

like serial and serial protocols, you

52:54

have to have like framing, where you're like, well, this is the start

52:56

byte, this is the end byte, this is how I know

52:58

how big it is. USB provides all of

53:00

that for you.

53:02

And

53:03

the idea would be just make it so that the baseline

53:05

is a USB PHY, so that's the assembly

53:07

file, and then all of the rest of the stack that gets

53:10

built on top of it can have a variety

53:12

of different uses, and could be like keyboards,

53:15

joysticks, just generic whatever

53:17

other input devices, or egress

53:19

devices. And yeah, sorry,

53:22

I think that that kind of covers. That's great, no,

53:24

that's great. That's a bigger picture, yeah. What about in the

53:26

physical realm, so

53:28

USB is differential, correct? Yes. Do

53:31

you have to do something external, and then how do you

53:33

configure the GPIOs that you're going

53:35

into? Because

53:37

most USB has

53:39

specialized transceivers, and then actual

53:42

hard silicon that processes and buffers the

53:45

frames, right?

53:46

So what do you have to do then to modify

53:48

the external piece?

53:50

Nothing. Okay. Oh,

53:53

no, not nothing. You do have to

53:55

have a 1.5 kilo ohm pull-up resistor on

53:57

D minus, but

53:58

other than that, nothing.

53:59

Okay. Wow. Okay. The nice

54:02

thing about USB low speed is that it's

54:04

only 1.5 megabit. And if

54:06

you want to be able to send a differential signal,

54:08

well, you just can turn on, you know, like

54:11

flip the state of the bits when you want

54:13

to flip the state of the bits and

54:15

it's, it's just really, really

54:18

simple stuff. So it's, it just kind

54:20

of works out. And by default, is it like,

54:22

so the pins are set as inputs

54:25

and then as part of the processing. So like

54:27

you were, you're always waiting to receive a packet,

54:29

whatever. And then when you receive

54:32

something, you do the CRC checking that you're saying in line,

54:34

and then you turn around and start sending something back is

54:36

that at the same time, then you're also

54:38

turning those into outputs and then

54:40

driving. Yeah. Yep.

54:42

So just switch it around, be output,

54:44

and then start sending the same

54:47

sort of looking thing back at the host. And

54:49

just using regular GPIOs is

54:52

more than sufficient.

54:53

See, I think that's the thing. Like I have avoided

54:56

it so hard for so long that I have no knowledge

54:59

of what even is really happening there. I'm just like, well, you know,

55:01

make sure the lines are, you know, controlled

55:03

impedance and, you know, run up in,

55:05

make sure the part has D plus D minus. And you're like, yeah,

55:07

then I can, I like, I hook A

55:09

to B and that usually always works.

55:12

But because I'm never digging down into the sack,

55:14

like you're doing that, I don't really have any

55:16

knowledge of how to do that stuff. It's

55:18

a lot less scary than you think it is. I

55:21

think a lot of people make it really scary.

55:23

Like when you look at the USB standard, it's like 340 pages

55:25

for the base spec, but

55:30

that doesn't even really cover like hid,

55:32

which is like another, I don't even know, huge

55:34

amount of like, it's like a book, uh,

55:37

just for hid on top of USB. It's,

55:40

it's scary, but there's websites

55:42

that really try to like actually she like, no, this

55:44

stuff isn't rocket science. Like there's this thing called

55:46

USB in a nutshell, which is somebody's effort to just,

55:49

this is everything you need to know about USB. If

55:51

you want to implement it from the ground up in like

55:54

in silicon or in code or whatever, and

55:56

they succeeded. It's like, it's, you can read

55:58

in like

55:59

two hours. hours, and now you can just

56:01

know how to do USB. It's

56:05

surprising.

56:06

I think starting from that idea of

56:08

that mindset we were talking about earlier, that you can

56:11

implement these things, and sometimes you should implement these

56:13

things. Again, I'm never starting from that. I

56:16

think that you promoting that

56:19

from a learning perspective, then and also from a practical,

56:23

you can enable interesting things. This is a

56:25

really good example of that. Yeah. I

56:27

think actually going back to projects with this. USB

56:30

wasn't the only thing. The first thing I did with this was

56:32

the CH32V was make a Nixi tube

56:35

controller.

56:36

That's what caught my eye. The

56:38

Nixi tube controller was a really interesting

56:40

example of it. Anybody in their right mind,

56:43

if you need a 200 volt supply, you're

56:45

going to use some specialized chip to do it, or you're going

56:48

to use a voltage double chain with a

56:50

hex inverter or something like that. You're

56:53

going to use a part that you don't mind blowing up, so it should only be 10 cents.

56:58

Yeah. The question

57:00

for me was, well, wait a minute. I already have

57:03

a CH32V here.

57:04

Can it just be the switch mode controller?

57:06

The answer is, yeah, absolutely. There's no

57:09

reason it shouldn't be a switch mode controller.

57:12

It's funny that

57:14

we always think about it from an engineering

57:17

design standpoint of, oh, well, if I

57:19

need an X, then I'll go buy an X and

57:21

put it in.

57:22

If I need a Y, I'll buy a Y and put it in.

57:24

The answer is, you just don't need it.

57:27

You can just code that sort of stuff directly

57:30

into the processor, and it's

57:32

surprisingly

57:34

okay. You

57:36

can code it in, I say. It'd

57:38

be a little longer for me. Yes, given

57:40

enough time in YouTube videos, I could do it. But I mean, if you

57:44

think about it from go to first principles of

57:46

a

57:47

switch mode, I mean, no, just, okay,

57:49

I'll go for it right now. I never go there, Cian. Okay,

57:52

let's do it. Okay. You

57:54

want to be able to make, let's just instead

57:56

say we're doing a buck. So you have

57:59

a.

57:59

a P channel, you have your, your 3.3 volt

58:02

rail, and you want to be able to

58:05

make a signal on the output, like, like half the voltage

58:07

or something. I don't know what you're going for. Sure. So

58:10

you have a P FET and an inductor. You just look up a schematic

58:12

of like a buck converter and it's like, everyone's

58:15

going to just show you this is how it's done with a FET.

58:17

And so like now I want to be able to control that. Well,

58:19

how do you control that? Well, you just use a PWM. Well,

58:22

how do you use a PWM? Well, I have an example, not

58:25

me, it was somebody else who's written it. Several, several people

58:27

have come together and written a mountain of examples.

58:29

I think we're up to like 35 examples of

58:32

like how to use the CH32V003 and other hardware

58:35

surrounding it. Everything from how does it become

58:37

like a I squared C slave to an I

58:40

squared C master to SPI DMA. Oh,

58:42

by the way, that's the other thing. It has DMA like for 10 cents.

58:45

Like what the heck? That's pretty great. Yeah.

58:48

And the idea is so you want to be able to control this. So you have a PWM

58:51

and you need some way of looking at the,

58:53

the voltage on the output. Well, we also have an ADC. So

58:57

the idea is like, well, we'll just run the ADC

59:00

and if the voltage is too high, well,

59:02

we decrease the PWM. And if the voltage

59:04

is too low, we increase the PWM. Oh wait, that

59:07

actually just blew the thing up. It like locked

59:09

up high. Oh, it's because we got the PWM backwards.

59:11

Okay. So like, well, let's go flip the PWM around. Okay.

59:14

Well now, now it's now it works. Like it's,

59:17

it's surprising. It fucking works,

59:19

right? It's one of those things

59:21

where it's like, this shouldn't work. This shouldn't work. This

59:23

seems really hard. But then when you just

59:26

do it, it, I

59:28

don't know. I guess I've just been surprised by the number of

59:30

times things have like, yeah,

59:33

like, like the first time you do it, it never works. The

59:35

second time you do it, okay, maybe it'll work somewhat.

59:38

But like after you get through, like if

59:40

you, I

59:40

don't know, I probably for that Nixie to project, I had to

59:42

compile the project 500

59:44

times, but like, that sounds

59:46

crazy. Like, oh, I had to do 500 times

59:48

like iterations to make this work.

59:51

When it takes you less than a second to compile

59:53

and build and flush out the

59:56

project, that's like, I don't know. How long did I spend

59:58

on it? What's 500 seconds worth of time?

59:59

Like it's, it's just silly.

1:00:02

Like

1:00:03

you can just, I don't know how to explain,

1:00:05

like just if you,

1:00:07

if you break things down to first, feels like it really enables

1:00:09

you, you're, you're, you feel that this is a, this

1:00:12

is a multi-tool

1:00:13

multi-tools of a source,

1:00:16

right? It's yeah. And it's, it's

1:00:18

one of those things where it's like in a way

1:00:20

that before I don't think there is very

1:00:23

many things that would have made a lot of sense there.

1:00:25

Like, uh, like for instance, like you need an IO

1:00:28

expander. Well, yeah, it's going to take you

1:00:30

a couple of minutes to go write a GP

1:00:32

IO expander,

1:00:33

like slave things for

1:00:35

the price. Yeah. He pins, right? Yeah. Yeah.

1:00:38

But, oh, by the way, actually, I think somebody else has already

1:00:40

written one. I don't remember what the repo is for, but like,

1:00:42

I think it already exists, but like

1:00:44

you have that now. And so now it's like,

1:00:47

instead of spending 70 cents for the IO expander,

1:00:49

it's, it's 10 cents. So like,

1:00:51

that's, that's cheap. I think I have seen some, some

1:00:54

of those TI ones are real expensive. Well, yeah,

1:00:56

yeah. I don't know if I would ever buy

1:00:58

one of them. They're, they're too rich for my blood, but

1:01:00

yeah. So

1:01:02

now this is an interesting, like this sets us up into

1:01:05

an interesting space because the first thing that I think when you

1:01:07

start talking about this is like, yeah, I could put

1:01:09

this in, you know, screw you chip

1:01:11

shortages. I can, I don't need your, I don't

1:01:13

need your TI switch mode

1:01:14

power supply thingies. I can do it myself. And

1:01:17

then my brain goes, Oh,

1:01:19

wait a second. What if I can't get these parts? So, you

1:01:22

know, it's like always really scary question.

1:01:24

Yeah. Yeah. I, I, I live, I live

1:01:27

in fear given the past three years, I live in

1:01:29

fear of all things shortages, but I

1:01:32

mean, I would say I've gone through this, this

1:01:34

mental gymnastics myself, and I would say

1:01:36

the chances of this becoming unavailable,

1:01:39

it's by the way, I don't think we're really in the chip

1:01:41

shortage anymore. In general, most things are available

1:01:43

now. Well, we've totally exited. We have exited.

1:01:46

But even when it was like, would

1:01:48

you rather have to get 30 different chips

1:01:50

from 30 different suppliers in

1:01:53

order for your product to be done? Yeah. Or

1:01:55

would you rather just get one chip from

1:01:57

one supplier and.

1:01:59

Yeah, at low cost too. Yeah. And like, probably

1:02:02

lower cost on a lot of the silicon that's out there. That's,

1:02:04

that's true. But sort of like the risk

1:02:07

is it's

1:02:09

like, I don't know how to articulate this being on

1:02:11

a product where I had to like, sort

1:02:13

of, I was never responsible directly for actually

1:02:15

getting the stuff, thankfully, but like being

1:02:18

aware of and trying to be like, okay, well,

1:02:20

if we can't get this one random

1:02:23

switch mode thing, like I

1:02:25

have been on LCSC before and going

1:02:27

like, literally just go to like

1:02:30

DC, DC converters and clicking

1:02:32

on every single data sheet down the list, just

1:02:34

like click, click, click, click, click, click, click, click, click, click, click, click.

1:02:37

And then tabs open. Finding, okay, well, which

1:02:39

one has the same footprint? Is there any

1:02:41

way we can use, you know, this chip instead

1:02:43

of the chip that is now 52 weeks out,

1:02:46

which, which insanity should we really choose here?

1:02:48

Right? Because they're just different flavors. Right. Exactly.

1:02:50

Yeah. So it's, you know, it's like, yes, it's a

1:02:53

risk. You know, I

1:02:54

mean, WCH has been around for, I don't even know, like 10

1:02:57

plus years. So they're probably not going to go anywhere,

1:02:59

but even if they do, like, you know, it's,

1:03:02

it's,

1:03:03

they're all risks. Yeah. The only way

1:03:05

to really do it is to build our own fab and design our own

1:03:07

Silicon. Yeah.

1:03:10

I mean, there are some people in my discord server who are, I

1:03:12

think are right there, but that's not me. Yeah. That's

1:03:15

not me. Matt, Matt, Venn is servicing that crowd

1:03:17

with the, uh, online course. Yeah,

1:03:22

that's great. So we were on the Nixie

1:03:24

tube thing. So what is, what is the opposite? You built a 200

1:03:27

volt supply using a boost. I

1:03:29

assume, uh, we'll fly back

1:03:31

fly back. Oh, fly. Yeah. Yeah. The fun thing there

1:03:33

is turns out I was just browsing LCSC one

1:03:36

day, which I just do, it's like, I don't know some guys

1:03:38

browse home Depot. I browse LCSC.

1:03:40

And I came across this bizarre 10 to

1:03:43

one transformer that in a 2.5 by 3.2 millimeter

1:03:46

package and just like,

1:03:48

what in the world is this thing for?

1:03:51

And, uh, at some point it's like

1:03:53

Nixie tubes. And so

1:03:55

I started talking to this guy spirit on my discord

1:03:58

server, who I knew had like some experience with.

1:03:59

it and it was like, like, it's

1:04:02

like, Oh, this is actually tractable. This

1:04:04

is actually doable. And so

1:04:06

yeah, like, like literally the entire,

1:04:10

entire high voltage circuit is a CH32V003

1:04:14

using one of its GPIOs for feedback and

1:04:16

one of its GPIOs for controlling a MOSFET,

1:04:19

no MOSFET driver. Forget that. We just

1:04:21

have it going straight into a MOSFET.

1:04:23

Really? Oh, wow. It's got enough drive current. Oh,

1:04:25

plenty. It's got 50 milliamps of drive current. Oh,

1:04:28

wow. Okay. It's, it's pretty intense. Yeah.

1:04:32

And

1:04:33

the MOSFET, I do have a MOSFET cause I don't want

1:04:35

to, I'm not completely insane. And

1:04:37

then you just, just the idea is you use one

1:04:40

leg of the transformer and pretend it's an inductor,

1:04:43

so you like clamp it to ground. The other side is

1:04:45

hooked up to five volts charges up

1:04:47

and then you let go of that one side

1:04:49

and it flips up and then the

1:04:52

second side now has 10 times

1:04:54

that voltage on it. So you just go dump that through

1:04:57

a diode into a capacitor. And

1:04:59

that's, that's it. And the idea is you do a

1:05:02

opto cause I know like flybacks sometimes have optos.

1:05:04

Absolutely no opto.

1:05:05

No opto. Because we don't

1:05:08

need isolation. I'm not using the flyback

1:05:10

for isolation.

1:05:11

Cause I still like the idea is like, I still

1:05:13

need to turn on and off all of the, the cathodes

1:05:16

on the, uh, on the, the,

1:05:19

on the tube. So there's no benefit

1:05:22

from, from having any of the, the isolation.

1:05:25

I only have the transformer here as, as

1:05:27

a mechanism of getting higher voltage. So

1:05:30

it's like, that's it. It's just the

1:05:32

CH32V, a MOSFET

1:05:34

and the weird funky 30

1:05:36

cent transformer, a diode and

1:05:38

a capacitor and that's. Do you do a divider

1:05:41

though, to get that voltage back down? Oh yeah, I guess that

1:05:43

is fair. I do. I do actually have a, that's, that's

1:05:45

the thing I was really, yeah, that's what I was asking about is the divider. Yeah.

1:05:48

Optin to the opto or divider or

1:05:50

opto. That's true. Yeah. Yeah. Yeah. Yeah.

1:05:53

Okay. That's, that's pretty cool. I mean,

1:05:55

that's really, that's awesome. And then,

1:05:57

so then the rest of the part though is controlling the

1:05:59

rest of the tubes.

1:05:59

Yes. Yeah. The other parts of the tube. Yeah. And

1:06:02

it kind of handles some of the fading between

1:06:04

the segments and stuff, because you can't have

1:06:06

multiple segments on it once. You have to actually chop

1:06:08

it. And it also

1:06:11

is kind of the protocol engine so that you can go

1:06:14

command the tubes to do something.

1:06:16

And it handles taking on that command and

1:06:18

doing the right thing. So

1:06:20

what can't we do with this part? Or really, I mean,

1:06:23

we're talking about this part, but we're really saying

1:06:25

microcontrollers, I guess. Yeah. What

1:06:28

can't you do? Where do you find yourself being like, I

1:06:30

got to go on LCSC and buy the specialized

1:06:33

part?

1:06:34

Silicon, I guess. So

1:06:36

I struggle with this question, because

1:06:38

I'll tell you the places, I'll tell you the things that

1:06:40

immediately jump to my mind, and I'll tell you why

1:06:42

that that's irrelevant.

1:06:43

Cut is how we operate here. Battery

1:06:46

charger.

1:06:47

But this ship 100% could be a battery

1:06:49

charger charge control system. I

1:06:52

am personally a little bit too anxious to do it at this

1:06:54

time. I still would buy a battery charge system. But

1:06:57

totally no reason to do so. It could totally do

1:06:59

it on its own.

1:07:01

I would say ethernet controller. But

1:07:03

on the other hand, who knows? Maybe in a couple months, somebody

1:07:06

else is going to come out with a Bitbang ethernet stack.

1:07:08

I would say, I

1:07:10

mean, honestly, it is a pain

1:07:12

that the USB, when you do low

1:07:14

speed Bitbang USB, it really is painful, because it

1:07:16

means that while you're sending and receiving frames,

1:07:18

you can't be doing other stuff, which is, that's

1:07:21

annoying.

1:07:22

I would say. So what we really need

1:07:24

is we need WCH to come out with a $0.20 dual

1:07:27

core. Oh, they are. Well,

1:07:29

not dual core, but they came out with the 035,

1:07:31

which does have USB built in.

1:07:33

Oh, really? Oh, interesting. But that one's

1:07:35

still kind of in its I'm still kind of eyeing

1:07:37

it. It's not really clear how much

1:07:40

it's we don't know, really. They

1:07:42

haven't really. It's

1:07:44

like nominally $0.70 for some reason, but

1:07:47

it's probably more like $0.40. But

1:07:49

that's still four times $0.10. So

1:07:52

yeah. Yeah, put two of them down on the board. That's

1:07:54

another thing is like a multiplicative effect. You can just

1:07:57

draw. I mean, aside from the hassle of programming multiple

1:07:59

chips, then.

1:08:00

You could just drop another one on the board and one could be

1:08:02

a USB and you could make a dual

1:08:04

core quote unquote by just Having

1:08:06

us. Yeah, you are between them or something, you know

1:08:08

Well, actually it's funny you'd say that one of the one

1:08:11

of the the key features This is I think what

1:08:13

what sort of sealed the deal for me Like I know

1:08:15

where the six months of my next six months of my life are

1:08:17

going with this was

1:08:19

the the the debug interface

1:08:21

for it the it has a single wire

1:08:24

you hook up and

1:08:25

And you go send it a special signature

1:08:27

anytime you want to enable the debug part of

1:08:29

the chip

1:08:31

Now the debug part is is open

1:08:33

for business And now you can send

1:08:35

and receive messages arbitrarily to that

1:08:38

you get to write into these two registers

1:08:41

Not any word memory you are limited

1:08:43

to these two 32-bit registers But you can ferry data

1:08:46

through those two 32-bit registers and

1:08:48

it doesn't there's no like interrupt that happens It

1:08:50

doesn't like I mean it can if you want you can

1:08:52

interrupt the code But you don't have to it can

1:08:54

happen totally asynchronously You can

1:08:56

also then halt the processor and run

1:08:58

debugging on it. You can go reflash

1:09:01

it You can do any of these things through

1:09:03

that single wire And so like

1:09:05

for instance the nixie tube thing all of the demos

1:09:07

that I did using that I didn't use a

1:09:09

uart to talk to it. I just used that that

1:09:11

debug pin because it's like it's really

1:09:14

convenient It's one wire and

1:09:16

you just can talk Bidirectionally to

1:09:18

the part and like I can say go

1:09:20

to you know 180 volts. Well, what's

1:09:22

your current output voltage? What's your input voltage?

1:09:25

What's and like all of these things your control

1:09:27

interface more? Yes, a single wire control interface

1:09:30

instead of it's a single wire. It's a single

1:09:32

wire everything It's the skeleton

1:09:34

key to the to the wch or to the

1:09:36

c-32 Yeah, it really is

1:09:38

and that's one thing that like kind of was a little annoying about

1:09:41

the 203 So wch

1:09:43

has this whole line of these ch32v

1:09:46

V-Meeting risk five again processors,

1:09:48

but the oo3 I think I think

1:09:51

is the only one that has the single wire

1:09:54

debug interface which is just So

1:09:56

convenient. So

1:09:58

And so what is you said six months? Next

1:10:00

month, six months of your life will be towards. Oh,

1:10:02

no, no, no. This was six months or not six months.

1:10:04

This was like four months ago. Oh, this is the choice when you were making

1:10:07

that choice. Yes. Yes.

1:10:10

So I've spent the last four months of my life, like,

1:10:12

well, not my life. I have a day job, but like the last

1:10:14

four months of every

1:10:15

bit of time that I can spend outside of work

1:10:18

working on this, just because it's been, I was

1:10:20

like, this is time to go, go, go.

1:10:23

Interesting. Okay. So let's,

1:10:25

we're past the hour mark. But

1:10:28

I, I'm hesitating to ask this question

1:10:30

because I feel like I know the answer, but how

1:10:32

would you say, so we have a wide range of people

1:10:34

listening to the show right now.

1:10:36

What is the first thing people should do when they

1:10:38

want to go and get started

1:10:39

using the fun, the library, which is called

1:10:42

W sorry, the CH32s V003 fun is the

1:10:44

library, right?

1:10:47

Yes. How do they go and get started right

1:10:50

now and get to blink and go start doing

1:10:52

fun things?

1:10:53

So on the webpage for

1:10:55

the, the get the GitHub page for CH32V003 fun,

1:10:57

there's a thing where it's

1:11:00

a link on the, the readmeets as getting started,

1:11:02

you click on that and it has specific instructions

1:11:05

on how to install the windows tool chain and use

1:11:07

it and how to install the Linux tool chain and use

1:11:09

it and how to install the OS X tool chain and use it.

1:11:12

The steps should take no more than

1:11:14

three to four minutes to do the full setup for

1:11:16

everything and have your blink working. If

1:11:18

you have the dev board off of

1:11:21

AliExpress, I think you have to like run a jumper

1:11:23

to make, like hook up the led. If

1:11:25

you have one of my little CH32V003

1:11:28

fun boards, you can just immediately program. I

1:11:31

have a little demo that runs a WS2812

1:11:34

like NeoPixel like things and

1:11:36

I have four or six of those on the board itself.

1:11:38

So if you just say like CD example

1:11:40

slash WS2812 be

1:11:43

example, enter, make,

1:11:46

enter, it'll go build, slash

1:11:48

the part and start the part and you have

1:11:50

like a little glowing demo of some, yeah,

1:11:53

some NeoPixels doing some fun stuff.

1:11:55

That's great. Yeah, that's a great way to get to

1:11:57

start too. Cause it's like having those examples.

1:11:59

and just going through all of them as many as you

1:12:02

can and just digging in.

1:12:04

Just figure out all the things that you can do first

1:12:07

is great. What

1:12:10

is what is next? If you're willing to give

1:12:13

little teasers here, what do you, what do you hope to do

1:12:15

next with this thing? So you mentioned the last six

1:12:17

months starting four months ago, you've got two months left on that

1:12:19

term,

1:12:22

about maybe a month and a half. But, uh, the,

1:12:24

the goal right now for me is take all

1:12:26

of these things and make them really

1:12:29

good. And I've been really trying to do that.

1:12:31

So like the USB thing just isn't quite done

1:12:33

yet. So I have to really make that a first-class

1:12:36

citizen to be able to just reflash it and

1:12:38

make it so the same level of how I describe

1:12:40

the ease of getting started. I want to be able

1:12:42

to get there with, I don't even have a programmer.

1:12:44

I

1:12:45

just have, I just have the part. I want to be

1:12:47

able to work with it

1:12:48

and stuff like that. I really want to be able to get there.

1:12:51

And I guess the second part of that is

1:12:53

there's already people on my discord who are

1:12:56

starting to write CH32V203

1:12:59

fun or 307 fun.

1:13:01

And I really want to support them. And I really

1:13:04

think that I think that this is,

1:13:06

I

1:13:07

hope that I'm able to

1:13:09

be some sort of like, like if

1:13:12

nothing else, I want to be some old crusty person

1:13:14

like pointing in the direction of like you,

1:13:16

we can do this. We can live in the world

1:13:19

where it takes less than a second to compile

1:13:21

and test our products. We can live in a world

1:13:23

where we aren't overburdened with having

1:13:26

to understand all these complicated libraries and everything

1:13:28

else that goes so deep. We can

1:13:30

just have the code that runs

1:13:33

and makes our projects work. And I really,

1:13:35

I think there's enough other people who are

1:13:37

starting to glom onto this and starting to be like, okay,

1:13:39

yeah, that actually makes sense. I like the idea

1:13:41

of being able to just

1:13:43

compile a program and

1:13:45

run it on my part instead of needing mountains

1:13:47

of libraries and code and other

1:13:50

hidden abstractions in

1:13:52

order to use the part. So yeah,

1:13:54

I just continue to facilitate this.

1:13:57

That's great. No, that's a really good goal. We're,

1:13:59

we're. people find you online, where can they find the

1:14:01

Discord? How do people get in touch

1:14:03

and watch your stuff? I mean, I'm always

1:14:06

available on my Discord and I guess

1:14:08

we should probably put the Discord link on the GitHub.

1:14:11

I think we'll do that. Yeah, I'll make a note to make sure

1:14:13

that that goes there. So by the time this airs,

1:14:15

the Discord link will be on the GitHub. Okay.

1:14:18

And for me, I'll continue to

1:14:20

put all of the projects that I'm working on up on GitHub

1:14:24

and all the public projects and I

1:14:26

will continue to make YouTube videos about

1:14:28

the other interesting bits that I run into along

1:14:30

the way.

1:14:31

All right. Like and subscribe. Thank

1:14:34

you, Cian, for being on the show. I really appreciate it. This has

1:14:36

been fascinating. I have no excuse

1:14:38

now, I think, so I got to go. I got to go blink some

1:14:40

LEDs and get some stuff going on this part. So thanks for

1:14:43

all the work you've done. You'll be one of the early

1:14:45

ones. So let me know if there's any problems so the next

1:14:47

person will not have the same problem you had.

1:14:49

All right. Thanks for being here. Okay. Have a great day.

Unlock more with Podchaser Pro

  • Audience Insights
  • Contact Information
  • Demographics
  • Charts
  • Sponsor History
  • and More!
Pro Features