Author Topic: Building Phantom Hardware and Firmware Mods  (Read 178908 times)

0 Members and 1 Guest are viewing this topic.

Offline dirge

  • Posts: 475
  • Location: Newcastle Upon Tyne
Building Phantom Hardware and Firmware Mods
« Reply #100 on: Sun, 24 June 2012, 05:44:58 »
I wasn't keeping up much with the firmware, but the prototypes work fine, so in its current state it's good enough to use, yes?
Thinking about things isn't the same as doing things. Otherwise everybody would be in jail.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Building Phantom Hardware and Firmware Mods
« Reply #101 on: Sun, 24 June 2012, 06:43:20 »
Quote from: dirge;620797
I wasn't keeping up much with the firmware, but the prototypes work fine, so in its current state it's good enough to use, yes?

Yes, it works. It really should get an actual de-bounce algorithm though. At the moment there is a simple _delay_ms(5) between each scan of the matrix... I was scanning though the code for the ErgoDox and there they only do that delay if there has been a change. That is only a small improvement though.

Layers are not implemented at the moment I think.. But they are possible to get in a simple manner by defining which keys are modifiers, and when it is time to send key codes there are several different vectors of key codes to chose from depending on which modifier keys are pressed.

It should be possible to use the code for the ErgoDox. I think the guy writing it has actually intended his project to be for any Teensy keyboard. It looked pretty general to me. That is not the approach I would have picked myself, I like small compact hacks =) Making things general usually grows beyond what is manageable to me... There are surely more competent programmers than me hanging around here, and I was hoping putting a phantom in their hands would make them contribute with code =D

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Building Phantom Hardware and Firmware Mods
« Reply #102 on: Sun, 24 June 2012, 08:34:30 »
once i get my kit build (and a bit more free time, unfortunately), i can hack what needs to be hacked into the firmware.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Building Phantom Hardware and Firmware Mods
« Reply #103 on: Thu, 09 August 2012, 14:33:00 »
yes, there are no metal cases available at the moment.

why: IT'S REALLY EXPENSIVE TO DESIGN AND MANUFACTURE A METAL CASE

it's a problem we can solve, but it will take time. i have several much simpler ideas, i think it's worth prototyping at least one them. see the rev.2 thread for details

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #104 on: Fri, 10 August 2012, 15:48:46 »
Firmware should be:
Code: [Select]

last_char = nil
start_time = Time.now

loop

    next_char = gets.chomp

    if next_char == last_char && ((Time.now - start_time).to_f < 0.1)
        break
    else
        start_time = Time.now
        last_char = next_char
        return next_char
    end
end



Sorry about the uncompilable code, and failure to write is as a proper method, but you get the idea.
« Last Edit: Fri, 10 August 2012, 16:52:37 by captain »
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #105 on: Fri, 10 August 2012, 18:12:20 »
Firmware should be:
Sorry about the uncompilable code, and failure to write is as a proper method, but you get the idea.

I like your SP color sample necklace =D But I am too tired to try to figure out what that code is supposed to do at the moment. Looks like a lot of c gibberish to me =P If we are talking about de-bouncing still, then I fixed that by using a timer and a very simple algorithm. I also uploaded the code to github. All this while GH was down I suspect..

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #106 on: Fri, 10 August 2012, 18:53:38 »
Thanks.  :-)

Simpler statement of my point: compare the last keystroke to the current one.  If they are different, pass the current one on to the USB system.  If they are the same, check for timing, and if they are more than X ms apart, pass along the current character, if less than X ms, toss the second one and continue listening.

e.g.: I can type disparate characters MUCH faster than I can repeatedly type the same character--because subsequent keys can already be heading down as the previous ones are still rising back up.  I can only get about 10-12 max. of the SAME character by repeatedly tapping, so that's just around 90ms per repeated character.  Anything faster than, say, half, or 2/3, of that, would HAVE to be a bounce, so the controller should toss it out.

