Question à propos du 8M2

Gerda

New Member
Bonjour,

J'ai un petit programme qui fonctionne très bien avec un 8M2 grâce à votre concours (PieM). 4 sorties sont mobilisées. Il me reste C3 comme entrée qui me permet d'arrêter le programme en numérique. Je voudrais utiliser cette cette entrée en analogique, est-ce possible?

merci
 

Aries

New Member
Je pense que la réponse simple est "non". C3 est une entrée uniquement et est donc purement numérique. Si vous pouvez échanger une autre entrée numérique (C1, C2, C4) en C3, vous pouvez alors l'utiliser comme entrée analogique. (Traduit par google)
 

AllyCat

Senior Member
Good morning,

I have a small program that works very well with an 8M2 thanks to your help (PieM). 4 exits are mobilized. I still have C3 as an input which allows me to stop the program digitally. I would like to use this analog input, is this possible?

THANKS
-----
#2

I think the simple answer is "no". C3 is input only and is therefore purely digital. If you can swap another digital input (C1, C2, C4) to C3, then you can use it as an analog input. (Translated by Google)
------
#3
Hi,

Indeed, pin C.3 connects internally to only a hardware digital input.

If you REALLY need 4 analogue inputs, it might be possible to use pin C.0 as an ADC input. Beware that this pin always starts as an OUTPUT, but the program can switch it to be an input and then use the READDAC command.

Cheers, Alan.
Google Translate:
Salut,

En effet, la broche C.3 se connecte en interne uniquement à une entrée numérique matérielle.

Si vous avez VRAIMENT besoin de 4 entrées analogiques, il peut être possible d'utiliser la broche C.0 comme entrée ADC. Attention, cette broche commence toujours comme une SORTIE, mais le programme peut la changer en entrée puis utiliser la commande READDAC.

Bravo, Alan.
 

Gerda

New Member
Je pense que la réponse simple est "non". C3 est une entrée uniquement et est donc purement numérique. Si vous pouvez échanger une autre entrée numérique (C1, C2, C4) en C3, vous pouvez alors l'utiliser comme entrée analogique. (Traduit par google)

merci !
 

erco

Senior Member
You may be able to use C.3 as a simple high/low output, freeing up another pin with ADC capability. Others here have posted mosfet circuits switched on by the software-selectable "weak pullup resistors" built into the Picaxe. If that's an option for you, let us know and we can point to that post.
 

inglewoodpete

Senior Member
You may be able to use C.3 as a simple high/low output, freeing up another pin with ADC capability. Others here have posted mosfet circuits switched on by the software-selectable "weak pullup resistors" built into the Picaxe. If that's an option for you, let us know and we can point to that post.
While it is feasible to use the pullup command to utilise the 08M's C.3 pin as an output, it takes several additional components to function that way. Using a 14M2 would actually reduce the pin count (when taking the MOSFET and resistor legs into account) and probably the PCB space required.
 

AllyCat

Senior Member
Hi,

Pin C.3 can directly drive a LED (not very brightly), or a digital input (MOS), or a 2N7000 FET, etc. using only a high value Pull-down resistance (100k+). Also, C.5 can be used as a Digital Input (no ADC connected inside) by using the DISCONNECT feature. The other 4 signal pins do have ADC Input capability, but C.2 in particular and C.1 have other specific functions (PWM Output, I2C bus, etc.).

C.0 can be particularly useful to measure Analogue Currents, either of external circuits or the PICaxe itself : Connect a resistor of about 1 ohm (or more) to carry the current to Ground and a resistor of about 10k from its other end to pin C.0. Optionally, Shunt diode(s), perhaps Schottky, across the 1 ohm can limit the voltage swing and/or give a "Logarithmic" characteristic. This doesn't affect the Serial Data / Programming Output capability, but the Program can switch to the "DAC" mode and measure the input voltage with the READDAC10 command (using FVR_2048 or FVR_1024 as the Reference can increase the sensitivity). THE DAC has a very high output resistance (about 40k with DACLEVEL 16) which can bias the pin upwards a little, to support also a Negative direction of current flow (i.e. away from Ground).

Cheers, Alan.
Salut,

La broche C.3 peut piloter directement une LED (pas très brillante), ou une entrée numérique (MOS), ou un FET 2N7000, etc. en utilisant uniquement une résistance Pull-down de haute valeur (100k+). C.5 peut également être utilisé comme entrée numérique (aucun ADC connecté à l'intérieur) en utilisant la fonction DISCONNECT. Les 4 autres broches de signal ont une capacité d'entrée ADC, mais C.2 en particulier et C.1 ont d'autres fonctions dédiées (sortie PWM, bus I2C, etc.).

C.0 peut être particulièrement utile pour mesurer les courants analogiques, soit de circuits externes, soit du PICaxe lui-même : connectez une résistance d'environ 1 ohm (ou plus) pour transporter le courant à la terre et environ une résistance de 10k de son autre extrémité à la broche C. .0. Une ou plusieurs diodes shunt, peut-être Schottky, aux bornes de 1 ohm peuvent limiter l'oscillation de tension et/ou donner une caractéristique « logarithmique ». Cela n'affecte pas la capacité de sortie de données série/programmation, mais le programme peut passer en mode "DAC" et mesurer la tension d'entrée avec la commande READDAC10 (en utilisant FVR_2048 ou FVR_1024 comme référence peut augmenter la sensibilité). LE DAC a une résistance de sortie très élevée (environ 40k avec DACLEVEL 16) qui peut polariser un peu la broche vers le haut, pour supporter également une direction négative du flux de courant (c'est-à-dire loin de la terre).

Bravo, Alan.
 
Top