Skocz do zawartości

Przeszukaj forum

Pokazywanie wyników dla tagów 'Attiny13'.

  • Szukaj wg tagów

    Wpisz tagi, oddzielając przecinkami.
  • Szukaj wg autora

Typ zawartości


Kategorie forum

  • Elektronika i programowanie
    • Elektronika
    • Arduino i ESP
    • Mikrokontrolery
    • Raspberry Pi
    • Inne komputery jednopłytkowe
    • Układy programowalne
    • Programowanie
    • Zasilanie
  • Artykuły, projekty, DIY
    • Artykuły redakcji (blog)
    • Artykuły użytkowników
    • Projekty - DIY
    • Projekty - DIY roboty
    • Projekty - DIY (mini)
    • Projekty - DIY (początkujący)
    • Projekty - DIY w budowie (worklogi)
    • Wiadomości
  • Pozostałe
    • Oprogramowanie CAD
    • Druk 3D
    • Napędy
    • Mechanika
    • Zawody/Konkursy/Wydarzenia
    • Sprzedam/Kupię/Zamienię/Praca
    • Inne
  • Ogólne
    • Ogłoszenia organizacyjne
    • Dyskusje o FORBOT.pl
    • Na luzie

Kategorie

  • Quizy o elektronice
  • Quizy do kursu elektroniki I
  • Quizy do kursu elektroniki II
  • Quizy do kursów Arduino
  • Quizy do kursu STM32L4
  • Quizy do pozostałych kursów

Szukaj wyników w...

Znajdź wyniki, które zawierają...


Data utworzenia

  • Rozpocznij

    Koniec


Ostatnia aktualizacja

  • Rozpocznij

    Koniec


Filtruj po ilości...

Data dołączenia

  • Rozpocznij

    Koniec


Grupa


Imię


Strona

