JeanneD4RK:
Last problem was programmatic problem, I solved it (bad cleaning on char[] made 1024 keep the 24 and when I requested 50 it applied 5024)
I'm wondering why your using an array of chars. Why not an array of ints? A char only holds 8 bits, with a range from 127 to -128. An int is a 16-bit variable, with a range of 32767 to -32768, thus it will accomodate values up to 1023, and beyond.
BTW: for purity sake, a char
data type should only used for "character literals", like 'A' or '3'. Better to use byte
for 8-bit numbers.
JeanneD4RK:
Therefore I should look for something where Vgs is lower which will then reach max current with lower voltage on gate, right ?
Sort of. Ultimately you want to look at the datasheet, and find a MOSFET whose gate resistance is low enough at the Gate Voltage you will be driving it with. It all depends on how low you want the Drain to Source saturation voltage to be and/or how much you want to minimize power dissipation in the MOSFET.
So, if you want 830mA, when the MOSFET is saturated, and a voltage drop below, say, 50mV [which will be a power dissipation of 50mV * 830mA = 41.5mW
(plenty low!)], then you want a MOSFET with a saturation resistance of:
50mV/830mA = 60mΩ
So, look for a MOSFET with 60mΩ channel resistance (or below), when the Gate Voltage is at 3.3V
AND, I would double the current, to mitigate variation among devices and other variations. For instance: set the target current at 1.7A, then, check the power dissipation:
50mV * 1.7A = 85mW
-- still plenty low
Then get a target channel resistance:
50mV/1.7A = [b]29mΩ[/b]
But, looking for a MOSFET can be daunting, because there are SO MANY!! Especially when trying to find one for 3.3V logic, since there isn't any distinguishing terminology for that, like there is for 5V logic [e.g. the "Logic Level" designation--which generally applies to 5V logic]. But I start by getting a ballpark "bracketing", then digging into the datasheets and looking at graphs, since they are a more reliable indication of device functionality.
I use the parametric search on the Mouser website, but DigiKey also has such a search feature. Or, you can pick a manufacturer, go to it's website, and often find a device selection tool.
But, it's a complicated, somewhat frustrating process, that I'm still figuring out. Complicated because the values listed in the parametric search are not always comparable. You can look for a particular RDS(on) but, some of the values are for a Gate Voltage of 10V, some for 5V, some for 4.5V, etc. -- so, all you're getting is a vague ballpark. You can try setting the Gate Threshold voltage first, and rely on the "Smart Filtering" to remove the values that are outside the range you select. But, the Gate Thresh values you select, could be anything from Typical values, or Maximum values, or a range, or something else! Plus, there are errors in their database [clearly non-electronics educated people did the data entry, because there will be things like negative threshold voltages, when N-Channel is selected, and other such oddities. Also, I've seen things like 10A, in the list of parameters of a particular part, when it should be 10mA, and stuff like that--but it's fairly rare -- though, I've been seeing less of this these days.