New project - MSFS C++ USB interface - Page 2


+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 41 to 56 of 56
  1. #41
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Since my favorite I/O Expander MCP23016 is obsolete, I was moving on to the MCP23017. Aaaaaaaand then I noticed they have a bug , and Microchip is leaving it as a feature. The last pin on both ports is output only, and my 1st circuit is all INPUT, bringing me down to 14 I/Os only.

    So I'm moving over to the MCP23S17 and SPI communication. Looks like I'm going to be playing with Gadelhas' code after all.
    https://www.picbasic.co.uk/forum/sho...395#post111395

    Robert

  2. #42
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    I am done with the DIY pcb, chemicals and drilling... Enough fumes, dust and stains!

    A CNC machine is nice to have, for various other uses also, among pcb and drilling, but not for me anymore.

    Now I use the dirty cheap and ultra fast JLCPCB for any pcb needs.

    Ioannis
    I went the chemical way 14 years ago; not doing that again. I had SOIC SMD parts and it worked, but I'm too old to breath fumes.


    This is my 2nd attempt on my mini-CNC. I royally screwed up the mirror operation on the 1st attempt.

    Top:


    Bottom:


    Still need to get fine steel wool to finish the job, dip in silver nitrate, and test text with inkjet printer transfer paper.

    Robert
    Last edited by Demon; - 22nd October 2023 at 01:35.

  3. #43
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I think the secret to making nice double-sided PCBs on a mini-CNC is to establish a procedure. This is what I do on the mini-CNC:

    Code:
    1. Install 3.175mm drill bit.
    2. Home X, Y and Z axis.
    3. Probe Z-axis.
    4. Drill Left Alignment Holes.
    5. Drill Right Alignment Holes.
    
    6. Install 30deg V-bit.
    7. Probe Z axis.
    8. Height-map PCB, if required.
    9. Route Top layer.
    
    10. Install 0.8mm endmill bit.
    11. Probe Z axis.
    12. Route Top layer Cutout.
    
    13. Flip PCB using Alignment Pins.
    
    14. Install 30deg V-bit.
    15. Probe Z axis.
    16. Route Bottom layer.
    
    17. Install drill bit.
    18. Probe Z axis.
    19. Drill Bottom layer.
    
    ... repeats steps 12 - 14 for all Drill files
    
    20. Install 2 Retention Pins in Screw Holes.
    
    21. Install 0.8mm endmill bit (Make sure drill clears Retention Pins).
    22. Probe Z axis.
    23. Route Bottom layer Cutout.
    I take notes while I'm using the machine, and improve on the process.

    This is what I do to generate the G-code files from FlatCAM:

    Code:
    =========================== FlatCAM ===========================
    
    Start WinPythonPowershell
    
    cd ..
    cd ..
    cd flatcam
    python .\flatcam.py
    
    
    ========== Do Height Map before drilling, if required. ==========
    
    
    	*** do not import Drill file for 3 Fiducials ***
    
    
    ****************** Alignment Holes and Mirror ******************
    
    Generate Drill files and Mirror Bottom:
    	- select MechanicalNofiducial file.
    	- click on 2-Sided.
    	- Axis = X.
    	- Reference = Box.
    
    	- click on Gerber.
    	- Select Bottom layer.
    	- click on Mirror.
    
    	- click on Excelon.
    	- Select Drill file.
    	- click on Mirror.
    	...
    	- repeat for all Drill files.
    
    	- Drill Dia = 3.175mm.
    
    	- point on desired coordinates Upper Left above Outline.
    	- Shift + Left Click.
    	- click Create Excelon Object.
    
    	- point on desired coordinates Upper Right above Outline.
    	- Shift + Left Click.
    	- click Create Excelon Object.
    
    	- select 1st Alignment Hole Drill file.
    	- click Properties.
    	- rename to "1 - Alignment_Holes_L_3.175mm".
    	- click Drilling.
    	- Cut Z = -10.0mm.
    	- Travel Z = 1.0mm.
    	- Feedrate = 25mm/min.
    	- SpindleSpeed = 7500rpm.
    	- Start Z = 1mm.
    	- EndMove Z = 1mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_No_M6.
    	- Click GenerateCNCjob Object.
    
    	- select new Alignment CNC Job.
    	- Save CNC job (include drill dia and side in file name).
    	...
    	- repeat for 2nd Alignment Hole Drill file with:
    	  - "2 - Alignment_Holes_R_3.175mm",
    	  - EndMove Z = 25mm.
    
    	- Save Project.
    
    
    ************************ Milling Layer ************************
    
    Generate Geometry file:
    	- hide all other layers.
    	- select Gerber file for Top layer.
    	- click Properties.
    	- click Isolation Routing - Advanced.
    	- click Calculators, if necessary:
    		- Tip Diameter = 0.1mm
    		- Tip angle = 30deg.
    		- Cut Z = -0.1mm
    		- click Calculate.
    		- Copy Tool Diameter of 0.1536mm.
    	- Paste Tool Diameter.
    	- Shape = C1, circular with 1 flute.
    	- Passes = 2.
    	- Overlap = 20%.
    	- Enable Combine.
    	- Click Generate Geometry.
    
    	- Save Project.
    
    Generate CNC file:
    	- Select Geometry file.
    	- click Properties.
    	- click Milling - Advanced.
    	- Tool Dia = 0.1536mm.
    	- Job = Isolation.
    	- Cut Z = -0.1mm
    	- Travel Z = 1mm.
    	- Feedrate X-Y = 120mm/min - 140mm/min.
    	- Feedrate Z = 10mm/min - 12mm/min.
    	- Spindle Speed = 9500rpm - 12000rpm.
    	- EndMove Z = 25mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_no_M6.
    	- click Generate CNCjob Object.
    	- Save CNC job (include mill shape in file name).
    
    	- Save Project.
    	...
    	- repeat 2 steps for Bottom layer.
    
    
    *************************** Holes ***************************
    
    Generate Drill file:
    	- select excelon file for alignment holes.
    	- click Properties.
    	- click Drilling - Advanced.
    	- Cut Z = -2.0mm (small), -3.0 (large), -10.0 (Retention Pins).
    	- Travel Z = 1.0mm; height above PCB for traveling.
    	- Feedrate = 25mm/min (large) to 40mm/min (small).
    	- SpindleSpeed = 7500rpm.
    	- Start Z = 1mm; height when operation starts.
    	- EndMove Z = 25mm; height to raise after operation.
    	- EndMove X,Y = 0,0; return to origin.
    	- Click GenerateCNCjob Object.
    	- Save CNC job (include drill dia in file name).
    
    	- Save Project.
    
    
    ************************** Cut-out **************************
    
    Generate Geometry file:
    	- hide all other layers.
    	- select Gerber file for MechanicalNofiducial.
    	- click Properties.
    	- click Cutout - Advanced.
    	- Tool Diameter = 0.8mm.
    	- Cut Z = -0.5mm (top layer), -1.3mm (bottom layer).
    	- Passes = 0.10mm.
    	- Margin = 0.
    	- Gaps = None.
    	- Click Generate Geometry.
    
    	- Save Project.
    
    Generate CNC file:
    	- Select Geometry file.
    	- click Properties.
    	- click Milling - Advanced.
    	- Tool Diameter = 0.8mm.
    	- Job = Finishing.
    	- Cut Z = -0.5mm (top layer), -1.3mm (bottom layer).
    	- Multi Depth = enabled, 0.1mm - 0.15mm.
    	- Margin = 0mm.
    	- Gaps = None.
    	- Travel Z = 1mm.
    	- Feedrate X-Y = 100mm/min - 360mm/min.
    	- Feedrate Z = 10mm/min - 30mm/min.
    	- Spindle Speed = 9500rpm - 12000rpm.
    	- EndMove Z = 25mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_no_M6.
    	- click Generate CNCjob Object.
    	- Save CNC job (include endmill shape in file name).
    
    	- Save Project.
    There's been a lot of tweaking and adjusting since day 1. Most of those values are now set as the default values in FlatCAM. I have a lot less room for errors, except in things like trace isolation and PCB cut-outs; I use Milling operation for both of them, but use a V-bit for isolation, and an endmill for cutting out the board. Those 2 bits don't use the same speeds.

    Robert
    Last edited by Demon; - 22nd October 2023 at 02:32.

  4. #44
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,638


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Nice PCB, though it needs sanding as you noted.

    The steps to reach your goal will be valuable for a newbie on the field of CNCing a pcb.

    For one off is great. Do you know what is the smallest part you can do with your CNC?

    Ioannis

  5. #45
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    Nice PCB, though it needs sanding as you noted.
    ...
    Do you know what is the smallest part you can do with your CNC?

    Ioannis
    Thanks.

    Well, I know this can handle SOIC easily. I'm sure this could handle SSOP. The only limitation is me; my hands shake a bit now. I got some of that low-melt solder and a new hot-air gun to test some SSOP.

    Last weekend I found out that QCAD doesn't have any means of milling slots; so that meant finding another PCB design software. After 30 minutes of research, I had already decided KiCAD was the one to try first. Reviews on the web gave it very high marks, and deservedly so. Took me only 2 days to get "comfy" with it; I love it, very powerful. I had to redo that circuit above from scratch; which was a good learning experience. It gave me a chance to put the 2 screws in a diagonal arrangement, with 2 headers in the opposite corners for stability.

    I uploaded my new design to JLCPCB for the fun of it; just to get an idea on the upcoming costs. 26mm x 18.5mm, panelized 10 rows x 10 columns (even 100 per sheet), 5 sheets. Check this out, $22 excluding shipping. I'm not even gonna bother shopping elsewhere.


    (updated with the silkscreen, paste and mask files for both sides; turns out that's all included in the price)

    I have 6 of these "switch/pot/encoder adapter circuits", 4 secondary boards (maybe 4" x 6"), and one USB master (that won't be very big). It looks possible to keep that under or close to $10 with JLCPCB.

    Robert
    Last edited by Demon; - 25th October 2023 at 06:22.

  6. #46
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    3D PCB viewer included in KiCAD.



    Wow! :O

  7. #47
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,638


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Wow from me too!

    You got all that in a few days? Well, KiCAD will be my next try on PCB software then!

    I use JLCPCB for a long time now and while other competitors may have better quality sometimes, I stick to them because they have DDP option to send in my country. That means I do not have to worry about import taxes and proceedures for this. Love it.

    Ioannis

  8. #48
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I just noticed JLCPCB only goes down to 0.4mm pin spacing for economic PCBA, and down to 0.35 for standard. PIC 18F25K50 SSOP has 0.2mm between pads, so I guess that means down to SOIC for me.

    Robert

  9. #49
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,638


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I think you are OK since the min pad to pad is 0.127mm and the PIC selected is 0.2mm

    See here: https://jlcpcb.com/capabilities/pcb-capabilities

    Ioannis

  10. #50
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    I think you are OK since the min pad to pad is 0.127mm and the PIC selected is 0.2mm

    Ioannis
    Except I have to be able to solder the prototypes.

    I edited the BOM an PKP files as they instruct to get a better cost estimate for 5 10x10 panels. Over 50% is shipping.

    Have you used their assembly service? I don't see any billing for the actual parts being assembled (Components is blank).

    I have 2 capacitors, 2 resistors, in 1206 SMD format. I didn't see any way of telling them the specs of the components except for the value (my caps are ceramic, resistors are thick film - no mention of voltage, watts, tolerance, etc).


  11. #51
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Ioannis (or anyone else who knows),

    Have you noticed if they care how many holes are in a PCB?

  12. #52
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    This is what you get when you ask for specs from a company on the other side of the world.



  13. #53
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,638


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I have used the assembly twice.

    First time was on a small PCB with 5 or 6 components for 5 pieces. The PCB had a through hole connector that seemed hand soldered. Anyway it was OK all of them and worked fine.

    The second attempt was more complicated PCB with a square PIC and more components (SMD and Through hole). I did a mistake on the selection of LED's. I chose the ones that light from the side and their engineers spotted the mistake, sent me email to explain the problem and the solution, and after I accepted it, I received the 20 pcs that were almost all working fine. One had a cold solder and was easy to fix.

    Right now I am preparing my third order and I see that prices of PIC dropped enough, comparing 5-6 months ago.

    My problem is that they have tons of passive components to choose from many (unknown) suppliers!

    I had similar replies as you Robert about specs or other questions... Yes, communication might be difficult at times. Or most of the times!

    About holes, no. I did not had to count them. There seems no limit or charge on this.

    Ioannis

  14. #54
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    ... One had a cold solder and was easy to fix.
    ...
    My problem is that they have tons of passive components to choose from many (unknown) suppliers!

    I had similar replies as you Robert about specs or other questions... Yes, communication might be difficult at times. Or most of the times!
    ...
    Ioannis
    Ok, so I can't just blindly trust them and slap these into a unit. I have to double-check each piece, cause if there's a problem, I'm the one that's gonna get yelled at.

    Yeah, I suppose I'm gonna have to do a trial run of each circuit at first and measure the devices, then run a battery of destructive tests to see how far I can take them before PUFF the Magic Dragon shows up. Thing is, I doubt we can trust them to always provide the same material unless it's specified and documented somehow. Like capacitors, we could get a batch of 20-25V on the 1st run, then get 10V later on. You can't ask for a remake if it's not documented on the order.

    What if we include it in the BOM, with a message to confirm with us? I mean, it's pretty easy for us to test the voltage and watt limit on capacitors and resistors.

    - maybe extra columns at the end?

    Volts, Tolerance for capacitors.
    Watts, Tolerance for resistors.


    So far, all my communications with Asia has been positive. They use a translator similar to google. When in doubt, always ask for confirmation.

    I had a conversation just this summer with one lady. They're ordinary people just like us; except they're stuck in a dictatorship.

    Robert

  15. #55
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,411


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Ioannis, check this out.

    Couple switches, buttons, resistors and LEDs, along with a truckload of holes:




    The exact same circuit without the holes:




    I guess they've moved away from milling the boards with endmills, but have moved on to waterjet (this is my first guess) or laser.

    This is great news for me 'cause I'm going to need a lot of holes.
    Last edited by Demon; - 29th October 2023 at 03:09.

  16. #56
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,638


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    About the components, there are tons of them but each has specific code from their sister company https://www.lcsc.com/ where you can login with Jlcpcb credentials.

    When you find the component you are happy with, put the code in the appropriate BOM that will accompany your PCB files.

    Or you can use their EasyEDA and all these done almost automatically because the components library of this cad has all the codes and makes it easy to produce BOM.

    There are also FAQ files if you are in doubt and also BOM example files on the FAQ section, https://jlcpcb.com/help/

    My last job was done in Eagle and then, with the help of the CAM file JLCPCB offers, I exported the gerber files for PCB production along with the BOM file. I can send them to you if you want to see how I done it.

    About the quality of assembly, I can say that you cannot beat them. Even if I had one cold joint, it was nothing considering the work needed on my side to assembly by hand 20 PCBs by hand! A nightmare for sure!

    Ioannis
    Last edited by Ioannis; - 30th October 2023 at 09:56.

Similar Threads

  1. USB interface
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th December 2011, 20:37
  2. Host for USB interface?
    By Carrasco in forum Off Topic
    Replies: 4
    Last Post: - 4th August 2007, 00:59
  3. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 17:04
  4. USB interface from PIC16F877 to PC
    By headshouter in forum USB
    Replies: 0
    Last Post: - 26th February 2006, 05:58
  5. USB project
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th January 2005, 22:59

Members who have read this thread : 18

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts