ForthHub / discussion

Discussion repository for Forth enthusiasts.
116 stars 4 forks source link

Announcing Forth GRBL GCode sender #67

Closed MitchBradley closed 6 years ago

MitchBradley commented 6 years ago

I know that it isn't kosher to actually write applications in Forth - Forth programmers are supposed to only write new system implementations - but I couldn't help myself.

https://github.com/MitchBradley/cforth/tree/master/src/app/grbl is a GCode sender in Forth. As currently configured, it runs on a Raspberry Pi under CForth on Linux, talking to an Arduino running the GRBL CNC machine control firmware. I got tired of using Python and/or Javascript to talk to my laser engraver, so I bit the bullet and did the whole thing in Forth. It took a few hours.

The UI is currently set up for a 320x240 LCD touchscreen. Touch the screen once to go, touch it again to stop. Simple enough that even my friend Karl, who is a rocking good machinist but struggles with computers, can use it.

My next planned step is to replace the Raspberry Pi with a $3 ESP8266 module. Why use a $30 computer with a several-gigabyte OS, when a $3 computer that runs Forth directly will do?

cwpjr commented 6 years ago

Renaissance work~! Made my day to hear it.

On Sun, Apr 1, 2018 at 12:32 AM, Mitch Bradley notifications@github.com wrote:

I know that it isn't kosher to actually write applications in Forth - Forth programmers are supposed to only write new system implementations - but I couldn't help myself.

https://github.com/MitchBradley/cforth/tree/master/src/app/grbl is a GCode sender in Forth. As currently configured, it runs on a Raspberry Pi under CForth on Linux, talking to an Arduino running the GRBL CNC machine control firmware. I got tired of using Python and/or Javascript to talk to my laser engraver, so I bit the bullet and did the whole thing in Forth. It took a few hours.

The UI is currently set up for a 320x240 LCD touchscreen. Touch the screen once to go, touch it again to stop. Simple enough that even my friend Karl, who is a rocking good machinist but struggles with computers, can use it.

My next planned step is to replace the Raspberry Pi with a $3 ESP8266 module. Why use a $30 computer with a several-gigabyte OS, when a $3 computer that runs Forth directly will do?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67, or mute the thread https://github.com/notifications/unsubscribe-auth/AFC6xR9oTPh1xqRjmSXjYcfxKbEmxecyks5tkGZrgaJpZM4TCuH6 .

yunfan commented 6 years ago

cool, i am also a fans of esp8266, but please considered arduino also

MitchBradley commented 6 years ago

AVR-based Arduinos are barely adequate for Forth, and certainly not powerful enough for a full-featured Forth with strong built-in interactive debugging. Guess how people typically add WiFi to an Arduino? Yep, they add an ESP8266. Arduino Due has enough resources for a nice interactive Forth, but the price is $15 and up - much more than either ESP8266 or ESP32 - and it doesn't come with WiFi either. Arduino is not a credible choice for this application. I do have an Arduino Due running g2core inside one of my CNC controllers, and perhaps I will someday replace the Raspberry Pi that talks to it with an ESP-something running Forth.

larsbrinkhoff commented 6 years ago

AVR-based Arduinos are barely adequate for Forth, and certainly not powerful enough for a full-featured Forth with strong built-in interactive debugging.

I would have thought that just about any 8-bit microcontroller (or regular CPU) with something in the neighbourhood of at least 16K memory (suitably split between instruction/data) would be adequate for Forth. I checked the Arduino lineup very briefly just now, and the boards do seem to have enough memory.

Which limitations do you see that make the Arduinos unsuitable Forth targets?

MitchBradley commented 6 years ago

If one is willing to live within the constraints of 1970s style Forths, then yes, most tiny micros will do. But I have been using Forth on 32 bit machines since the early 80s, and have grown accustomed to having a fully interactive system with full introspection, a good built-in debugger, plenty of tools that are "just there", etc. That level of interaction and on-tap debuggability catapults Forth into an entirely different level of productivity, at least for me. Without it, in most cases I would just as soon use C. I spent my career developing a Forth based interactive toolkit that let me debug difficult system problems that most of my colleagues could not touch. That toolkit, in all its glory, will run on a $3 module that also has built-in WiFi. Why bother with an AVR that costs about the same and requires me to carefully pick and choose which features to include, when I can have it all for no extra cost?

