Skip to content

Commit e27638b

Browse files
committed
Merge branch 'release/0.21.0-RC1'
2 parents 80bd588 + 8f139f4 commit e27638b

File tree

4 files changed

+13
-83
lines changed

4 files changed

+13
-83
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Bluejay aims to be an open source successor to BLHeli_S adding several improveme
1616
- Digital signal protocol: DShot 300 and 600
1717
- Bidirectional DShot: RPM telemetry and [extended DSHOT telemetry](https://github.com/bird-sanctuary/extended-dshot-telemetry)
1818
- Selectable PWM frequency: 24, 48 and 96 kHz
19-
- PWM dithering: 11-bit effective throttle resolution
2019
- Power configuration: Startup power and RPM protection
2120
- High performance: Low commutation interference
2221
- Smoother throttle to PWM conversion

src/Bluejay.asm

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,10 @@ DEFAULT_PGM_POWER_RATING EQU 2 ; 1=1S,2=2S+
167167
DEFAULT_PGM_BRAKE_ON_STOP EQU 0 ; 1=Enabled 0=Disabled
168168
DEFAULT_PGM_LED_CONTROL EQU 0 ; Byte for LED control. 2 bits per LED,0=Off,1=On
169169

170-
DEFAULT_PGM_STARTUP_POWER_MIN EQU 51 ; 0..255 => (1000..1125 Throttle): value * (1000 / 2047) + 1000
170+
DEFAULT_PGM_STARTUP_POWER_MIN EQU 21 ; 0..255 => (1000..1125 Throttle): value * (1000 / 2047) + 1000
171171
DEFAULT_PGM_STARTUP_BEEP EQU 1 ; 0=Short beep,1=Melody
172-
DEFAULT_PGM_DITHERING EQU 0 ; 0=Disabled,1=Enabled
173172

174-
DEFAULT_PGM_STARTUP_POWER_MAX EQU 25 ; 0..255 => (1000..2000 Throttle): Maximum startup power
173+
DEFAULT_PGM_STARTUP_POWER_MAX EQU 5 ; 0..255 => (1000..2000 Throttle): Maximum startup power
175174
DEFAULT_PGM_BRAKING_STRENGTH EQU 255 ; 0..255 => 0..100 % Braking
176175

177176
DEFAULT_PGM_SAFETY_ARM EQU 0 ; EDT safety arm is disabled by default
@@ -225,9 +224,8 @@ Flags2: DS 1 ; State flags. NOT reset upon motor_star
225224

226225
Flags3: DS 1 ; State flags. NOT reset upon motor_start
227226
Flag_Telemetry_Pending BIT Flags3.0 ; DShot telemetry data packet is ready to be sent
228-
Flag_Dithering BIT Flags3.1 ; PWM dithering enabled
229-
Flag_Had_Signal BIT Flags3.2 ; Used to detect reset after having had a valid signal
230-
Flag_User_Reverse_Requested BIT Flags3.3 ; It is set when user request to reverse motors in turtle mode
227+
Flag_Had_Signal BIT Flags3.1 ; Used to detect reset after having had a valid signal
228+
Flag_User_Reverse_Requested BIT Flags3.2 ; It is set when user request to reverse motors in turtle mode
231229

232230

233231
Tlm_Data_L: DS 1 ; DShot telemetry data (lo byte)
@@ -302,7 +300,7 @@ ISEG AT 080h ; The variables below must be in this se
302300
_Pgm_Gov_P_Gain: DS 1 ;
303301
Pgm_Startup_Power_Min: DS 1 ; Minimum power during startup phase
304302
Pgm_Startup_Beep: DS 1 ; Startup beep melody on/off
305-
Pgm_Dithering: DS 1 ; Enable PWM dithering
303+
_Pgm_Dithering: DS 1 ; Enable PWM dithering
306304
Pgm_Startup_Power_Max: DS 1 ; Maximum power (limit) during startup (and starting initial run phase)
307305
_Pgm_Rampup_Slope: DS 1 ;
308306
Pgm_Rpm_Power_Slope: DS 1 ; Low RPM power protection slope (factor)
@@ -343,9 +341,6 @@ Pgm_Safety_Arm: DS 1 ; Various flag settings: bit 0 is requir
343341
ISEG AT 0B0h
344342
Stack: DS 16 ; Reserved stack space
345343

346-
ISEG AT 0C0h
347-
Dithering_Patterns: DS 16 ; Bit patterns for pwm dithering
348-
349344
ISEG AT 0D0h
350345
Temp_Storage: DS 48 ; Temporary storage (internal memory)
351346

@@ -355,8 +350,8 @@ Temp_Storage: DS 48 ; Temporary storage (internal memory)
355350
;**** **** **** **** **** **** **** **** **** **** **** **** ****
356351
CSEG AT CSEG_EEPROM
357352
EEPROM_FW_MAIN_REVISION EQU 0 ; Main revision of the firmware
358-
EEPROM_FW_SUB_REVISION EQU 20 ; Sub revision of the firmware
359-
EEPROM_LAYOUT_REVISION EQU 207 ; Revision of the EEPROM layout
353+
EEPROM_FW_SUB_REVISION EQU 21 ; Sub revision of the firmware
354+
EEPROM_LAYOUT_REVISION EQU 208 ; Revision of the EEPROM layout
360355
EEPROM_B2_PARAMETERS_COUNT EQU 28 ; Number of parameters
361356

362357
Eep_FW_Main_Revision: DB EEPROM_FW_MAIN_REVISION ; EEPROM firmware main revision number
@@ -365,7 +360,7 @@ Eep_Layout_Revision: DB EEPROM_LAYOUT_REVISION ; EEPROM layout revision number
365360
_Eep_Pgm_Gov_P_Gain: DB 0FFh
366361
Eep_Pgm_Startup_Power_Min: DB DEFAULT_PGM_STARTUP_POWER_MIN
367362
Eep_Pgm_Startup_Beep: DB DEFAULT_PGM_STARTUP_BEEP
368-
Eep_Pgm_Dithering: DB DEFAULT_PGM_DITHERING
363+
_Eep_Pgm_Dithering: DB 0FFh
369364
Eep_Pgm_Startup_Power_Max: DB DEFAULT_PGM_STARTUP_POWER_MAX
370365
_Eep_Pgm_Rampup_Slope: DB 0FFh
371366
Eep_Pgm_Rpm_Power_Slope: DB DEFAULT_PGM_RPM_POWER_SLOPE ; EEPROM copy of programmed rpm power slope (formerly startup power)
@@ -406,7 +401,7 @@ Eep_Pgm_Safety_Arm: DB DEFAULT_PGM_SAFETY_ARM ; Various flag settings: bit 0 is
406401

407402
Eep_Dummy: DB 0FFh ; EEPROM address for safety reason
408403
CSEG AT CSEG_NAME
409-
Eep_Name: DB "Bluejay (.1 RC2)" ; Name tag (16 Bytes)
404+
Eep_Name: DB "Bluejay (.0 RC1)" ; Name tag (16 Bytes)
410405

411406
CSEG AT CSEG_MELODY
412407
Eep_Pgm_Beep_Melody: DB 2,58,4,32,52,66,13,0,69,45,13,0,52,66,13,0,78,39,211,0,69,45,208,25,52,25,0
@@ -1046,7 +1041,6 @@ exit_run_mode:
10461041
call switch_power_off
10471042
mov Flags0, #0 ; Clear run time flags (in case they are used in interrupts)
10481043
mov Flags1, #0
1049-
clr Flag_Ext_Tele ; Clear extended DSHOT telemetry flag
10501044

10511045
IF MCU_TYPE == MCU_BB2 or MCU_TYPE == MCU_BB51
10521046
Set_MCU_Clk_24MHz

src/Modules/Isrs.asm

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -414,36 +414,6 @@ ELSEIF PWM_BITS_H == PWM_8_BIT
414414
mov Temp3, #0
415415
ENDIF
416416

417-
; 11-bit effective dithering of 8/9/10-bit pwm
418-
IF PWM_BITS_H == PWM_8_BIT or PWM_BITS_H == PWM_9_BIT or PWM_BITS_H == PWM_10_BIT
419-
jnb Flag_Dithering, t1_int_set_pwm
420-
421-
mov A, Temp4 ; 11-bit low byte
422-
cpl A
423-
anl A, #((1 SHL (3 - PWM_BITS_H)) - 1); Get index into dithering pattern table
424-
425-
add A, #Dithering_Patterns
426-
mov Temp1, A ; Reuse DShot pwm pointer since it is not currently in use.
427-
mov A, @Temp1 ; Retrieve pattern
428-
rl A ; Rotate pattern
429-
mov @Temp1, A ; Store pattern
430-
431-
jnb ACC.0, t1_int_set_pwm ; Increment if bit is set
432-
433-
mov A, Temp2
434-
add A, #1
435-
mov Temp2, A
436-
jnz t1_int_set_pwm
437-
IF PWM_BITS_H != PWM_8_BIT
438-
mov A, Temp3
439-
addc A, #0
440-
mov Temp3, A
441-
jnb ACC.PWM_BITS_H, t1_int_set_pwm
442-
dec Temp3 ; Reset on overflow
443-
ENDIF
444-
dec Temp2
445-
ENDIF
446-
447417
t1_int_set_pwm:
448418
; Set PWM registers
449419
IF DEADTIME != 0

src/Modules/Settings.asm

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ set_default_parameters:
3333
mov @Temp1, #0FFh ; _Pgm_Gov_P_Gain
3434
imov Temp1, #DEFAULT_PGM_STARTUP_POWER_MIN ; Pgm_Startup_Power_Min
3535
imov Temp1, #DEFAULT_PGM_STARTUP_BEEP ; Pgm_Startup_Beep
36-
imov Temp1, #DEFAULT_PGM_DITHERING ; Pgm_Dithering
36+
imov Temp1, #0FFh ; _Pgm_Dithering
3737
imov Temp1, #DEFAULT_PGM_STARTUP_POWER_MAX ; Pgm_Startup_Power_Max
3838
imov Temp1, #0FFh ; _Pgm_Rampup_Slope
3939
imov Temp1, #DEFAULT_PGM_RPM_POWER_SLOPE ; Pgm_Rpm_Power_Slope
@@ -199,42 +199,9 @@ ELSEIF PWM_BITS_H == PWM_8_BIT
199199
mov Pwm_Braking_H, #0
200200
mov Pwm_Braking_L, A
201201
ENDIF
202-
cjne @Temp1, #0FFh, decode_pwm_dithering
202+
cjne @Temp1, #0FFh, decode_end
203203
mov Pwm_Braking_L, #0FFh ; Apply full braking if setting is max
204204

205-
;**** **** **** **** **** **** **** **** **** **** **** **** ****
206-
;
207-
; Dithering
208-
;
209-
; Depending on resolution, different dithering patterns are available.
210-
;
211-
;**** **** **** **** **** **** **** **** **** **** **** **** ****
212-
213-
decode_pwm_dithering:
214-
mov Temp1, #Pgm_Dithering ; Read programmed dithering setting
215-
mov A, @Temp1
216-
add A, #0FFh ; Carry set if A is not zero
217-
mov Flag_Dithering, C ; Set dithering enabled
218-
219-
IF PWM_BITS_H == PWM_10_BIT ; Initialize pwm dithering bit patterns
220-
mov Temp1, #Dithering_Patterns ; 1-bit dithering (10-bit to 11-bit)
221-
mov @Temp1, #00h ; 00000000
222-
imov Temp1, #55h ; 01010101
223-
ELSEIF PWM_BITS_H == PWM_9_BIT
224-
mov Temp1, #Dithering_Patterns ; 2-bit dithering (9-bit to 11-bit)
225-
mov @Temp1, #00h ; 00000000
226-
imov Temp1, #11h ; 00010001
227-
imov Temp1, #55h ; 01010101
228-
imov Temp1, #77h ; 01110111
229-
ELSEIF PWM_BITS_H == PWM_8_BIT
230-
mov Temp1, #Dithering_Patterns ; 3-bit dithering (8-bit to 11-bit)
231-
mov @Temp1, #00h ; 00000000
232-
imov Temp1, #01h ; 00000001
233-
imov Temp1, #11h ; 00010001
234-
imov Temp1, #25h ; 00100101
235-
imov Temp1, #55h ; 01010101
236-
imov Temp1, #5Bh ; 01011011
237-
imov Temp1, #77h ; 01110111
238-
imov Temp1, #7fh ; 01111111
239-
ENDIF
205+
decode_end:
206+
; Return
240207
ret

0 commit comments

Comments
 (0)