Znaleziono 2 wyniki

  1. Witam. Pierwszy raz programuje procesor AVR przy pomocy Arduino. Wszystko ustawione zgodnie z TYM tematem. Kod niezwykle prosty jak budowa cepa, bo to włącznik modelarski. Jedynie sprawdza czas trwania impulsu i na tej podstawie ustawia stany na wyjściach. Mikrokontroler to Attiny13. Pierwszy próg do którego oba wyjścia są wyłączone to 1100ms. Od tego progu wyjście "0" jest stanem wysokim a "1" jest wyłączone. Kolejny to 1700ms. Po jego przekroczeniu następuje zmiana i "0" jest stanem niskim a wyjście "1" stanem wysokim. Maksymalny czas trwania impulsu to 2500ms( takie czasy z odbiornika modelarskiego sprawdziłem). I tu koniec teorii. Podczas testów okazuję się, że czasy się rozjeżdżają. Pierwszy stopień wchodzi przy 980ms a drugi przy 1500 zamiast przy 1700ms. Niby się da to dostroić ale po co? Podczas wgrywania "bootloadera" do attiny13 kwarc ustawiony na 1,2MHz tak samo jak podczas programowania. Ktoś ma jakieś pomysły dlaczego tak się dzieje? Opis kodu "ODBIORNIK TURNIGY" to czasy impulsu w ms jakie nadaje nadajnik przy różnych ustawieniach drążka sterującego. /*******ODBIORNIK TURNIGY******************** //Wyłączony- 1985 //Pozycja środek- 1485 //Pozycja 2- 978 ********************************************/ /*************PROGRAMOWANIE****************** ATtiny13A leg 1 (reset) -> Arduino 10 ATtiny13A leg 5 (PB0 MOSI)-> Arduino 11 ATtiny13A leg 6 (PB1 MISO) -> Arduino 12 ATtiny13A leg 7 (PB2 SCK) -> Arduino 13 ATtiny13A leg 8 -> 5v ATtiny13A leg 4 -> Ground (GND) ********************************************/ //PB_2 -> ADC_1 noga 7 //PB_1 -> noga 6, tranzystor 1 //PB_0 -> noga 5, tranzystor 2 unsigned long liczba; //int signal = 0; void setup() { pinMode(2 , INPUT); //Wejscie sygnalu pinMode(1 , OUTPUT); // wyjscie na tranzystor 1 pinMode(0 , OUTPUT); // wyjscie na tranzystor 2 } void loop() { liczba = pulseIn(2 , HIGH, 25000); if (liczba > 1100) { if (liczba > 1700) { digitalWrite(1 , HIGH); digitalWrite(0 , LOW); } else { digitalWrite(1 , LOW); digitalWrite(0 , HIGH); } } else { digitalWrite(1 , LOW); digitalWrite(0 , LOW); } }
  2. Witam. Jestem początkującym użytkownikiem mikrokontrolerów i staram sie ogarnąć programowanie w BASCOM. Napisałem coś takiego bardzo prostego i w sumie spełniałoby to założenie ale mam pytanie czy można w jednym czasie uaktywnić dwa porty w tym przypadku PORTB.3 i PORTB.4. Oba porty musiałyby byś aktywne przez inny okres czasu /np. P3 - 1sek, P4 - 3sek/. Kolejne pytanie to czy można zdefiniować taką funkcje jeżeli na PORTB.0 pojawia sie napięcie to wykonywana jest jakaś funkcja np. podanie prądu na PORTB.3. Byłbym wdzięczny za podpowiedź ewentualnie podanie sposobu rozwiązania. Wiem ze całość napisana jest mało kulturalnie i zajmuje prawie całą pamięć kontrolera ale proszę o wyrozumiałość dopiero zaczynam. Pozdrawiam ' Atmel ATtiny13 $regfile = "attiny13.dat" ' 1 MHz internal clock $crystal = 1200000 ' PortB is Output Config Portb = Output $hwstack = 8 $swstack = 8 $framesize = 8 ' Start motor Do Portb.3 = 1 'lights Waitms 10 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 5 Portb.0 = 0 Waitms 800 Portb.3 = 1 'lights Waitms 8 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 5 Portb.0 = 0 Waitms 900 Portb.3 = 1 'lights Waitms 8 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 10 Portb.0 = 0 Waitms 700 Portb.3 = 1 'lights Waitms 10 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 7 Portb.0 = 0 Waitms 700 Portb.3 = 1 'lights Waitms 8 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 8 Portb.0 = 0 Waitms 500 Portb.3 = 1 'lights Waitms 9 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 10 Portb.0 = 0 Waitms 700 Portb.3 = 1 'lights Waitms 7 Portb.3 = 0 'lights Waitms 1 Portb.0 = 1 Waitms 9 Portb.0 = 0 Waitms 600 Portb.3 = 1 'lights Waitms 7 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 15 Portb.0 = 0 Waitms 700 Portb.3 = 1 'lights Waitms 5 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 15 Portb.0 = 0 Waitms 500 Portb.3 = 1 'lights Waitms 8 Portb.3 = 0 'lights Waitms 1 Portb.0 = 1 Waitms 20 Portb.0 = 0 Waitms 500 Portb.3 = 1 'lights Waitms 10 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 24 Portb.0 = 0 Waitms 400 Portb.3 = 1 'lights Waitms 6 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 30 Portb.0 = 0 Waitms 400 Portb.3 = 1 'lights Waitms 10 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 5 Portb.0 = 0 Waitms 700 Portb.3 = 1 'lights Waitms 11 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 5 Portb.0 = 0 Waitms 400 Portb.3 = 1 'lights Waitms 11 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 24 Portb.0 = 0 Waitms 400 Portb.3 = 1 'lights Waitms 11 Portb.3 = 0 'lights Waitms 1 Portb.4 = 1 'lights4 Waitms 10 Portb.4 = 0 'lights4 Waitms 1 Portb.0 = 1 Waitms 50 Portb.0 = 0 Waitms 300 Portb.0 = 1 Waitms 90 Portb.0 = 0 Waitms 300 Portb.0 = 1 Waitms 120 Portb.0 = 0 Waitms 200 Portb.0 = 1 Waitms 500 Portb.0 = 0 Waitms 100 Portb.0 = 1 Waitms 400 Portb.0 = 0 Waitms 90 Portb.0 = 1 Waitms 800 Portb.0 = 0 Waitms 60 Portb.0 = 1 Waitms 1000 Portb.0 = 0 Waitms 400 Loop
×
×
  • Utwórz nowe...

Ważne informacje

Ta strona używa ciasteczek (cookies), dzięki którym może działać lepiej. Więcej na ten temat znajdziesz w Polityce Prywatności.