This is all theoretical.  I haven't seen how the current system works, but we do have some insanely fast typists, so we probably do NOT want to ignore keystrokes just because they are coming really fast.  ;-)
« Last Edit: Fri, 10 August 2012, 18:55:47 by captain »
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #107 on: Fri, 10 August 2012, 19:04:51 »
I measured the scan rate with an oscilloscope, when no keys were pressed. And I got ~2kHz, but then the controller were doing nothing else. I doubt it will drop enough to be noticeable though =D The one number that may need to be tweaked is the duration for the release bounce. I sometimes get double taps when not intended. But that might also just be me getting alzheimer or something =P I think the current time is slightly below 5ms.

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #108 on: Fri, 10 August 2012, 19:15:12 »
What about when a key is held down?  I forgot about this, but we certainly want holding a key down to send user-definable auto-key-repeats! 
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #109 on: Fri, 10 August 2012, 19:35:33 »
Repeating is usually handled by the OS, and I think that is a good thing.

The way the algorithm works at the moment is like this.

As soon as a key goes from not registering to registering it is considered pressed, and sent to the OS.

When a key goes from registering to not registering it has a byte that is set to 0x80. There is a byte for every key, and to make things simple a timer interrupt shifts all bytes to the right one step every ~<1ms. When one of these bytes changes from 0x01 to 0x00 the key is considered to have been released, and is reported to the OS.

If the key registers again during a scan before the byte reaches 0x00 the release is aborted.

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #110 on: Fri, 10 August 2012, 20:52:42 »
Sounds good.  Could you give us the link to the github repository for all of this, please?  I don't see it in the OP.  In fact, the only think I see in the OP is a dead link to a message from the old BBS.  Will the same firmware work on all Phantom layouts? 
Thanks!
« Last Edit: Fri, 10 August 2012, 21:29:14 by captain »
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: Building Phantom Hardware and Firmware Mods
« Reply #111 on: Fri, 10 August 2012, 21:26:57 »
Everything you need is here.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #112 on: Fri, 10 August 2012, 21:28:53 »
DeskThority!  Of course!  Sorry I'm too clueless sometimes.  Thanks!  :-)

PS: I just realized who I was communicating with.  Why did you change your name?  Did Vespa dump you and you lost your schwartz?  ;-)


PS: Here is a working model of the code, with a bunch of crap printed to the screen so you can see what's happening.  Type a letter, followed by Enter.  Do this twice quickly (within a half second of typing the first letter) and see how the debouncer detects the duplicated keypress.  Do this quickly with different letters, and see how the debouncer doesn't trap a "bounce":

http://pastie.org/4453227
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #113 on: Sat, 11 August 2012, 01:18:15 »
What language is that even?

I linked to the github page above but that may have been a bit secluded https://github.com/BathroomEpiphanies/Teensy-Keyboard

I made the code more general, moving model specific functions out of the main file. Pins, layout, AVR chip, CPU speed, and so on is defined in the make file. I will remove the "Phantom-Firmware" repository. Right away may be just as well =)

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #114 on: Sat, 11 August 2012, 01:27:47 »
PS: I just realized who I was communicating with.  Why did you change your name?  Did Vespa dump you and you lost your schwartz?  ;-)

Valium never had any schwarz... =P That name started out as an internal joke. I didn't really ever like it that much, but had no better ideas. I don't mind the drug reference much my self, but I don't want anyone else to be offended. That Valium character is pretty unlikable to start with. And it wasn't very original. My real name has gotten tighter linked to my online identities as well. So I wanted something better =) I have this pretend organisation "Bathroom Epiphanies" that I brand my creative work with, so that's where bpiphany comes from.

Offline Tranquilite

  • Posts: 144
Re: Building Phantom Hardware and Firmware Mods
« Reply #115 on: Sat, 11 August 2012, 01:55:11 »
I've placed all the Diodes in my phantom, downloaded the current code from bpiphany's github, compiled the hex file using WinAVR, and programmed it to my teensy, but all I get is a USB hub with one unused port and an unknown device...

