PB, request for code review and merge back(2)

More
21 Nov 2012 00:46 #3062 by suvsuv

PhracturedBlue wrote: FYI, there is no circuit for the speaker driver.
It is MCU GPIO->p-fet->piezo speaker


PB, could you also figure out which GPIO pin controls the vibration motor?

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 02:04 - 21 Nov 2012 02:05 #3064 by ej189

suvsuv wrote: PB, could you also figure out which GPIO pin controls the vibration motor?


I think motor control is from PD2.







Attachments:
Last edit: 21 Nov 2012 02:05 by ej189.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 02:30 - 21 Nov 2012 02:31 #3065 by suvsuv

ej189 wrote: I think motor control is from PD2.

Thanks, buddy. You should be right based on existing devo10 connetion info listed below.
I will get the vibration work today

GPIOD:
0-1: LCD Module
2: ??? Push/Pull output default low
Last edit: 21 Nov 2012 02:31 by suvsuv.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 03:31 #3066 by dc59

suvsuv wrote:

ej189 wrote: I think motor control is from PD2.

Thanks, buddy. You should be right based on existing devo10 connetion info listed below.
I will get the vibration work today

GPIOD:
0-1: LCD Module
2: ??? Push/Pull output default low


what a good news it is !
Vibration will work ~~~~~
Thanks!

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 07:47 - 21 Nov 2012 11:09 #3073 by vlad_vy
Replied by vlad_vy on topic PB, request for code review and merge back(2)

PhracturedBlue wrote: Sorry, I should have said duty-cycle, not pulsewidth. All documentation I can find says that max-volume occurs at 50% duty-cycle, and reduces as the duty-cycle is reduced (or increased).


Maybe it will work if add resistor between FET and piezo speaker. Piezo speaker is really a capacitor that charged and discharged by FET and its internal diode.

RC (time constant) = T / 4

R = T / (4 * C)

where:
R - added resistor (Ohm)
C - capacitance of piezo speaker (F)
T - average period of sound impulses (sec)

But it requires the hand work. :(
Last edit: 21 Nov 2012 11:09 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 08:32 #3074 by ej189
I think it's not a piezo but a magnetic buzzer that a piezo needs very high voltage to drive and will be larger than 10mm.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 11:45 #3076 by suvsuv
PB, My yesterday's codes has a bug causing volume control not work。 I got it fixed and verify that volume control is working in my devo10(still need to use ej189's sound.ini to achieve louder volume), please have it verified in your devo8.

The vibrating motor feature is also checked in, it works in my devo10 as well. It seems all features are there in the devo10 now.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 13:45 #3079 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)

suvsuv wrote: PB, My yesterday's codes has a bug causing volume control not work。 I got it fixed and verify that volume control is working in my devo10(still need to use ej189's sound.ini to achieve louder volume), please have it verified in your devo8.

The vibrating motor feature is also checked in, it works in my devo10 as well. It seems all features are there in the devo10 now.

Sounds good. I'll look everything over and try to get it synced up sometime today.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 19:46 #3086 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
So here are some buzzer findings:

The connection is actually:
5V->buzzer->17ohmR->NPN (8505)->GND

I hooked up my scope, and see that the time-constant is around 50us. This is well below the duty-cycle we're currently using, which explains why there is no volume control, but also indicates we're already at maximum volume. So the only way to get additional volume will likely be to get closer to the resonant-frequency.

I'll try to use a pulse-width nearer to the time-constant, and see if I can get any volume control.

Please Log in or Create an account to join the conversation.

More
21 Nov 2012 22:57 - 21 Nov 2012 22:57 #3088 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
Suvsuv,
I think I've merged everything from your tree.
I've removed all the quickpage key-config stuff, so you can sync that stuff from my repo.

I made several changes to how the vibration/music code works, but it all seems to work fine for me on both devo8 and devo10

Volume control now works, but it sounds tinny at low volume. I don't think I can do anything about that.

If you think I missed anything, let me know.
Last edit: 21 Nov 2012 22:57 by PhracturedBlue.

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 05:03 - 22 Nov 2012 07:42 #3092 by vlad_vy
Replied by vlad_vy on topic PB, request for code review and merge back(2)

PhracturedBlue wrote: So here are some buzzer findings:

The connection is actually:
5V->buzzer->17ohmR->NPN (8505)->GND

I hooked up my scope, and see that the time-constant is around 50us. This is well below the duty-cycle we're currently using, which explains why there is no volume control, but also indicates we're already at maximum volume. So the only way to get additional volume will likely be to get closer to the resonant-frequency.


Is it a piezo speaker? At that case the piezo speaker (capacitor) charged by NPN transistor (BJT), but is not discharged by anithing (only by leakage current). No change in voltage = no sound out of the peizo. Maybe adding any resistor (500ohm) at parallel to piezo speaker will increase the volume?