hth313 commented 6 years ago

Where do you get this $3 ESP8266 module? It sounds interesting.

MitchBradley commented 6 years ago

Search aliexpress for nodemcu.

yunfan commented 6 years ago

i am a big fans of esp8266, but to be honest, here in china, arduino is much more popular in the circle of makers, just check the chinese ebay => taobao.com . you would find much more arduino components.

and even esp8266 and nodemcu(i have a bag of it) you mentioned also claim they could be flashed as a arduino board

unless you make a blocky like ide for esp8266 forth, otherwise i think its better to support those arduino boards.

BTW, there're arduino board sell for 15 chinese yuan , which is about lesser than $3. welcom to china :D

MitchBradley commented 6 years ago

Does that 15 yuan arduino board have onboard wifi? If not, it is useless for my application.

If you like Arduinos so much, please feel free to write whatever applications you want for them. Meanwhile I will use the module that is best for my application, using the toolchain that I prefer.

gordonjcp commented 6 years ago

Which limitations do you see that make the Arduinos unsuitable Forth targets? I think the biggie is that they've only got 2K of memory.

MitchBradley commented 6 years ago

Memory, memory, memory. AVR Arduinos are okay for the "Forth as an off-line compiled language" mode, but weak for the "Forth as an interactive exploratory environment" mode. I absolutely love Forth in the second mode, which is why I spent the greater part of a long career using and promoting Forth. As an off-line compiled language, I personally don't find Forth all that compelling. That's my personal preference; there are other Forthers whom I admire, and whom I am proud to call friends, who live and breath target compiled Forth apps targeting tiny, memory starved micros. So now you know where my biases lay.

The structure of the AVR instruction set is quite nice. On another thread I mentioned a project in which I translated AVR ASM source code into C so that the C generated byte-for-byte identical machine code. That's a testament to the suitability of AVR machine code as a target for C. It basically means that the instruction set is reasonably regular with sufficient register resources and a decent set of operators, so the compiler doesn't have to jump through hoops to express common language constructs. That's in stark contrast to the wretched 8048/8051 instruction set, with its constant bottlenecking on the DPTR register. Forth is somewhat easier than C to implement on crappy instruction sets, but an extreme shortage of pointer-capable registers is still a problem. Some resource bottlenecks bite you no matter what language you use.

In addition to the lack of WiFi, AVR Arduinos are unsuitable for my needs because of insufficient Flash. I need to store some GCode files on-board to run jobs when off-line. One could add an SD card to an Arduino, but that just further increases the cost, whereas NodeMCU ESP8266 modules have enough Flash to store a few GCode files. And why do AVRs have so little Flash? It's because AVRs have a hard time addressing more than 16 bits worth of data memory. A 32-bit CPU like an ARM or an xTensa can directly address a large Flash with ease. Way back in 1976, people figured out that everything boils down to address space

There is only one mistake that can be made in computer design that is difficult to recover from—not having enough address bits for memory addressing and memory management. Bell and Strecker, ISCA-3, 1976.

Interestingly, Chuck Moore sometimes ran afoul of the address bits problem in his CPU designs. Chuck loves to optimize and is unbelievably good at it, but it has bitten him. I was once asked to do a design review for one of Chuck's innovative CPU chips. I pointed out that, with its 19 address bits, it could not address a 1-megapixel frame buffer, thus limiting the potential market for the chip.

Arduinos and especially the Arduino IDE have inspired a generation of makers, but their resource limits have also resulted in some dead ends and bad design decisions. For example, GRBL is amazing machine control firmware. I use it on my laser engraver and it works great. But it has hit the AVR memory wall. At the 0.9 to 1.1 version transition, they had to change some aspects of the serial protocol because they ran out of room for strings. That broke some third party software like Chilipeppr.