Can anybody tell me what I'm doing wrong? Is the current code from the git repository supposed to compile without making any changes? Does anybody have a known working compiled hex? I cant find any compiled ones because the attachments didn't get restored. I want to make sure everything is soldered correctly before continuing, but i dont even know where to start debugging.
« Last Edit: Sat, 11 August 2012, 02:04:49 by Tranquilite »

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #116 on: Sat, 11 August 2012, 02:03:29 »
First make sure this is the repository you are using https://github.com/BathroomEpiphanies/Teensy-Keyboard
I just deleted the old one so that won't be there anymore =D

You will need to change a few lines in the makefile.

Comment out the current "iso" board that it is compiling for (that is one of my own projects. And un-comment the phantom stuff,  before you make the thing.

Like this:
Code: [Select]
BOARD = phantom
MCU = atmega32u4
F_CPU = 16000000

#BOARD = iso
#MCU = at90usb1286
#F_CPU = 16000000

# BOARD = symmetric
# MCU = at90usb1286
# F_CPU = 16000000

# BOARD = pontus
# MCU = at90usb1286
# F_CPU = 16000000

Then you run 'make', and you should end up with a usable hex file.

Edit: Actually always run 'make clean' first... I thought I had included that but I haven't yet.
« Last Edit: Sat, 11 August 2012, 02:05:26 by bpiphany »

Offline Tranquilite

  • Posts: 144
Re: Building Phantom Hardware and Firmware Mods
« Reply #117 on: Sat, 11 August 2012, 02:05:59 »
Ooh, that was a fast response. I'll do that right now.

EDIT: Ok, things appear to be working just fine now, thanks!
« Last Edit: Sat, 11 August 2012, 02:11:32 by Tranquilite »

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #118 on: Sat, 11 August 2012, 08:07:44 »
any way we could get the code compiled already the source is nice if you know what to do with it but when you dont it doesnt help much. wasnt their a working basic firmware file as one point

After I load into WinAVR I continually get Error: invalid command name ".tearoff1"
« Last Edit: Sat, 11 August 2012, 08:18:34 by TheProfosist »

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #119 on: Sat, 11 August 2012, 08:51:32 »
I can compile hex files, but then you wont see how I log your keystrokes and mail them to myself =D

Seriously, there should be compiled hex files in the repository. But the current ANSI with winkeys layout is the only one I know to work for sure.

Ok, so I went ahead and added the hex file. I don't know if that is actually downloadable from the http or if you need to use git...

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #120 on: Sat, 11 August 2012, 20:06:08 »
I can compile hex files, but then you wont see how I log your keystrokes and mail them to myself =D

Seriously, there should be compiled hex files in the repository. But the current ANSI with winkeys layout is the only one I know to work for sure.

Ok, so I went ahead and added the hex file. I don't know if that is actually downloadable from the http or if you need to use git...
worked perfectly now i just need to get all my switches on and finish everything up. After that im going to have to find someone that can program a layer in  for my layout.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: Building Phantom Hardware and Firmware Mods
« Reply #121 on: Sat, 11 August 2012, 22:13:25 »
FYI - For those wanting to go with the ANSI +Winkeys HEX that bp uploaded to git and don't know how, you can do this:

Click here.  (it's the git page)
Click the PHANTOM_ANSI_WIN.hex file
Right Click the "RAW" button and save as.

Save it and load it to your teensy.  I just AKT'd a PCB w/ only diodes and the teensy mounted:  100% success.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Tranquilite

  • Posts: 144
Re: Building Phantom Hardware and Firmware Mods
« Reply #122 on: Sun, 12 August 2012, 16:15:32 »
Just for the fun of it, I decided to compile Hasu's tmk keyboard firmware (specifically the macway build) and program it to my phantom. Surprisingly, more than half the switches sent keystrokes (though the not the right keystrokes). With some work, I think this firmware could be made to work with the phantom. This would probablty be the easier way to get media keys and function layers, because Hasu's firmware already has these features implemented. Unfortunately I'm not very good at programming, so hopefully someone else can do this.

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Re: Building Phantom Hardware and Firmware Mods
« Reply #123 on: Sun, 12 August 2012, 17:38:06 »
Just for the fun of it, I decided to compile Hasu's tmk keyboard firmware (specifically the macway build) and program it to my phantom. Surprisingly, more than half the switches sent keystrokes (though the not the right keystrokes). With some work, I think this firmware could be made to work with the phantom. This would probablty be the easier way to get media keys and function layers, because Hasu's firmware already has these features implemented. Unfortunately I'm not very good at programming, so hopefully someone else can do this.
though about that previously as well as the firware worked for the dox. And has all the features i need.

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #124 on: Mon, 13 August 2012, 06:36:09 »
Finished my build now I just need some firmware that fits my layout as well what the caps say is not what the keyboard does.










Offline riffautae

  • Posts: 51
Re: Building Phantom Hardware and Firmware Mods
« Reply #125 on: Mon, 13 August 2012, 12:51:34 »
I played with the tmk firmware back when this all first started: https://github.com/riffautae/tmk_keyboard
I wrote the code to map the LED's and keys proper.
I couldn't get anything to run though, I expect this was my build environment. When I get my board I will play with it more.

Offline captain

  • Posts: 703
Re: Building Phantom Hardware and Firmware Mods
« Reply #126 on: Mon, 13 August 2012, 16:32:13 »
What language is that even?

I linked to the github page above but that may have been a bit secluded https://github.com/BathroomEpiphanies/Teensy-Keyboard

I made the code more general, moving model specific functions out of the main file. Pins, layout, AVR chip, CPU speed, and so on is defined in the make file. I will remove the "Phantom-Firmware" repository. Right away may be just as well =)

That's Ruby!  I never liked C, or any of its derivatives.

Thanks for the github link!  At least now I have a clue what we are talking about here.  :-)

