View Single Post
  #3   Spotlight this post!  
Unread 12-03-2015, 09:06
ayeckley's Avatar
ayeckley ayeckley is offline
Registered User
AKA: Alex Yeckley
FRC #2252 (Mavericks)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Sandusky, OH
Posts: 268
ayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond repute
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Quote:
Originally Posted by KMBruggeman View Post
P1IES enables interupt edge select
Not exactly. It just specifies whether the interrupt occurs on the rising edge or the falling edge of the signal.

Quote:
It appears that we are limited to just P1 and P2,e.g. we could add a second encoder with P2IE and P2IES?
Yes, or you could just use some of the other inputs from Port 1; there's no reason that a second encoder would have to go on Port 2 if there are still bits available on Port 1.

Quote:
Additionally, to map that to a button 2.2 and 2.7 we could reference bits 2 & 7 respectively?
Right. Or 1.2 and 1.7, or 1.2 and 1.3, and so forth. You have complete freedom to use whatever two inputs you like. The only reason we used the inputs that we did was because they were a) available and b) in close proximity to each other on the connector.

Quote:
To output it then could I use the other 16 BITS for the buttons out?
Assuming that they haven't been assigned for other purposes, yes. There is nothing saying that you need to use 16 bits either. If 8 bits is enough for your application then I'd try to conserve that resource. Heck, use 7 or 9 if it suits you. There's nothing saying it has to be on 8-bit boundaries (as long as you handle it accordingly in software).

Quote:
Finally, is there the ability to pass additional encoder counts so long as we did not exceed the current draw of the launchpad? For example could I run an interrupt on P3 using 3.2 and 3.6?
Yes and no. The current draw of the photo emitters inside the encoders is the driving issue; the total draw of the encoders needs to be less than the maximum current that the voltage regulators on the Launchpad PCB can provide (unless you add additional circuitry). The currents associated with the phase A and B signals between the encoders and the Launchpad are pretty small; the exact value depends upon the type of encoders and the configuration of the Launchpad inputs but they are typically much smaller than the emitter current.

The "no" part of the answer is that (IIRC) this particular MSP430 does not offer interrupts on Port 3. Other than power limitations, there's no fundamental reason why you couldn't connect four encoders to Port 1 and another four encoders to Port 2.

Quote:
Would I just implement that by passing an integer vs a float for an axis value?
I guess it depends. If you've run out of "bits" in the HID datastream to use for integers then I suppose that would be your only remaining alternative. Personally I'd try hard to free up those bits from other purposes (e.g. unused buttons) rather than using the axis datatypes. That's mostly because I am very reluctant to use floating datatypes when using microcontrollers (probably irrationally now, but once upon a time that was a Big Deal).
__________________


Last edited by ayeckley : 12-03-2015 at 09:06. Reason: Found a typo.
Reply With Quote