niclash commented 6 years ago

Mitch, Although I agree with everything you have said (C vs Forth, interactive vs compiled, 8266 vs Arduino, ...) in this thread so far, BUT I am actually "happy" that Arduino is as memory constrained as it is. Since that breeds a new generation of non-wasteful programmers, a trait that seems long lost. I can't run more apps on my 16GB desktop today, than I could on my 16MB desktop 22 years ago... Today's programmers don't think it is weird that the simplest of apps need 1-2GB of RAM... So SAD!!!

But anyway, I hope to have time to test out your app, as I just received a 3D Printer yesterday, have plenty of NodeMCUs laying around (even ESP32 modules), and would love to get my hands dirty with Forth once again.

Cheers and thanks for sharing Niclas

On Fri, Apr 13, 2018 at 3:43 AM, Mitch Bradley notifications@github.com wrote:

Memory, memory, memory. AVR Arduinos are okay for the "Forth as an off-line compiled language" mode, but weak for the "Forth as an interactive exploratory environment" mode. I absolutely love Forth in the second mode, which is why I spent the greater part of a long career using and promoting Forth. As an off-line compiled language, I personally don't find Forth all that compelling. That's my personal preference; there are other Forthers whom I admire, and whom I am proud to call friends, who live and breath target compiled Forth apps targeting tiny, memory starved micros. So now you know where my biases lay.

The structure of the AVR instruction set is quite nice. On another thread I mentioned a project in which I translated AVR ASM source code into C so that the C generated byte-for-byte identical machine code. That's a testament to the suitability of AVR machine code as a target for C. It basically means that the instruction set is reasonably regular with sufficient register resources and a decent set of operators, so the compiler doesn't have to jump through hoops to express common language constructs. That's in stark contrast to the wretched 8048/8051 instruction set, with its constant bottlenecking on the DPTR register. Forth is somewhat easier than C to implement on crappy instruction sets, but an extreme shortage of pointer-capable registers is still a problem. Some resource bottlenecks bite you no matter what language you use.

In addition to the lack of WiFi, AVR Arduinos are unsuitable for my needs because of insufficient Flash. I need to store some GCode files on-board to run jobs when off-line. One could add an SD card to an Arduino, but that just further increases the cost, whereas NodeMCU ESP8266 modules have enough Flash to store a few GCode files. And why do AVRs have so little Flash? It's because AVRs have a hard time addressing more than 16 bits worth of data memory. A 32-bit CPU like an ARM or an xTensa can directly address a large Flash with ease. Way back in 1976, people figured out that everything boils down to address space

There is only one mistake that can be made in computer design that is difficult to recover from—not having enough address bits for memory addressing and memory management. Bell and Strecker, ISCA-3, 1976. Interestingly, Chuck Moore sometimes ran afoul of the address bits problem in his CPU designs. Chuck loves to optimize and is unbelievably good at it, but it has bitten him. I was once asked to do a design review for one of Chuck's innovative CPU chips. I pointed out that, with its 19 address bits, it could not address a 1-megapixel frame buffer, thus limiting the potential market for the chip.

Arduinos and especially the Arduino IDE have inspired a generation of makers, but their resource limits have also resulted in some dead ends and bad design decisions. For example, GRBL is amazing machine control firmware. I use it on my laser engraver and it works great. But it has hit the AVR memory wall. At the 0.9 to 1.1 version transition, they had to change some aspects of the serial protocol because they ran out of room for strings. That broke some third party software like Chilipeppr.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67#issuecomment-380922315, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGgxeXFQd9TKga2FgxJ5bqgzgOzl0zCks5tn651gaJpZM4TCuH6 .

-- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java

MitchBradley commented 6 years ago

I wonder if there is much overlap between hobbyist makers - willing to live within Arduino constraints because their needs are quite modest - and people who program professionally?