I totally get the name change.  Good choice.
« Last Edit: Mon, 13 August 2012, 16:37:16 by captain »
Welcome to geekhack -- where we like to type -- but don't care so much about reading.

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #127 on: Mon, 13 August 2012, 16:40:42 »
Ruby?!  How do you get Ruby to run on Teensy?

/sarcasm

Offline Tranquilite

  • Posts: 144
Re: Building Phantom Hardware and Firmware Mods
« Reply #128 on: Tue, 14 August 2012, 01:32:41 »
I played with the tmk firmware back when this all first started: https://github.com/riffautae/tmk_keyboard
I wrote the code to map the LED's and keys proper.
I couldn't get anything to run though, I expect this was my build environment. When I get my board I will play with it more.

I hope you get your board soon, because I built your firmware and tested it, and all I got was three blinks of the LEDs. None of the keys did anything which was less than I got by building the macway source.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Building Phantom Hardware and Firmware Mods
« Reply #129 on: Tue, 14 August 2012, 08:30:14 »
can someone start building a list of things (preferably on the wiki?) that we need done to the phantom firmware? my parts are in LA with reaper, but i do have a number of teensies and if nothing else, finally have a test execution environment..

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: Building Phantom Hardware and Firmware Mods
« Reply #130 on: Tue, 14 August 2012, 08:46:25 »
I'm in the midst of figuring out how to modify the LED brightness, have to build a build VM first.  Also, would be nice to have one of each layout available already built.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline agor

  • Posts: 282
  • Location: Germany
