קורס אמבדד – 005 – RB18

קורס אמבדד – 005 – RB18

 

 

 

MOTOR DRIVER 

 

תכנון מעגל משלוב חומרה ותוכנה -מתנתקים ממיגבלות המעבד \ משדר של כמות IO

(PWM /  I/O /  SPI / I2C /I2S/  UART )  I/O Expanders

 

PCF8575 Interface – I/O Expanders Remote 16-Bit I2C & SMBus I/O Expander

 

PCAL6524HEAZ

 

UART EXPENDER

 

TIMER

 

 

esp32 80Mhz ==> 8,000,000Hz

TICK :

T.S (HZ) , prescaler=1 ==> 80mhz /1 = 80Mhz

T.S (HZ) , prescaler=80==> 80mhz /80 = 1Mhz

 

https://wokwi.com/projects/350706177868300882

 

הוספת ספרייה לארדואינו \ ESP32

 

https://github.com/RoboticsBrno/ServoESP32

 

SUMMERY

    // Set the bit
    num = num | (1 << bit);    // num |= (1<< bit)
// Check the bit
  (  num & (1 << bit) ) >0
    // Clear the bit
    num = num & ~(1 << bit);    // num &= ~(1<< bit)
    // Toggle the bit or Invert the bit
    num = num ^ (1 << bit);    // num ^= ~(1<< bit)

 

BITWISE OPERATORS

 

 

bitwise –  mask

נבדוק את ביט מספר 3

תוצאה גדולה מ 0 

——————————————————————————————————————————————

נבדוק את BIT מספר 7

תוצאה 0


 

BIT WIZE SET BIT

מטרה – להציב ערך של ביט אחד או יותר  בלי לשנות את שאר הביטים

Clearing Bits

 

 

FLIP BIT / TOGGLING

1^1==>0

0^1==>1

 

FLIP ALL BITS

 

 

 

תרגיל כיתה :

Build a program in emended c that control DJ  leds with string commando from rs232  / Bluetooth

https://wokwi.com/projects/350701464616698450

the program get 8 chars string s ,  like s=”0100-1010″  in this format

1. SET  S , EXMAPLE SET 0000-1000

2. CLEAR S , CLEAR 3 WILL CLEAR BIT 3

3 RAND , SET  all 8 leds in random value 1 or 0 ,Example  RAND

4 CLEAR  BIT , example  CLEAR 5 , will clear bit 5 .

5 T  BIT , toggle bit number BIT , T 4

6. BLINK will  blink all bit in 500 ms

7 shift N will shift all bits in N BITS

8 LEFT N will shift  shift all bit in N BITS

all input can be lower , upper or both letters .

 

 

 

 

 

 

 

brushless drones motors 

 

Spikes Motor driver

 

כתיבת תגובה