The difference between now and then, which accounts for todays huge apps, is the incorporation of images, both still and moving, and sound. Back in the day, I had a shelf full of databooks and it was common to have to spend a long time on the phone trying to get technical docs from reps. Nowadays I have dozens of browser tabs spread across multiple screens, showing me all the docs I need. Oh, and then there is Fusion 360. Wow, what a tool!

I considered targeting ESP32 for the GRBL sender, but I only have a couple of ESP32, whereas I have a dozen or more NodeMCUs. Might as well use them for something...

yunfan commented 6 years ago

@MitchBradley i think you'd misunderstanding me. to claim again, i am a big fans of esp8266. but there're other people with other taste in the world and obviously there were the majority. that's why i proposed to support arduino too. because you could let them try forth easily. there're two many elect parts developed for arduino, if there's forth for it, they could feel the power of forth much more easily, isnt it?

yunfan commented 6 years ago

btw, esp8266 is cool to me, while esp32 was too expensive consider its features. if the same price with a bigger ram, i would consider that

MitchBradley commented 6 years ago

To be good is noble; but to show others how to be good is nobler and no trouble. - Mark Twain

niclash commented 6 years ago

Mitch, I think there is an overlap, in that I think a lot of teenage makers will eventually become programmers. Big deal, probably not... But I think firms with embedded software will seek young makers rather than Java and Ruby hordes. :-)

Yunfan, Sorry to hear you think ESP32 is too expensive,

ESP 12F Module : $2.60 Wroom ESP32: $4.00

NodeMCU 8266: $3.60 ESP32 DevKit: $9.70

I think it is amazing that the NodeMCU is only a $1 up from the module, and if that was the case with ESP32, then it would be hard to argue it is too expensive. Hopefully the devkit or a NodeMCU32 will come out and rectify that.

(prices are taken from electrodragon.com. I buy from there, but I am not affiliated in any other way)

On Fri, Apr 13, 2018 at 9:52 AM, Mitch Bradley notifications@github.com wrote:

I wonder if there is much overlap between hobbyist makers - willing to live within Arduino constraints because their needs are quite modest - and people who program professionally?

The difference between now and then, which accounts for todays huge apps, is the incorporation of images, both still and moving, and sound. Back in the day, I had a shelf full of databooks and it was common to have to spend a long time on the phone trying to get technical docs from reps. Nowadays I have dozens of browser tabs spread across multiple screens, showing me all the docs I need. Oh, and then there is Fusion 360. Wow, what a tool!

I considered targeting ESP32 for the GRBL sender, but I only have a couple of ESP32, whereas I have a dozen or more NodeMCUs. Might as well use them for something...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67#issuecomment-380996295, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGgxXY4mQhhiF7rWOaTg8kVCuGjWmFWks5toATBgaJpZM4TCuH6 .

-- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java

cwpjr commented 6 years ago

That overlap come with opportunities or entrepreneurial doesn't it? If you get a bug to make something and your tool fails you, or it's flaws as the vehicle are conveyed and understood, one naturally reconsiders and stands up for some thing better, right?

On Thu, Apr 12, 2018 at 8:52 PM, Mitch Bradley notifications@github.com wrote:

I wonder if there is much overlap between hobbyist makers - willing to live within Arduino constraints because their needs are quite modest - and people who program professionally?

The difference between now and then, which accounts for todays huge apps, is the incorporation of images, both still and moving, and sound. Back in the day, I had a shelf full of databooks and it was common to have to spend a long time on the phone trying to get technical docs from reps. Nowadays I have dozens of browser tabs spread across multiple screens, showing me all the docs I need. Oh, and then there is Fusion 360. Wow, what a tool!

I considered targeting ESP32 for the GRBL sender, but I only have a couple of ESP32, whereas I have a dozen or more NodeMCUs. Might as well use them for something...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67#issuecomment-380996295, or mute the thread https://github.com/notifications/unsubscribe-auth/AFC6xZNsRofAzteja30e8O0NoKRrmqsKks5toATFgaJpZM4TCuH6 .

yunfan commented 6 years ago