Re: Building Phantom Hardware and Firmware Mods
« Reply #131 on: Tue, 14 August 2012, 10:51:36 »
Got everything set up and waiting. Just needs to arrive in germany now :(
KBD8X II - MX 5000 - Realforce 88UB - Phantom - GH60

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #132 on: Tue, 14 August 2012, 11:38:36 »
These two hex files are from the original source code from prins.  They work.
* phantom-PHANSI.hex (6.8 kB - downloaded 364 times.)
* phantom-PHANSIWIN.hex (6.8 kB - downloaded 519 times.)

This one is from a recent github source.  For PHANSI.

* github-PHANSI.hex (8.12 kB - downloaded 377 times.)
« Last Edit: Tue, 14 August 2012, 11:41:13 by litster »

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #133 on: Tue, 14 August 2012, 11:56:35 »
can someone start building a list of things (preferably on the wiki?) that we need done to the phantom firmware? my parts are in LA with reaper, but i do have a number of teensies and if nothing else, finally have a test execution environment..

I have a future firmware feature list on the OP of this thread.

Offline agor

  • Posts: 282
  • Location: Germany
Re: Building Phantom Hardware and Firmware Mods
« Reply #134 on: Tue, 14 August 2012, 13:19:19 »
Is there any information to read about usb keyboard development?

e: besides the info on pjrc, obviously
« Last Edit: Tue, 14 August 2012, 13:26:33 by agor »
KBD8X II - MX 5000 - Realforce 88UB - Phantom - GH60

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #135 on: Tue, 14 August 2012, 17:16:57 »
I'm in the midst of figuring out how to modify the LED brightness, have to build a build VM first.  Also, would be nice to have one of each layout available already built.

The LED brightness control is located in phantom.c (at the moment at least). OCR1B/C can be set to a  value between 0 and 255. I think both 0 and 255 are ok, but there may be some exception for those. In fact I think 0 isn't completely turned off in fast PWM mode. But it is only the on brightness that is controlled by these registers.
Code: [Select]
/* LEDs are on output compare pins OC1B OC1C
   This activates fast PWM mode on them.
   Prescaler 256 and 8-bit counter results in
   16000000/256/256 = 244 Hz blink frequency.
   LED_A: Caps Lock
   LED_B: Scroll Lock */
/* Output on PWM pins are turned off when the timer
   reaches the value in the output compare register,
   and are turned on when it reaches TOP (=255). */
void setup_leds(void) {
  TCCR1A |= // Timer control register 1A
    (1<<WGM10) | // Fast PWM 8-bit
    (1<<COM1B1)| // Clear OC1B on match, set at TOP
    (1<<COM1C1); // Clear OC1C on match, set at TOP
  TCCR1B |= // Timer control register 1B
    (1<<WGM12) | // Fast PWM 8-bit
    (1<<CS12); // Prescaler 256
  OCR1B = 250; // Output compare register 1B
  OCR1C = 250; // Output compare register 1C
  // LEDs: LED_A -> PORTB6, LED_B -> PORTB7
  DDRB &= 0x3F;
  PORTB &= 0x3F;
}

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: Building Phantom Hardware and Firmware Mods
« Reply #136 on: Tue, 14 August 2012, 20:07:25 »
I had figured that much, but without building it a few times and seeing the brightness change to prove me right I didn't want to just claim I had the answer.  Thanks :)
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Tranquilite

  • Posts: 144
Re: Building Phantom Hardware and Firmware Mods
« Reply #137 on: Wed, 15 August 2012, 01:39:38 »
My LED's are so bright, that the only setting that doesn't burn holes in my eyes is 1. I probably should have used stronger resistors than the 100 ohm ones I have in there, but they were the only ones I had on me at the time.

can someone start building a list of things (preferably on the wiki?) that we need done to the phantom firmware?

The only things I think we need are media keys and programmable layers, along with whatever other crazy features we can dream up.
« Last Edit: Wed, 15 August 2012, 01:43:22 by Tranquilite »

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #138 on: Wed, 15 August 2012, 02:07:33 »
My LED's are so bright, that the only setting that doesn't burn holes in my eyes is 1. I probably should have used stronger resistors than the 100 ohm ones I have in there, but they were the only ones I had on me at the time.

can someone start building a list of things (preferably on the wiki?) that we need done to the phantom firmware?

The only things I think we need are media keys and programmable layers, along with whatever other crazy features we can dream up.

I think I actually figured out that the timer used for the PWMing is a 16 bit one. And only 8 are used at the moment. It should be possible to use more bits and get a bunch more intensity settings. There is some datasheet pages to plow through, but I am sort of getting the hang of that.with a 1 and 16 bits you should get 1/65536th instead of 1/256th of the full brightness =D That is 1/256th of what you have at the moment.

Offline harrison

  • Posts: 161
  • Location: Surrey, BC
Re: Building Phantom Hardware and Firmware Mods
« Reply #139 on: Wed, 15 August 2012, 07:58:06 »
My LED's are so bright, that the only setting that doesn't burn holes in my eyes is 1. I probably should have used stronger resistors than the 100 ohm ones I have in there, but they were the only ones I had on me at the time.

can someone start building a list of things (preferably on the wiki?) that we need done to the phantom firmware?

The only things I think we need are media keys and programmable layers, along with whatever other crazy features we can dream up.

i've got a number of different options for LEDs, and my concern is also that the resistor that I use might be either too strong to not strong enough by the time i've got key caps installed.  My plan (assuming clearance isn't an issue) is to actually position them on the back of the PCB so that I can replace them without having to remove the plate to get  at them.
[work]ducky tiger dk-9008G2, cherry mx brown|logitech performance mx
[home]corsair k70 LUX RGB, cherry mx brown|logitech G700s

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #140 on: Wed, 15 August 2012, 17:07:46 »
Would anybody be able to at least modify the default firmware to work for a 7bit layout, preferably one that matches my default layer?
« Last Edit: Wed, 15 August 2012, 17:18:44 by TheProfosist »

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #141 on: Wed, 15 August 2012, 17:59:43 »
since your layout is unique to you, you maybe better off doing this yourself.  It is fairly simple.  Install the C compiler and teensy loader.  Then get the source code

In phantom.c, there is this table:

Code: [Select]
const uint8_t is_modifier[NKEY] = {
  true,            true,            false,           false,           false,           false,  // COL  0
  true,            false,           false,           false,           false,           false,  // COL  1
  true,            false,           false,           false,           false,           false,  // COL  2
  NA,              false,           false,           false,           false,           false,  // COL  3
  NA,              false,           false,           false,           false,           false,  // COL  4
  NA,              false,           false,           false,           false,           false,  // COL  5
  NA,              false,           false,           false,           false,           false,  // COL  6
  false,           false,           false,           false,           false,           false,  // COL  7
  NA,              false,           false,           false,           false,           false,  // COL  8
  NA,              false,           false,           false,           false,           false,  // COL  9
  true,            false,           false,           false,           false,           false,  // COL 10
  true,            false,           false,           false,           false,           false,  // COL 11
  false,           NA,              false,           false,           NA,              false,  // COL 12
  true,            true,            false,           false,           false,           false,  // COL 13

  false,           NA,              NA,              false,           false,           false,  // COL 14
  false,           false,           NA,              false,           false,           false,  // COL 15
  false,           NA,              NA,              false,           false,           false,  // COL 16
};

const uint8_t layout[NKEY] = {
//ROW 0            ROW 1            ROW 2            ROW 3            ROW 4
  KEY_LEFT_CTRL,   KEY_LEFT_SHIFT,  KEY_CAPS_LOCK,   KEY_TAB,         KEY_1,              KEY_ESC,        // COL  0
  KEY_LEFT_GUI,    KEY_PIPE,        KEY_A,           KEY_Q,           KEY_2,              KEY_TILDE,      // COL  1
  KEY_LEFT_ALT,    KEY_Z,           KEY_S,           KEY_W,           KEY_3,              KEY_F1,         // COL  2
  NA,              KEY_X,           KEY_D,           KEY_E,           KEY_4,              KEY_F2,         // COL  3
  NA,              KEY_C,           KEY_F,           KEY_R,           KEY_5,              KEY_F3,         // COL  4
  NA,              KEY_V,           KEY_G,           KEY_T,           KEY_6,              KEY_F4,         // COL  5
  NA,              KEY_B,           KEY_H,           KEY_Y,           KEY_7,              KEY_F5,         // COL  6
  KEY_SPACE,       KEY_N,           KEY_J,           KEY_U,           KEY_8,              KEY_F6,         // COL  7
  NA,              KEY_M,           KEY_K,           KEY_I,           KEY_9,              KEY_F7,         // COL  8
  NA,              KEY_COMMA,       KEY_L,           KEY_O,           KEY_0,              KEY_F8,         // COL  9
  KEY_RIGHT_ALT,   KEY_PERIOD,      KEY_SEMICOLON,   KEY_P,           KEY_MINUS,          KEY_F9,         // COL 10
  KEY_RIGHT_GUI,   KEY_SLASH,       KEY_QUOTE,       KEY_LEFT_BRACE,  KEY_EQUAL,          KEY_F10,        // COL 11
  KEY_APPLICATION, NA,              KEY_BACKSLASH,   KEY_RIGHT_BRACE, NA,                 KEY_F11,        // COL 12
  KEY_RIGHT_CTRL,  KEY_RIGHT_SHIFT, KEY_ENTER,       KEY_BACKSLASH,   KEY_BACKSPACE,      KEY_F12,        // COL 13

  KEY_LEFT,        NA,              NA,              KEY_DELETE,      KEY_INSERT,         KEY_PRINTSCREEN,// COL 14
  KEY_DOWN,        KEY_UP,          NA,              KEY_END,         KEY_HOME,           KEY_SCROLL_LOCK,// COL 15
  KEY_RIGHT,       NA,              NA,              KEY_PAGE_DOWN,   KEY_PAGE_UP,        KEY_PAUSE,      // COL 16
};

Change it to what you want, and then build the .hex file.  Upload it to your teensy.  Rinse and repeat.

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #142 on: Fri, 17 August 2012, 01:08:23 »
What the best way to find what row and column the switch is in as i believe some of the additional function row keys are actyally in the row of the spacebar, though i may be wrong


Also can anyone think of a simple way if throwing an if/then in when a switch is pressed to check if another switch is held down and if so to do a different function, should be a simple dirty way of getting a layer in there in a way...

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Building Phantom Hardware and Firmware Mods
« Reply #143 on: Fri, 17 August 2012, 02:13:53 »
The row and column number of each switch is written on the PCB.

The value at position col*6+row in the array "pressed" is 1 if that key is pressed and 0 otherwise. Remember that rows and columns are zero-indexed.

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Building Phantom Hardware and Firmware Mods
« Reply #144 on: Fri, 17 August 2012, 15:56:32 »
The value at position col*6+row in the array "pressed" is 1 if that key is pressed and 0 otherwise. Remember that rows and columns are zero-indexed.
ok so what would be needed the would probably be an if/then, another variable, and another array. Though I am mostly lost as to how to make it work and havnt even found the part you talked about yet. I know very little about programming though it seems enough to be dangerous.


my idea:

after checking if the key is pressed you would have to check is specifically one of the "Fn" keys is pressed if so grab from a the "Fn array" if not grab from the "standard array"

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Re: Building Phantom Hardware and Firmware Mods
« Reply #145 on: Mon, 20 August 2012, 11:32:51 »
Just figured I'd throw this up.  It doesn't do anything but look nifty so far.  The intent is to have it output the is_modifier and layout arrays to be copy pasta'd into the phantom.c file.

2501-0

Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #146 on: Mon, 20 August 2012, 12:05:34 »
alaricljs, this pretty sweet!

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: Re: Building Phantom Hardware and Firmware Mods
« Reply #147 on: Mon, 20 August 2012, 14:41:54 »
alaricljs, this pretty sweet!
agreed now if even one layer was made to work you could add that in as well.

Offline litster

  • Thread Starter
  • Posts: 2890
  • rare caps?! THAT'S A SMILIN
Re: Building Phantom Hardware and Firmware Mods
« Reply #148 on: Mon, 20 August 2012, 15:22:52 »
I think some of these features would be good to have next:

•reset with key combos without opening up the case to push the reset button on Teensy for easy flashing
•re-program keymaps without loading new firmware like AIKON.
•multiple layers
•NKRO over USB while maintaining BIOS boot compatibility
•media keys
•programmable macros

ic07 has been building teensy firmware for ergo Dox.  Wonder if he could help, or someone takes his code and port it over for Phantom.

Offline agor

  • Posts: 282
  • Location: Germany
Re: Building Phantom Hardware and Firmware Mods
« Reply #149 on: Mon, 20 August 2012, 15:34:41 »
ic07 has been building teensy firmware for ergo Dox.  Wonder if he could help, or someone takes his code and port it over for Phantom.

Where can I find this code?
KBD8X II - MX 5000 - Realforce 88UB - Phantom - GH60