[Oshpark] HQ ProgKey - Universal Driver Programming Key

118 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3
WTF wrote:
The new one series has a chip with 2M of memory and a lot of pins… Plus only three pins on the programming key.

It also has virtually no support in the open-source toolchains, so I don’t have a way to build code for it or flash code after building. I can’t really consider it as a viable option until those issues are fixed. It’ll be pretty cool some day though.

For now, the tiny1634 provides plenty of room to grow. It has twice as much ROM as tiny85, and a bunch of extra pins. I’ve also started on tiny841 support, but I don’t have it working yet.

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

I’ve been compiling for the the 1-series chips using GCC, you just need to include Microchip’s “device family pack” files. Now, I haven’t flashed them from Linux yet… I really need to try that.

The 1-series chips have been pretty nice. While limited to 4KB, the attiny412 makes a great PIC replacement in existing lights due to it’s pinout. I just replaced the MCU in my Convoy H1 with one (with RampingIOS). I’ve done the same with the D25 headlamp. For new development (custom boards), I’ve been using the X16 (ie: 416, 816, 1616, and 3216) where I need a smaller footprint, more pins, or more flash.

If you come up with something cool though, I bought 25 of the 1634 right before I switched over to mostly 1-series dev. Hopefully they’ll get used someday, even if it’s not by me.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3

gchart wrote:
I’ve been compiling for the the 1-series chips using GCC, you just need to include Microchip’s “device pack” files. Now, I haven’t flashed them from Linux yet… I really need to try that.

The 1-series chips have been pretty nice. While limited to 4KB, the attiny412 makes a great PIC replacement in existing lights due to it’s pinout. I just replaced the MCU in my Convoy H1 with one (with RampingIOS). I’ve done the same with the D25 headlamp. For new development (custom boards), I’ve been using the X16 (ie: 416, 816, 1616, and 3216) where I need a smaller footprint, more pins, or more flash.

It sounds like we should coordinate to get FSM supported added for those too. Or perhaps I should get off my butt and take a close look at the work you’ve already done. This may just boil down to me being slow.

Do you know if the newer chips have support in avr-libc? If so, that would make a lot of things easier. If not, it’s definitely still doable, but it’ll need to abstract out potentially the entire C library. Or at least parts of it, and how it hooks into other files.

Also, I’m way behind on getting your code into the repository. Would it be okay for me to import everything at http://www.ghart.com/blf/firmware/ ?

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

I took a look at FSM a while ago, I should take a stab at it. I haven’t worked with finite state machines since college (about 12-15 years ago!) but it shouldn’t be terrible. Mostly just swapping out register names. Oh, and for timed tasks I’ve been using the RTC instead of WDT. But that’s about it.

I’m using avr-gcc but you need to bring in the Atmel Device Family Pack files. A sample build script is here (originally based on one of yours)

Yup, you can grab the stuff I’ve got up there if you’d like.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3
gchart wrote:
I took a look at FSM a while ago, I should take a stab at it. I haven’t worked with finite state machines since college (about 12-15 years ago!) but it shouldn’t be terrible. Mostly just swapping out register names. Oh, and for timed tasks I’ve been using the RTC instead of WDT. But that’s about it.

It’s not exactly the cleanest code. It’s a spaghetti monster, after all. And the published branches don’t have tiny1634 support yet, so they lack the changes I made to improve portability.

I’m still pondering how best to support lots of different hardware simultaneously, in a manner which is relatively clean. It could use a lot of refactoring… beyond what I did for tiny1634 support. But I’m not sure exactly how to structure it yet.

WTF
Offline
Last seen: 3 hours 9 min ago
Joined: 03/05/2017 - 20:13
Posts: 258
ToyKeeper wrote:
WTF wrote:
The new one series has a chip with 2M of memory and a lot of pins… Plus only three pins on the programming key.

It also has virtually no support in the open-source toolchains, so I don’t have a way to build code for it or flash code after building. I can’t really consider it as a viable option until those issues are fixed. It’ll be pretty cool some day though.

For now, the tiny1634 provides plenty of room to grow. It has twice as much ROM as tiny85, and a bunch of extra pins. I’ve also started on tiny841 support, but I don’t have it working yet.

This is from a previous post by gchart. http://budgetlightforum.com/node/66272

The 3217 is cheaper and more future proof. I’d like to think that this latest generation chip would have better internal clocks and temperature sensors but I can’y find anything in the spec sheets to prove it.
https://www.microchip.com/wwwproducts/en/ATTINY3217

No one spends more time programming and testing than you do. It doesn’t seem like it took a long time to outgrow the 13,25,45 and 85. This time you get to choose the new chip. Twice as much memory as a 1634 and a three pin programming key can’t be a bad combo.

Mike C
Mike C's picture
Offline
Last seen: 18 hours 4 min ago
Joined: 01/22/2014 - 08:03
Posts: 2349
Location: Sweden

