Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 10, 2016, 09:42:20 09:42


Login with username, password and session length


Pages: [1]
Print
Author Topic: USB aviation control panel & other  (Read 752 times)
0 Members and 1 Guest are viewing this topic.
EchoRomeo
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 1
-Receive: 0


« on: June 08, 2016, 06:18:36 18:18 »

Hi there!

My first project on this forums will be as described in the title. I'll write a memory of the project as I go and post here for all to see (full source code, schematics, pictures and comments). Maybe someone will draw inspiration from it.

For now I've got a basic development environment set up, which consists of:

Pickit3 programmer
MPLAB IDE + XC8 PRO compiler
EagleCAD

I'm using the PIC18F4550 as the heart of the project and a shitton of switches, buttons, potentiometers and encoders as input devices. For now I'm focusing on the USB protocol and trying to program a very simple HID-compliant device, just to get the basics straight and out of the way.

Let me know what you guys think of it. If anyone got advice or recommendations, I'm more than glad to hear them!

Cheers,
Daniel

P.S. Kudos to @pickit2 for inviting me to the forum!
Logged
koky
Active Member
***
 Warned
Offline Offline

Posts: 157

Thank You
-Given: 83
-Receive: 115


WWW
« Reply #1 on: June 08, 2016, 07:24:11 19:24 »

i can't see a link in the "here"
thank you
Logged
EchoRomeo
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 1
-Receive: 0


« Reply #2 on: June 12, 2016, 01:44:45 13:44 »

By "here" I meant in this forums, in this particular thread Smiley
Logged
Gallymimu
Hero Member
*****
Offline Offline

Posts: 579

Thank You
-Given: 101
-Receive: 151


« Reply #3 on: June 13, 2016, 12:24:44 00:24 »

Hi there!

My first project on this forums will be as described in the title. I'll write a memory of the project as I go and post here for all to see (full source code, schematics, pictures and comments). Maybe someone will draw inspiration from it.

For now I've got a basic development environment set up, which consists of:

Pickit3 programmer
MPLAB IDE + XC8 PRO compiler
EagleCAD

I'm using the PIC18F4550 as the heart of the project and a shitton of switches, buttons, potentiometers and encoders as input devices. For now I'm focusing on the USB protocol and trying to program a very simple HID-compliant device, just to get the basics straight and out of the way.

Let me know what you guys think of it. If anyone got advice or recommendations, I'm more than glad to hear them!

Cheers,
Daniel

P.S. Kudos to @pickit2 for inviting me to the forum!


Congrats!  I think this will be a lot more interesting once you actually have done something or have specific questions to ask.

As it stands now I have no idea what you are trying to accomplish!

I am certainly inspired though Smiley
Logged
EchoRomeo
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 1
-Receive: 0


« Reply #4 on: June 13, 2016, 11:34:05 23:34 »

@Gallymimu, yep you're right. So here goes a couple questions I've encountered during the past few days of research. They all basically relate to operation of the USB subsystem of the PIC18F4550.

So the relevant datasheet says that endpoint Rx/Tx is controlled through the use of buffers described in the corresponding Buffer Descriptor entries (in the BDT). But it doesn't exactly specify, as far as I've found,
  • When responding to an IN token, how to set which DATAx PID will the sent packet use
  • And what exactly must you write to the buffer area (data package only? PID + DATA? PID + DATA + CRC?)

DATAx packet: SOF + PID + DATA + CRC + EOF

Actually, I guess point #1 is a subset of #2. Which is, after describing the buffer starting location and byte count to send, what do you actually write in the buffer? What makes the most sense is that you only write the actual DATA you want to send, since the rest are simple protocol structures which can be generated by the silicon. But it's not really stated anywhere... and I don't have HW USB protocol analyzers, so I can't know what comes out of the PIC. And if you only write the DATA to be sent in the buffer, how do you specify which PID (DATA0/1) should the packet use? The only relevant bits I've found are DTS in the BDSTAT byte of the Buffer Descriptor, but it says very clearly that those bits are ignored when DTSEN = 0, and besides what sense does this make for an IN endpoint? It doesn't have to check the bit, it has to set it.

Code: ("DTSEN bit description")
Data toggle synchronization is enabled; data packets with incorrect Sync value will be ignored except for a SETUP transaction, which is accepted even if the data toggle bits do not match.
Code: ("DTS bit description (note)")
This bit is ignored unless DTSEN = 1.

So, it'd be great if someone who knows can answer this, otherwise I'll try and when I (hopefully) eventually find out I'll update this post with the answer.

Oh by the way, what I'm trying to accomplish is to recreate part of the control dashboard for an aircraft, switches that control subsystem state, operation mode, etc. Also rotary inputs for dials, trim wheels, etc. So it'll be a USB HID-class "joystick" device with a bunch of axis, a bunch of on-off button inputs and that's about it Smiley If you're curious, you can find general info http://forums.eagle.ru/forumdisplay.php?f=101
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC