Bonjour à tous ! Je me suis lancé dans un projet en apparence très simple qui consiste à afficher la température d'un objet à l'aide d'un capteur infra-rouge MLX90614 et la restituer sur un écran TM1637, le tout contrôlé par un Attiny85. L'attiny85 ne pouvant pas utiliser la librairie <Wire.h>, j'ai ajouté la librairie <TinyWireM.h>. J'ai donc testé d'afficher des nombres sur mon écran, ce qui marchais très bien mais quand j'ai rajouté le code pour le capteur de température sa ne marche plus.
Merci pour votre réponse ! Je vient d'essayer et le résultat....est le même
Celas dit lors de mon choix d'attiny je ne savais pas vraiment quoi choisir entre "no bootloader", "Optiboot" et "Micronucleus/DigiSpark". J'ai donc pris "no bootloader", ce qui me semblais le plus simple.
Effectivement, mais si j'aimerais utiliser un Attiny c'est parce que sa me semble plus adapté pour ce projet étant donné que je n'est besoin que de 4 entrées/sorties.
No bootloader is the recommended option (you do still need to do "burn bootloader" to set the clock speed to what you selected - clock source is controlled by the "fusebytes" which are only written when you "burn bootloader" not on upload)
Micronucleus is used for the boards that have a USB port for direct upload, usually sold as "Digispark" (they are all chinese copies now). It uses VUSB (bitbang USB) to upload without an external programmer, but takes about 1/4th of the flash. VUSB doesn't work on all USB ports, but if it works at all, it is reliable.
Optiboot is only there for people who very much want to upload with a serial adapter. It takes about 8% of the flash. It works with any serial adapter, but is not 100% reliable, a power glitch or reset at the wrong time will break it. (I was going to say more, but it wouldn't survive google translate, and most people wouldn't understand it regardless of what language i wrote it in anyway!)
Re: t85 in general, a nano or pro mini is a little bit larger than an ATtiny85 >.> and all the Arduino boards have stuff like the power LED and regulator on board that waste power and are unsuitable for battery-operated projects. Besides, it's more fun to use a smaller processor. Throwing a nano at everything is boring!
you do still need to do "burn bootloader" to set the clock speed to what you selected - clock source is controlled by the "fusebytes" which are only written when you "burn bootloader" not on upload
i never did this ... i will try, maybe by default the clock is set as external (which would be a problem because i want to use the internal clock!)?
Ok
je n'utilise pas ce systeme
(perso j'utilise avrude et avrdudess avec un usbasp)
comme tu ne touche pas aux fusibles
et si tes attiny sont neufs ils fonctionnent en horloge interne 1MHz
quelle valeur d'horloge a tu sélectionné dans ton gestionnaire de carte ?
il me semble que lorsqu'on utilise un programmateur externe, les fusibles sont programmés selon les options choisis tel qu'on voit sur la photo précédente.
Par contre, Si les attiny85 sont déjà dans les tiroirs, pourquoi pas.
Mais s'il faut acheter, il y a les nouveaux attinyx02 en 8 broches ou x14 en 14 broches utilisant l'interface de programmation UPDI.
Actuellement je joue avec ça associé aux portages de spenceKonde et c'est excellent.
Vu que j' ai des attiny8x à la pelle , je n'ai pas regardé ce qui ce faisait en x02, il, faudra que je songe à y regarder de plus prés (idem pour UPDI)
What ever you use to upload your sketch to to a non-bootloader board, can also be used to write the fuses (burn bootloader). Default new-from-factory clock for all classic AVRs is 1 MHz internal (so sketches compiled for 8 MHz run at 1/8th the expected speed)
it's a separate option to prevent surprising and accidental bricking of boards from accidentally setting a fuse wrong when you don't intend to because that can brick the part (to "brick" a part means that it won't do anything more than a brick until a more complicated procedure is used to unbrick it)
Setting fuses for a a clock source that isn't present (external clock w/out external clock, or crystal without crystal or external clock) will brick the board (until you supply a suitable external clock signal), as will enabling brownout detection 4.3V on a 3.3v board or similar (unless it can be safely connected to 5v to reprogram, or disabling reset or ISP programming (ATTinyCore will never disable reset on non-bootloader board, and will never ever disable isp programming - I don't present that option and fixing either of those is a Big Deal). Since the wrong fuses can have such consequences, we don't ever want to set fuses if the user isn't expecting it. So ATTinyCore only sets fuses when doing "burn bootloader", so you will have to see the options selected (and hopefully will read them) before setting the fuses.
I don't think any classic AVRs like those supported by ATTinyCore have "safe fuses". Modern AVRs (megaTinyCore and DxCore) have several fuses that can't possibly brick the chip, and on those, I have it set the "safe" fuses on normal uploads to non-bootloader boards.