I’ve written and flashed simple firmware for the 3217 for a specific project. I’ve got most of the stuff working: Internal temp sensor, ADC, PWM, pin interrupts, software reboot and RTC (instead of WDT). All I have left for full functionality support is OTSM with the low power consumption options to run the MCU from the cap. After that I just have to fix the definitions and I’ll be ready to go. Besides 3 pin flashing, the 1617/3217 interested me because it has a DAC. The choice between 1617 and 3217 was pretty easy, the 3217 only costs a few more cents than the 1617, no reason not to go with 32 kb.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3
Mike C wrote:
3217 interested me because it has a DAC

That’s a really interesting feature. Have you found it to be stable enough to supply control voltage to other chips?

Mike C
Mike C's picture
Offline
Last seen: 18 hours 4 min ago
Joined: 01/22/2014 - 08:03
Posts: 2349
Location: Sweden

ToyKeeper wrote:
Mike C wrote:
3217 interested me because it has a DAC

That’s a really interesting feature. Have you found it to be stable enough to supply control voltage to other chips?

I haven’t started testing it yet. I have a 3217 driver that will be on it’s way from OSH Park shortly. I had some space over so I included a via for DAC output so I can play with it a little. Just got to get my 1634 firmware fully compatible with 3217 by defines first.
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3

The low-level hardware interfaces usually seem to me like the hardest part of making firmware. Each chip has its own particular way of setting registers to configure it in a useful manner. Once the hardware is configured though, I like building the upper layers of the code.

That’s why it takes me so long to add support for new MCUs in my UI toolkit. Most of that work is about the low-level interfaces, and I’m more of an application developer at heart… not as much of a hardware enablement developer.

I should probably rewrite the entire hardware abstraction API. What I have now is completely ad-hoc and not particularly coherent. But until I’ve added a few more chips, I don’t know how best to organize it. Attiny1634 was relatively easy compared to something like tiny3217 or a PIC chip, because it wasn’t much different than tiny85.

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

If you can help isolate the hardware-level stuff, I’d be glad to try and help with the porting to 1-series.

I’ve never looked at PIC but I probably should sometime as it seems that many non-BLF flashlight drivers use PIC. But it has been handy that the X12 AVR’s use a PIC layout (thinking retrofit here).

WTF
Offline
Last seen: 3 hours 9 min ago
Joined: 03/05/2017 - 20:13
Posts: 258

Tterev has done some beginners guides to pic’s, I think Toykeeper has stashed some of his work on the repository.

I think an adapter board would be the easiest way to tackle pic’s. Wight made one for the eight pin chips although I don’t think anyone ever finished the project.

Here’s something unrelated that may interest Toykeeper, hopefully the arduino code doesn’t make her eyes hurt. https://github.com/loneoceans/gxb172-attiny841/blob/master/GXB172ATtiny8...

Agro
Agro's picture
Offline
Last seen: 17 hours 19 min ago
Joined: 05/14/2017 - 11:16
Posts: 4560
Location: Ślōnsk

I’m very glad to learn about the port to attiny1634. Smile
The smaller size coupled with larger capabilities is good. Smile
So is the slightly lower price. Smile

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

Well… I dunno exactly when I’ll get around to porting the code, but I made a development board for the attiny816 (or 1616 / 3216). Basically the same at the 817 except it’s 20 pin instead of 24; I don’t plan on need 24 pins anytime soon. Instead of running through regulators or FETs, I’m just using the MCU output to run the LED (limited with resistors). Since this is just for testing, I don’t need it bright… actually, bright is bad because I’d just be blinding myself. Cool

Andúril and NarsilM, here we come!

 

PS… sorry for the threadjacking

DavidEF
DavidEF's picture
Offline
Last seen: 5 hours 41 min ago
Joined: 06/05/2014 - 06:00
Posts: 7646
Location: Salisbury, North Carolina, USA

gchart, I’m not knocking you for threadjacking, because I’m just glad to see this development come to light. Cool But this is very big news. It actually does deserve its own thread, if you can find the time. Big Smile

The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

I just cross-posted in my AVR Series-1 thread. I’ll try to continue posting updates over there. I just ordered the boards today, so it’ll be a little bit before they’re fully assembled. I guess I could start pulling code down and converting in the meantime… (like I really needed another thing to do Facepalm )

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 35 min 41 sec ago
Joined: 01/12/2013 - 14:40
Posts: 9957
Location: (469219) 2016 HO3
gchart wrote:
If you can help isolate the hardware-level stuff, …

That’s what FSM does. There’s a hardware interface on the back end, plus a UI toolkit on the front end. That way, the UI code is portable and doesn’t have to care (much) about the hardware it runs on.

However, it’s not exactly the cleanest code. It’s a spaghetti monster. It doesn’t do a great job of isolating the hardware-level parts from the library logic, so that gets kinda mixed in sometimes and could use cleaner abstractions. There’s probably a lot of stuff which doesn’t really make sense, but needs a fresh pair of eyes to notice the mess.