+5V->--buzzer-->17ohmR->NPN (8505)->GND
+5V->-resistor-+

Attachments:
Last edit: 22 Nov 2012 07:42 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 05:28 #3093 by FDR
The code won't compile, we have run out of ROM:
+ Building 'devo8.elf'
c:/mingw/stm32/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/
ld.exe: devo8.elf section `.data' will not fit in region `rom'
c:/mingw/stm32/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/
ld.exe: region `rom' overflowed by 544 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [devo8.elf] Error 1

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 06:35 #3094 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)

FDR wrote: The code won't compile, we have run out of ROM:

+ Building 'devo8.elf'
c:/mingw/stm32/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/
ld.exe: devo8.elf section `.data' will not fit in region `rom'
c:/mingw/stm32/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/
ld.exe: region `rom' overflowed by 544 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [devo8.elf] Error 1

Yeah, it was bound to happen.
Compile with TYPE=prd

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 15:12 #3098 by suvsuv
Some minor update:
1) Fix display bug in chantest_page.c: the main menu won't show characters for non-english language if the channel monitor is set as a quickpage
2) Set the default volume to 10
3) Change timers' hotkeys to R/L , because the timers are easily false triggered or reset with EXT/Up assigned

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 16:12 #3100 by sbstnp

suvsuv wrote: Some minor update:
3) Change timers' hotkeys to R/L , because the timers are easily false triggered or reset with EXT/Up assigned


I think timers should be reset with either:
1. Long-press down
2. Long press EXT

R/L are not good options because we basically can do 2 sets of quickkeys:

1. Long R/L
2. Short R/L - quick use, I would probably restrict these to one page bound to R and one bound to L, with any key reverting to main page.

Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire

Please Log in or Create an account to join the conversation.

More
22 Nov 2012 17:12 #3101 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)

sbstnp wrote:

suvsuv wrote: Some minor update:
3) Change timers' hotkeys to R/L , because the timers are easily false triggered or reset with EXT/Up assigned


I think timers should be reset with either:
1. Long-press down
2. Long press EXT

R/L are not good options because we basically can do 2 sets of quickkeys:

1. Long R/L
2. Short R/L - quick use, I would probably restrict these to one page bound to R and one bound to L, with any key reverting to main page.

We've had lot sof discussion about the quickkeys. For this release, they will stay as long up/down on the dveo10 (and short R/L on the Devo8).
I'll work on making them configurable in the future. When that happens, I'll actually make all main-page keys configurable so you can set them how you like. For now though, they won't be.

Please Log in or Create an account to join the conversation.

More
23 Nov 2012 05:48 #3103 by sbstnp

PhracturedBlue wrote:

sbstnp wrote:

suvsuv wrote: Some minor update:
3) Change timers' hotkeys to R/L , because the timers are easily false triggered or reset with EXT/Up assigned


I think timers should be reset with either:
1. Long-press down
2. Long press EXT

R/L are not good options because we basically can do 2 sets of quickkeys:

1. Long R/L
2. Short R/L - quick use, I would probably restrict these to one page bound to R and one bound to L, with any key reverting to main page.

We've had lot sof discussion about the quickkeys. For this release, they will stay as long up/down on the dveo10 (and short R/L on the Devo8).
I'll work on making them configurable in the future. When that happens, I'll actually make all main-page keys configurable so you can set them how you like. For now though, they won't be.


Good to hear, fully configurable would be amazing.

Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire

Please Log in or Create an account to join the conversation.

More
23 Nov 2012 15:46 #3105 by suvsuv
2 bug fixes:
1) In the Expo&DR page ,when pressing down/up key quickly and continuously, there are big chance letting the TX reboot. It is because the page is very complicated , if the GUI is busy on refreshing, the watchdog won't be fed. Currently, I remove the bar graph that is really unnecessary, and also improve view refreshing logic. The issue is not fully resolved but mitigated a lot.
2) TX won't alarm when countdown timer reaches 0

Please Log in or Create an account to join the conversation.

More
23 Nov 2012 16:21 #3107 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
We can move the watchdog into the interrupt handler, or increase the timeout. I didn't want to do the 1st because it would defeat the purpose to some extent

Please Log in or Create an account to join the conversation.

More
24 Nov 2012 00:00 #3112 by suvsuv

PhracturedBlue wrote: We can move the watchdog into the interrupt handler,

I am working on moving handling of the view refreshing into GUI_RefreshScreen() 。 If this solution works, we don't need to move the watchdog into ISR as moving watchdog requires comprehensive testing not only in devo10 but also devo8.

Please Log in or Create an account to join the conversation.

Time to create page: 0.134 seconds
Powered by Kunena Forum