Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 12 of 16     «   Prev   9   10   11   12   13   14   15   Next   »
Angel of Rust

Registered:
Posts: 234
Reply with quote  #166 
Quote:
Originally Posted by e4mafia
Angel of Rust, what libraries are you including in your arduino sketch for the master controller?
I'm working to port your work to my arduino RedBoard (Uno with built in FTDI 232 chip). So trying to translate your register reads to mine.



The libraries I am using for the master controller are the "keypad" library and the Teensy libraries. The thing that is special about the Teensy controllers is that they ship with 3+ UART ports. The ATmega328 chip on Redboard has one, and it appears to be dedicated to the USB-to-serial connection. This is a sensible configuration for many applications because most Arduinos rely on the UART connection to allow programing via the USB interface. I am not an expert with this particular board, so it would be best to consult other online resources regarding its capabilities and programming.

Regarding the serial registers, I found the appropriate names by looking up the datasheets for the microprocessor on the Teensy-LC (KL26 Sub-Family Reference Manual). This resource made it very quick to implement the DMX code since the Teensy library used the same names for the registers as the manual.

I did a quick search for ATmega328 datasheets and came up with the following link:
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Summary.pdf

The summary doesn't seem to list all the registers. However, it does have link to other resources that may be helpful.

Finally, I have attached the complete block 3 code (same as at Armada IV -- I haven't found time to update it). Hopefully you find it helpful.

zip block 3 code 20180405.zip     


Quote:
Originally Posted by e4mafia


Interestingly, when I hook up the redboard and start Artemis, the TX light on the redboard lights up like a Christmas tree, and the sketch for the arduino is basically empty. An empty setup loop and and empty main loop, so I know that the arduino is not actually sending anything.

I'm guessing that for some reason, the TX and RX are swapped?
Wondering  how thats possible?

Thanks!


The TX/RX nomenclature messed me up at least once. I needed to reverse and re-soldier the RX/TX connections on my prototype because of this issue!

Here is what is happening on Redboard:
redboard rx.png 
Notice that the TX from the USB-to-serial converter is connected to the RX on the microcontroller and vice-versa. I discovered (the hard way) that the electronics convention at work here is that the TX and RX connections describe the relationship with the IC. Hence USB signals received by the FT231XS go out via TX to the microcontroller's RX, etc. 

Notice that pins 10 and 17 are connected to the status LEDs. Looking at the FT231XS datasheet, we see that these pins default to the TX and RX LEDs, respectively. According to the datasheet, when the FT231XS is receiving from the USB and transmitting to the ATmega238, the RX LED lights up. Similarly, when the FT231XS is transmitting via USB, the TX LED lights up. Therefore, I don't think the LEDs are reversed. However, it certainly sounds like that is the case from what you are describing. When I plug my USB-to-serial converter into Artemis, the equivalent of the RX LED blinks to indicate data coming from the USB connection. I don't know what is happening.
FT231xs table.png 



Angel of Rust

Registered:
Posts: 234
Reply with quote  #167 
Quote:
Originally Posted by Cervantez
You made it into the "Make:" section of Heise (a German news page):
https://www.heise.de/make/meldung/Hardware-trifft-Gaming-Funktionale-Kontrollpanele-fuer-Computerspiel-Artemis-4153550.html


Quote:
Originally Posted by Mike Substelny
You are blazing the trail for everyone, my friend! Nice work!




Thanks, everyone! With some luck, we'll get spaceship lovers the world over to play Artemis!

e4mafia

Registered:
Posts: 160
Reply with quote  #168 
I'm making some pretty solid progress I think. Found the register data here: http://www.sharetechnote.com/html/Arduino_BasicInfo.html#USART_MemoryMap_Register_Descripti
Which led me to look in the header file to find the appropriate names for the registers. Needed to refer to the Teensy data sheet to help me find what I was looking for in the 328 reference.
After substituting my register names for yours in the pre-setup, I got the code to compile, Yay!

Moving on into the setup() portion, I'm seeing a method "attachInterruptVector(IRQ_UART0_STATUS, DMX_read);" that doesn't seem to be part of anything else in the sketch, so I'm guessing its part of the teensy include. I did some guessing as to what my 328's name would be, but when compiling, it flagged the method itself, and not my IRQ name. I looked around in the rest of your master controller file, and didn't see a definition for that method. Should I be looking for something equivalent in the 328b files?

Thanks again, a million times over for sharing your knowledge about this. I plan on fully documenting everything I did for this so that others can build, as you did with the teensy. Come to think of it, I probably should have just used the teensy and FTDI chip and saved myself a whole lot of work 😉
-Bob
Angel of Rust

Registered:
Posts: 234
Reply with quote  #169 
Quote:
Originally Posted by e4mafia
I'm making some pretty solid progress I think. Found the register data here: http://www.sharetechnote.com/html/Arduino_BasicInfo.html#USART_MemoryMap_Register_Descripti
Which led me to look in the header file to find the appropriate names for the registers. Needed to refer to the Teensy data sheet to help me find what I was looking for in the 328 reference.
After substituting my register names for yours in the pre-setup, I got the code to compile, Yay!

Moving on into the setup() portion, I'm seeing a method "attachInterruptVector(IRQ_UART0_STATUS, DMX_read);" that doesn't seem to be part of anything else in the sketch, so I'm guessing its part of the teensy include. I did some guessing as to what my 328's name would be, but when compiling, it flagged the method itself, and not my IRQ name. I looked around in the rest of your master controller file, and didn't see a definition for that method. Should I be looking for something equivalent in the 328b files?

Thanks again, a million times over for sharing your knowledge about this. I plan on fully documenting everything I did for this so that others can build, as you did with the teensy. Come to think of it, I probably should have just used the teensy and FTDI chip and saved myself a whole lot of work 😉
-Bob


"attachInterruptVector()" takes the arguments IRQ_UART0_STATUS, which is the name of the serial status flag I want to trigger my function and DMX_read, which is the name of the function "DMX_read()" that gets called when the interrupt is triggered (these kind of functions are also known as ISRs). Because the Arduino language encompasses many different chips, the options for handling interrupts vary significantly between chips. The "attachInterruptVector()" function appears to be from the Teensy library.

Looking at the basic Arduino reference site, "serialevent()" appears to be the nearest related ISR.
https://www.arduino.cc/reference/en/language/functions/communication/serial/serialevent/

"attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)" has similar functionality, but appears only to allow interrupt calls on changes with external pins.
https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/

No matter what the ISR is called, you would need to code similar functionality to my "DMX_read()" ISR to implement the DMX stream reading ability.

Angel of Rust

Registered:
Posts: 234
Reply with quote  #170 
I was looking through my design files today and realized that I froze my design for the Block III Helm console exactly one year ago. It feels like a lot longer than that! I have some ideas in the works about some new things to try. In the meantime, enjoy these birthday photos:

Revision B console design - final:
Console Layout Helm rev B 20170928.png 
Helm at one: needs some repairs, but is looking (and working!) pretty good:
20180928_222640 - Copy.jpg

JSpaced

Avatar / Picture

Registered:
Posts: 115
Reply with quote  #171 
Everything about this project is awesome! Keep it up!
__________________
"Universal law is for lackeys. Context is for kings."
Angel of Rust

Registered:
Posts: 234
Reply with quote  #172 
I've spoken with a few people here offline about the idea of turning this project into kits that people can use to outfit their own custom control panels. The overall electronic design is pretty amenable to the concept, but the parts I have been using are cumbersome and time-consuming to assemble.

With the holidays rapidly approaching, I have a little time to put my thoughts on paper (and learn KiCAD) and have come up with a refined version of the design that would work as kits.

The first improvement is to go from two layers of acrylic to one -- just for face plate. The button labels and other line work are replaced by die-cut vinyl stickers, which can be customized or replaced entirely by people's own designs to suit taste.

The electronics package changes from a controller board plus three panels made from two layers of acrylic-mounted hand-wired boards each to a single professionally-produced PCB for each sub panel. The controller is built entirely on the keypad board, which is common to all panels. With these changes, the material cost for the circuitry goes up a little, but the error and assembly time goes way down.

The solid clicky buttons are replaced by translucent buttons that are lit from the inside by LEDs to indicate the state of various game controls.

Finally, the whole thing is programmed on Teensy-LCs using Arduino, so that people can program whatever functions they want, including future updates to Artemis. Since the design is modular, people could include features they like and build on custom parts they want, depending on skill level and objectives.

The part that doesn't change is the communication protocol between controllers. That part worked really well on the block IIIs and was a major differentiator between this approach and other custom designs. Since the protocol is flexible, many different ideas can be incorporated solely through programming.

Here are some sketches of the panel face plates:
science rev A 20181122.png  weapons rev A 20180806.png  engineering rev A 20180731.png  helm rev A 20180805.png 
Helm, Weapons (the torpedo selector), Engineering, Science, and Comms all have the same keypad, allowing a massive streamlining of the electronics. The keypad also houses the microcontroller and RS485 transceiver, allowing the other "dumb" sub-panels (or other creations) to be plugged in and controlled by the keypad. Here is the design for the keypad PCB:
keypad rev A 20181217 back.png  keypad rev A 20181217 front.png 

ACP3-X-KEY-PCB front.jpg  ACP3-X-KEY-PCB back.jpg 
Now for the electronics material costs (it's not great, but it's on the right track):
ACP3 keypad parts.png 
The next step will be to work out the design and supplier for the faceplate, backplate, and stickers.

Jake Ryker

Avatar / Picture

Registered:
Posts: 112
Reply with quote  #173 
Looking great!! Nice Work!!!
__________________
My job is to solve problems, find amazing tools and toys, and above all inspire people. Serving on board the USS Albatross docked at bay 1325.
Angel of Rust

Registered:
Posts: 234
Reply with quote  #174 
Hi all - I hope you are finding some time to enjoy the holidays and, of course, play Artemis with your friends and family!

I have been cooking up some more ideas for the Artemis controls kits. I decided that my earlier concept of moving the controller to the keypads is not going to work out -- it results in bigger boards that many people won't want anyway. I am returning to the tried-and-true arrangement of having small standalone controllers with modular panels that plug into them. That keeps the boards small and the cost down. It also makes it easy to swap out parts for hobbyists making custom controls or building up a set of controls one piece at a time.

The heart of the system is the control board. I have made a number of refinements over the block 3 design to allow for better functionality and more customization. It is still built around the Teensy-LC since the power and flexibility is hard to beat for the price. Plus, it is easy to program and upload updates.
ACP3-X-CTL-PCB 20181230 FRONT.png

ACP3-X-CTL-PCB 20181230 BACK.png   

I added the FTDI chip to the board, which eliminates the need for a standalone central controller. Only one of the controllers needs the chip. Overall, the changes mean a significant cost savings. Here is the cost breakdown and the change in architecture:

  CTL COST 1.png 
  CTL COST 2.png 
block 3 schematic 20181231.png 
acp3 schematic 20181231.png

ogremasch

Avatar / Picture

Registered:
Posts: 180
Reply with quote  #175 
Amazing work as always. I am amazed at the level of work and effort you put into this, it really shows. Let me know when a kit is available. I would totally be willing to buy a set for my ship. 😉
MarkBell

Avatar / Picture

Administrator
Registered:
Posts: 1,865
Reply with quote  #176 
Lovely and informative, as usual! Are you planning on swapping out your current controllers in favor of this one?
__________________
Note - this is in no way intended to be an official position of Thom or Artemis, as I am not an official representative of the creator or game.
Angel of Rust

Registered:
Posts: 234
Reply with quote  #177 
Quote:
Originally Posted by ogremasch
Amazing work as always. I am amazed at the level of work and effort you put into this, it really shows. Let me know when a kit is available. I would totally be willing to buy a set for my ship. 😉


Thanks! I will certainly let everyone know when some kits are ready to go. My plan is to get the controller housing worked out and then finalize the basic engineering console kit. The engineering console seems to be a consistent favorite. After that, depending on interest, I will work through the consoles and finalize the other designs.

Quote:
Originally Posted by MarkBell
Lovely and informative, as usual! Are you planning on swapping out your current controllers in favor of this one?


Thanks! I don't really have a plan right now to replace my current set of the block 3's. They are a little rough around the edges, but work just fine. The controllers are nearly the same. I will be able to test the new hardware's communication capability by dropping it into the current bus. The communication protocol and RS485 pin assignments are identical.

The control panel pin assignments are really close, but not quite identical. Since I still have a few block 3 panels to finish, I haven't decided if I'll finish them in the new format or not.

pin assignments for block 3 ribbon connectors:
block 3 ribbon.png 

pin assignments for ACP3 ribbon connectors:
acp 3 ribbon.png
Angel of Rust

Registered:
Posts: 234
Reply with quote  #178 
Parts came in yesterday. Did the fit check today. Looks good. Time to order PCB!

20190110_194939 - Copy.jpg

Angel of Rust

Registered:
Posts: 234
Reply with quote  #179 
good news and bad news:

The good news: The boards arrived today and everything checks out.

The bad news: I should've waited to order the boards, because I decided to rearrange the connector pinouts at the last minute so that it will be easy for people to implement edge lit panels (who doesn't want controls that light up?) from the kits.

Luckily the boards are so tiny that the cost impact was very small.

Revision D should be the last major change before final.

20190119_221618 - Copy.jpg

Insaniac99

Registered:
Posts: 3
Reply with quote  #180 
You have amazing timing, I was thinking about trying to build controls and if you make kits available I'd gladly do that rather than re-invent the wheel.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.