WTF wrote:
Here’s something unrelated that may interest Toykeeper, hopefully the arduino code doesn’t make her eyes hurt.

Thanks. I’ve been meaning to check on that project again, but I get distracted easily by other shiny things. It’s great to see that the code is available now, and published under GPLv3. There’s nothing wrong with arduino code though… I even used a couple arduino-isms while designing FSM’s interface. Anyway, it looks like loneoceans made things pretty clean.

WTF
Offline
Last seen: 3 hours 9 min ago
Joined: 03/05/2017 - 20:13
Posts: 258
ToyKeeper wrote:
There’s nothing wrong with arduino code though…

That was just a lame attempt at making you smile, I didn’t mean to infer anything negative.

Lone Oceans is so damn smart. The I2c temp sensor code looks so clean, although a lot of code could be hidden in a library.

You should check out his website if you haven’t already, he really likes his Tesla coils.

evil_andy
evil_andy's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 05/15/2019 - 21:30
Posts: 13

I really like the flexibility of HQ’s programming key. There’s no reason you couldn’t adapt nearly any PCB design to use it (or some variation of it). I picked up 6ea from oshpark and can’t wait to try my hand at designing my own driver boards with integrated programming ports.

Thanks for open sourcing the design. I’ll probably try using kicad, so I’ll see if I can release some definitions for the footprint.

DavidEF
DavidEF's picture
Offline
Last seen: 5 hours 41 min ago
Joined: 06/05/2014 - 06:00
Posts: 7646
Location: Salisbury, North Carolina, USA

evil_andy wrote:
I really like the flexibility of HQ’s programming key. There’s no reason you couldn’t adapt nearly any PCB design to use it (or some variation of it). I picked up 6ea from oshpark and can’t wait to try my hand at designing my own driver boards with integrated programming ports.

Thanks for open sourcing the design. I’ll probably try using kicad, so I’ll see if I can release some definitions for the footprint.


Are you already a user of KiCAD? I’d like to learn it, but the learning curve is steep for me. There is an Eagle tutorial around here from years ago, which helped a lot of us get started in PCB design. If you know how to use KiCAD, it would be helpful to at least some of us if you could help out with a quick-start tutorial of sorts. Innocent

The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy

evil_andy
evil_andy's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 05/15/2019 - 21:30
Posts: 13

Never used kicad, I’ve used eagle a bit in the past. This is mainly a good excuse and project for me to get back into embedded electronics. I’ve been meaning to learn kicad for a while (not a huge fan of eagle since auto CAD bought them). I’ll definitely try to document my descent into the abyss!

DavidEF
DavidEF's picture
Offline
Last seen: 5 hours 41 min ago
Joined: 06/05/2014 - 06:00
Posts: 7646
Location: Salisbury, North Carolina, USA

Yeah, since AutoCAD bought Eagle, it has gone to junk. That’s why I’d like to learn KiCAD now. But it just isn’t very intuitive to me. Tired

The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 1 day 15 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8524
Location: Everything is brighter in Texas

I still use diptrace for PCB design and find it does everything I need.

gchart
gchart's picture
Offline
Last seen: 2 hours 53 min ago
Joined: 03/19/2016 - 11:57
Posts: 1682
Location: Central IL

Hmm, I might have to check out diptrace. Heard of it, never tried it. I’ve been using eagle.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 1 day 15 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8524
Location: Everything is brighter in Texas
gchart wrote:
Hmm, I might have to check out diptrace. Heard of it, never tried it. I’ve been using eagle.

I tried eagle at first but did not like it and found diptrace to be better personally.

fluke
Offline
Last seen: 1 hour 15 min ago
Joined: 04/20/2018 - 13:58
Posts: 374
Location: London United Kingdom

Can I buy a ready assembled key with pogo pins attached?

contactcr
Online
Last seen: 10 min 2 sec ago
Joined: 05/19/2017 - 18:52
Posts: 2776
Location: US

Can someone tell me what this part is called:

Alternatively if there is another inexpensive part that allows me to go from the key to the USB ASP let me know. I have small gauge wires and extra jumper wires but nothing else.

Microa
Offline
Last seen: 1 hour 52 min ago
Joined: 06/29/2011 - 21:20
Posts: 236

2.54mm(0.1inch) pitch 4×2 pin header

contactcr
Online
Last seen: 10 min 2 sec ago
Joined: 05/19/2017 - 18:52
Posts: 2776
Location: US
Microa wrote:
2.54mm(0.1inch) pitch 4×2 pin header

Thank you that helped a lot. Ended up getting this one from DigiKey.

fluke
Offline
Last seen: 1 hour 15 min ago
Joined: 04/20/2018 - 13:58
Posts: 374
Location: London United Kingdom

fluke wrote:

Can I buy a ready assembled key with pogo pins attached?

 

Anyone?

Looked everywhere for a pre assembled key.

Pages