@niclash thanks for pointing me the real price of the chip, and yes, i got fooled with those boards vendors. but what can i do? i cant do hand soldering or design my own boards, i am those hobyists metioned above and guess what i want to do? i'd rent a greenhouse near my apartment, and doing a farmbot replace projects on weekend, that esp32's features were perfect for firmware, with its bluetooth support it could be controled by cellphone and with its wifi support, it could send data to interenet.

MitchBradley commented 6 years ago

https://github.com/MitchBradley/cforth/tree/master/src/app/esp32 contains an ESP32 Forth app to monitor and control a growing system, handling water level, pH, temperature, nutrient concentration, and watering. At present, some of the control functions are disabled, but most of the code is there somewhere.

MitchBradley commented 6 years ago

Search aliexpress for "wemos esp32" and you will find several ESP32 development-capable modules at prices ranging from $4.75 to $6.25. For $11 you can get one with a built-in OLED graphics display - and it's currently on sale for $9.

ESP32 is easier to use with Forth than esp8266 because esp8266 has a callback-oriented built in networking operating system that tends to crash (watchdog timer reset) if an application routine (Forth) runs too long and starves the network stack. In CForth, I worked around that with a coroutine trick that yields to the OS frequently, but you have to be careful nevertheless. ESP32 doesn't have the problem because the CPU has two cores. One can be dedicated to the network stack and the other to Forth.

niclash commented 6 years ago

@yunfan, To be clear ESP-12F is not "the chip". The actual ESP8266 is sub-$1 in volume and I think the ESP32 is just about a dollar. But I understand that many people work primarily with bread boards and through-hole proto-boards. Personally, I love to make my own PCBs, even if I only need one board (thanks to OSH Park), that said, still have constraints to what I can solder by hand (not improving with older age)...

I just wanted to say; I think all you guys who grow food (food and fish) are awesome, and I wish I could set aside enough time to get going with that. AND, since Mitch is kindly providing a "start software kit", perhaps it isn't as hard as I think it will be. But there is so much fun stuff to do.

Thanks Guys!!

Niclas

On Sun, Apr 15, 2018 at 8:15 PM, yunfan notifications@github.com wrote:

@niclash https://github.com/niclash thanks for pointing me the real price of the chip, and yes, i got fooled with those boards vendors. but what can i do? i cant do hand soldering or design my own boards, i am those hobyists metioned above and guess what i want to do? i'd rent a greenhouse near my apartment, and doing a farmbot replace projects on weekend, that esp32's features were perfect for firmware, with its bluetooth support it could be controled by cellphone and with its wifi support, it could send data to interenet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67#issuecomment-381401955, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGgxWS9MQ9k1PlmWSibk5OpCtcUyQYGks5tozndgaJpZM4TCuH6 .

-- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java

larsbrinkhoff commented 6 years ago

I know that it isn't kosher to actually write applications in Forth - Forth programmers are supposed to only write new system implementations

The good news is that the programming community hasn't forgotten about Forth.

The bad news is that it's mostly used to for half-finished toy implementations written in scripting languages.

MitchBradley commented 6 years ago

I must admit to having been guilty of that. A long time ago, shortly after PostScript came out, I did a Forth in one page of PostScript code "just because". But at least I never actually suggested that anyone should use it. It wasn't exactly Forth because the stack elements were floats - or more precisely references to PostScript objects - but it did have all the Forth operators and even CREATE DOES> .

A couple of years ago I was mentoring a high school student who is a very talented programmer. I spent a couple of hours introducing him to Forth and letting him hack on some drivers for I2C devices. A few weeks later he told me that he had implemented Forth in Haskell! I was mightily impressed, because Haskell, being totally functional, is about as poor a fit for Forth as it is possible to be. He was having some problems with ! and colon definitions, but we put our heads together and worked out a solution. As I recall, it involved something akin to forking the entire state of the world every time you did a ! or COMPILE, . Horribly, grotesquely inefficient, but quite amusing. We had a lot of fun, and then went back to working on the automatic growing system code.

scotws commented 6 years ago

As one of the hobbyist programmers here, I wrote a crude emulator for the 65816 MPU in Gforth (well, if you insist: https://github.com/scotws/crude65816/blob/master/crude65816.fs). The insights I got from the process were amazing, which is a roundabout way of saying that I should go back and rewrite the whole thing with what I learned while doing it 😄. The 65816 has a weird mode switch from 8 to 16 bit -- turns out that was pretty easy in Forth with DEFERs, not what I had expected. Very impressive, and I can only recommend writing one semi-large program in Forth just for those insights.

GarthWilson commented 6 years ago
I use Forth regularly on the workbench,
  with a 65c02 processor, or actually a 65802 which is a 65816 made
  to drop into an '02 socket.  It still has all the 816's
  capabilities except that the memory map is limited to a single
  bank.  I normally use it as a 65c02 though, because I had my major
  applications written for my '02 Forth before I developed my '816
  Forth on it (see what I've used it for at
  http://wilsonminesco.com/BenchCPU/); but I did do that
  development, and found the '816 much easier to program for
  than the '02.  Scot, I clear the E '02-emulation bit immediately
  in the reset routine and never touch it again, and I leave the
  accumulator in 16-bit mode nearly full time, the index registers
  in 8-bit nearly full time, and seldom touch the M and X mode
  bits.  When I want maximum performance or control, I use the
  onboard assembler whose initial version I wrote in a couple of
  hours, then made some improvements later, and found also that
  being Forth, macro capability was automatic.

  Garth

  On 04/16/2018 11:48 PM, Scot W. Stevenson wrote:

  As one of the hobbyist programmers here, I wrote a crude
    emulator for the 65816 MPU in Gforth (well, if you insist: https://github.com/scotws/crude65816/blob/master/crude65816.fs).
    The insights I got from the process were amazing, which is a
    roundabout way of saying that I should go back and rewrite the
    whole thing with what I learned while doing it 😄.
    The 65816 has a weird mode switch from 8 to 16 bit -- turns out
    that was pretty easy in Forth with DEFERs, not what I had
    expected. Very impressive, and I can only recommend writing one
    semi-large program in Forth just for those insights.
  —
    You are receiving this because you are subscribed to this
    thread.
    Reply to this email directly, view it on GitHub, or mute the thread.

  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ForthHub/discussion","title":"ForthHub/discussion","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/ForthHub/discussion"}},"updates":{"snippets":[{"icon":"PERSON","message":"@scotws in #67: As one of the hobbyist programmers here, I wrote a crude emulator for the 65816 MPU in Gforth (well, if you insist: https://github.com/scotws/crude65816/blob/master/crude65816.fs). The insights I got from the process were amazing, which is a roundabout way of saying that I should go back and rewrite the whole thing with what I learned while doing it 😄. The 65816 has a weird mode switch from 8 to 16 bit -- turns out that was pretty easy in Forth with DEFERs, not what I had expected. Very impressive, and I can only recommend writing one semi-large program in Forth just for those insights."}],"action":{"name":"View Issue","url":"https://github.com/ForthHub/discussion/issues/67#issuecomment-381867535"}}}
cwpjr commented 6 years ago

I'm in a sweat equity startup with a dear old friend IP and great forth community friends. I am writing plenty of app sw, from cms bring-up code, the app code and sending it's results, labview style to support apps, and then the end user product software. All in my forth (nod to we just implement). And a friend and I are going to combine our forths~! To allow our sweating to be a bit easier.

On Tue, Apr 17, 2018 at 12:08 AM, Lars Brinkhoff notifications@github.com wrote:

I know that it isn't kosher to actually write applications in Forth - Forth programmers are supposed to only write new system implementations

The good news is that the programming community hasn't forgotten about Forth.

The bad news is that it's mostly used to for half-finished toy implementations written in scripting languages.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ForthHub/discussion/issues/67#issuecomment-381843674, or mute the thread https://github.com/notifications/unsubscribe-auth/AFC6xeKzVmXJMGWoegIHc7Qkx6JoV7tRks5tpXjngaJpZM4TCuH6 .