"Arduino" Pro Micro
"Arduino" Pro Micro
Hi,
i have seen the new Pro Micro from sparkfun http://www.sparkfun.com/products/10998.
it is the same size with pro mini but with the "Leonardo" ATMega 32U4
it has some benefits but also some disadvantages compared with pro mini...
as far as i know..
benefits:
- usb onboard
- more RAM? (aBUGSworstnightmare told me the more RAM it has is taken by the USB )
- high resolution PWM timers.. some 10bit (= 1023steps?) and some 16bit (= more then 1023 but i dont know it)
- a free UART.. can be used for GPS right?
disadvantages:
- less pins
- only 6 PCINT pins (two of them may be taken by PWM if we want to use HW PWM = 4 free PCINT pins)
- pin 2 & 3 are taken by SDA & SCL
a pin plan i made for it
is the community interestet to support it with MWC?
regards
Felix
i have seen the new Pro Micro from sparkfun http://www.sparkfun.com/products/10998.
it is the same size with pro mini but with the "Leonardo" ATMega 32U4
it has some benefits but also some disadvantages compared with pro mini...
as far as i know..
benefits:
- usb onboard
- more RAM? (aBUGSworstnightmare told me the more RAM it has is taken by the USB )
- high resolution PWM timers.. some 10bit (= 1023steps?) and some 16bit (= more then 1023 but i dont know it)
- a free UART.. can be used for GPS right?
disadvantages:
- less pins
- only 6 PCINT pins (two of them may be taken by PWM if we want to use HW PWM = 4 free PCINT pins)
- pin 2 & 3 are taken by SDA & SCL
a pin plan i made for it
is the community interestet to support it with MWC?
regards
Felix
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: "Arduino" Pro Micro
Time to renew the I2C-ESC. Hmmm
Re: "Arduino" Pro Micro
GUI Config via USB, the USART for Spektrum satellite? Yes, I'm interested.
What do we need to do?
I'll order a couple today.
What do we need to do?
I'll order a couple today.
Re: "Arduino" Pro Micro
Hi
Teensy++ - same price, 128k flash, 8k sram, 6x 16bit compare units. 4x 8bit compare units.
So, what is the point?
regards,
ziss_dm
Teensy++ - same price, 128k flash, 8k sram, 6x 16bit compare units. 4x 8bit compare units.
So, what is the point?
regards,
ziss_dm
Re: "Arduino" Pro Micro
ziss_dm wrote:Hi
Teensy++ - same price, 128k flash, 8k sram, 6x 16bit compare units. 4x 8bit compare units.
So, what is the point?
regards,
ziss_dm
Same price, Hmmm... Might have to order a couple of these as well. Ziss do you have one in hand?
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: "Arduino" Pro Micro
This is the greatest feature of Open Source Software, it keeps up with the changes in hardware and brilliant minded people.
Re: "Arduino" Pro Micro
ziss_dm wrote:Hi
Teensy++ - same price, 128k flash, 8k sram, 6x 16bit compare units. 4x 8bit compare units.
So, what is the point?
regards,
ziss_dm
Hi ziss,
thay are may good AVRs that may be used...
i first saw this one http://www.adafruit.com/products/296 .. it has the same avr as pro micro.. more pins and a 3.3 v out ...
but i think using arduino is hard enough for the moust people.. if thay need to flash a bootloader or something like that it becomes too much..
the pro micro is something like "pro mini 2.0" the same usage the same sellers and in future build in arduino (there is a pins_arduino.h for it in arduino/hardware/arduino/variants/)
so i think its the best choice...
Danal wrote:What do we need to do?
i think we need to do some tests with it (i ordered one too )..
i did some thoughs about a possible pin usage for it
but i dont know the timers possible frequencys ... i hope they are usable for us.
regards Felix
Re: "Arduino" Pro Micro
In the past I started a thread asking about Teensy possible support. These USB chips have very few pins that support pin-change interrupt. After reviewing possible connections I agree that there is no real advantage over the very popular ATMega328p.
Re: "Arduino" Pro Micro
Spektrum will not use the TX pin, only the RX.
Re: "Arduino" Pro Micro
ok thanks ..
i also dont know if we can unse the PCINT pins and the interrupt of rx and tx at one time.. we will see
regards
Felix
i also dont know if we can unse the PCINT pins and the interrupt of rx and tx at one time.. we will see
regards
Felix
Re: "Arduino" Pro Micro
ronco wrote:ok thanks ..
i also dont know if we can unse the PCINT pins and the interrupt of rx and tx at one time.. we will see
regards
Felix
Per the datasheet, there is a USART for RX and TX. That should make the interrupts for USART1 serial communications totally independent of anything else.
Re: "Arduino" Pro Micro
ronco wrote:i did some thoughs about a possible pin usage for it
but i dont know the timers possible frequencys ... i hope they are usable for us.
regards Felix
What a horrible waste of hardware in the name of tarduino.
Why does a 48 pin chip only have like 16 pins broken out? The mind boggles.
Stuff like this shouldn't be supported - let the greedy vendor know by not buying their junk.
Re: "Arduino" Pro Micro
Hi Ronco,
If we are still talking about Teensy, you do not need to flash bootloader as it comes preprogrammed.
@Danal: yes, I have couple.
regards,
ziss_dm
but i think using arduino is hard enough for the moust people.. if thay need to flash a bootloader or something like that it becomes too much..
If we are still talking about Teensy, you do not need to flash bootloader as it comes preprogrammed.
@Danal: yes, I have couple.
regards,
ziss_dm
Re: "Arduino" Pro Micro
dongs wrote:What a horrible waste of hardware in the name of tarduino.
Why does a 48 pin chip only have like 16 pins broken out? The mind boggles.
Stuff like this shouldn't be supported - let the greedy vendor know by not buying their junk.
i count 44pins on the chip .. but there are 5 usable pins not broken out on pro micro (the others are for usb rx tx led ....)
i also think thay may do it better .. but as i said .. if we dont want to make MWC to special .. i think we need to take the common stuff..
regards Felix
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: "Arduino" Pro Micro
IMO, if we are not talking about moving to a 32bit chip, then it would be best to stay with the present Adruino.
Re: "Arduino" Pro Micro
The most sensible reply in this entire thread is above.
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: "Arduino" Pro Micro
Hi there,
well, why shouldn't we think a little bit more about what's on the schedule in the near future? The Arduino 'Leonardo' was announced on the Maker Fair last year (http://arduino.cc/blog/2011/09/17/ardui ... ker-faire/). It is based around the Atmega32u4 and there will be a special official Arduino boot loader (CDC class) for it available for shure. So, this will not be a problem for the user.
The device will help us to break the limitations of the promini (fewer PWM's, only one UART) since it has lot's of PWM's (four of them high speed ones - up to 48MHz when USB is in use) and the USB for communication with the PC (--> FTDI is no longer needed). The UART will be available all the time to use with a Spektrum Sat, GPS, Bluetooth, ..). And, it's cheaper than a mega328P.
Since the Atmega32U4 is a 44-pin device we will not see any limitations when comparing it with the mega328P. The Teensy and the Ardafruit implementation were not the best for using it with MWC from my point of view --> maybe there will be a better one in the future.
The only problem at the moment is the lack of an official bootlaoder; a Leonardo header (which is remapping I/O and definitions) is already available with Ardiuino V1.0 --> implementing the software should be possible with adding simple 'defines (as with the mega).
Rgds
aBUGSworstnightmare
well, why shouldn't we think a little bit more about what's on the schedule in the near future? The Arduino 'Leonardo' was announced on the Maker Fair last year (http://arduino.cc/blog/2011/09/17/ardui ... ker-faire/). It is based around the Atmega32u4 and there will be a special official Arduino boot loader (CDC class) for it available for shure. So, this will not be a problem for the user.
The device will help us to break the limitations of the promini (fewer PWM's, only one UART) since it has lot's of PWM's (four of them high speed ones - up to 48MHz when USB is in use) and the USB for communication with the PC (--> FTDI is no longer needed). The UART will be available all the time to use with a Spektrum Sat, GPS, Bluetooth, ..). And, it's cheaper than a mega328P.
Since the Atmega32U4 is a 44-pin device we will not see any limitations when comparing it with the mega328P. The Teensy and the Ardafruit implementation were not the best for using it with MWC from my point of view --> maybe there will be a better one in the future.
The only problem at the moment is the lack of an official bootlaoder; a Leonardo header (which is remapping I/O and definitions) is already available with Ardiuino V1.0 --> implementing the software should be possible with adding simple 'defines (as with the mega).
Rgds
aBUGSworstnightmare
Re: "Arduino" Pro Micro
aBUGSworstnightmare wrote:The only problem at the moment is the lack of an official bootlaoder; a Leonardo header (which is remapping I/O and definitions) is already available with Ardiuino
Hi,
the bootloader is alredy in Arduino 1.0 .. to use it you need to uncomment the leonardo part in hardware/arduino/boards.txt
(remove the "#"s in front of the lines)
and the Pro Micro comes with this bootloader -> http://www.sparkfun.com/tutorials/338
i dont recived my Pro Micro yet .. i hope i have it soon..
i alredy started to make MWC compatible ;P
but i have some questions to people that knows the atmega32_u4
for HW PWM we have pin 10, 9, 6 and 5 (PB6, PB5, PD7 and PC6) ... pin 3 (PD0) is used for SCL
PB7 and PC7 are not broken out on Pro Micro
possible timers for this pins are:
10 = 1B or 4B
9 = 1A or 4B
6 = 4D
5 = 3A or 4A
so i think its best to use them linke:
10 = 1B
9 = 1A
6 = 4D
5 = 4A
questions:
1. timer 4 is the high speed timer right? if it is .. is it possible to prescale it to a frequency under 500Hz?
2. i had some problems with serial stuff .. so is the usb also used like a serial port?
3. UDR0 is not defined (arduino says that) so i replaced it with UDR1 for pro micro .. is UDR1 now the USB or the USART?
Thanks !
Regards
Felix
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: "Arduino" Pro Micro
ronco wrote:aBUGSworstnightmare wrote:The only problem at the moment is the lack of an official bootlaoder; a Leonardo header (which is remapping I/O and definitions) is already available with Ardiuino
Hi,
the bootloader is alredy in Arduino 1.0 .. to use it you need to uncomment the leonardo part in hardware/arduino/boards.txt
(remove the "#"s in front of the lines)
and the Pro Micro comes with this bootloader -> http://www.sparkfun.com/tutorials/338
i dont recived my Pro Micro yet .. i hope i have it soon..
i alredy started to make MWC compatible ;P
but i have some questions to people that knows the atmega32_u4
for HW PWM we have pin 10, 9, 6 and 5 (PB6, PB5, PD7 and PC6) ... pin 3 (PD0) is used for SCL
PB7 and PC7 are not broken out on Pro Micro
possible timers for this pins are:
10 = 1B or 4B
9 = 1A or 4B
6 = 4D
5 = 3A or 4A
so i think its best to use them linke:
10 = 1B
9 = 1A
6 = 4D
5 = 4A
questions:
1. timer 4 is the high speed timer right? if it is .. is it possible to prescale it to a frequency under 500Hz?
2. i had some problems with serial stuff .. so is the usb also used like a serial port?
3. UDR0 is not defined (arduino says that) so i replaced it with UDR1 for pro micro .. is UDR1 now the USB or the USART?
Thanks !
Regards
Felix
Hi Felix,
1.) The maximum count clock (PCK) for Timer 4 is 48MHz when using USB (since USB needs PCK = 48MHz) --> maximum prescale setting is PCK/16384
2.) Just imagine your ProMicro has two separte serial ports:
Serial.println("Hello world"); // Print "Hello World" to the Serial Monitor--> that's the USB interface!!!
Serial1.println("Hello!"); // Print "Hello!" over hardware UART1 (TXD1 = PD3) --> simply test it with an FTDI (*lol*) connected to the UART
3.) UDR1 is for UART
4.) http://mikrocontroller-praxis.de/de/Dev ... Board.html --> PB7 and PC7 were both available --> will try the Sparkfun Bootloader with it (should be this one: https://github.com/arduino/Arduino/tree ... diskloader)!
aBUGsworstnightmare
Re: "Arduino" Pro Micro
thanks!
but that are bad news ...
if Timer 4 need to run at 48Mhz to use the usb .. the lowest HW PWM frequency would be 48000000/16384 = 2929Hz
eaven with a nother board with PB7 and PC7 broken out we will need timer 4 for HW PWM
so we have just 2 / (3 with PB7 broken out ) usable HW PWM pins...
hmm then i have no idea how to use the usb with MWC serial code .. because arduino says UDR0 (i think this would be for usb) is not defined
i will try it anyway
Regards
Felix
but that are bad news ...
if Timer 4 need to run at 48Mhz to use the usb .. the lowest HW PWM frequency would be 48000000/16384 = 2929Hz
eaven with a nother board with PB7 and PC7 broken out we will need timer 4 for HW PWM
so we have just 2 / (3 with PB7 broken out ) usable HW PWM pins...
aBUGSworstnightmare wrote:3.) UDR1 is for UART
hmm then i have no idea how to use the usb with MWC serial code .. because arduino says UDR0 (i think this would be for usb) is not defined
i will try it anyway
Regards
Felix
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: "Arduino" Pro Micro
ronco wrote:thanks!
but that are bad news ...
if Timer 4 need to run at 48Mhz to use the usb .. the lowest HW PWM frequency would be 48000000/16384 = 2929Hz
eaven with a nother board with PB7 and PC7 broken out we will need timer 4 for HW PWM
so we have just 2 / (3 with PB7 broken out ) usable HW PWM pins...aBUGSworstnightmare wrote:3.) UDR1 is for UART
hmm then i have no idea how to use the usb with MWC serial code .. because arduino says UDR0 (i think this would be for usb) is not defined
i will try it anyway
Regards
Felix
Felix,
you can use 16Mhz main clock to for clocking timer4 --> it's a 'normal' PWM then and no longer high speed. Max. Prescaler is 16384 too (refer to the data sheet).
USB data were received/send via FIFO in RAM --> there's no 'register' for sending/receiving data.
Details on a USB CDC implementation can be found here http://www.atmel.com/dyn/resources/prod ... oc8447.pdf --> now you need to know how the functions were called in Arduino --> should be here https://github.com/arduino/Arduino/blob ... no/CDC.cpp
aBUGSworstnightmare
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: "Arduino" Pro Micro
Hi,
bad news!
Have had no luck so far regarding the 'Leonardo' boot loader!
I've tested with Arduino Leonardo bootloader and Sparkfun disk loader but both return an Error 'Code 10: can not start device' under windows 7.
The Ardafruit AVR109 based boot loader works, but it can not be used with a 'Leonardo Target' under Arduino.
Has anybody a working boot loader/fuse bit setting for the ATmega32U4 for using it under Arduino V1.0 so far?
aBUGSworstnightmare
bad news!
Have had no luck so far regarding the 'Leonardo' boot loader!
I've tested with Arduino Leonardo bootloader and Sparkfun disk loader but both return an Error 'Code 10: can not start device' under windows 7.
The Ardafruit AVR109 based boot loader works, but it can not be used with a 'Leonardo Target' under Arduino.
Has anybody a working boot loader/fuse bit setting for the ATmega32U4 for using it under Arduino V1.0 so far?
aBUGSworstnightmare
Re: "Arduino" Pro Micro
Hi,
i hope the "ginue" Pro Micro works as thay show in this toturial...
i made a small board for it .. now i just need to wait -.-
regards Felix
i hope the "ginue" Pro Micro works as thay show in this toturial...
i made a small board for it .. now i just need to wait -.-
regards Felix
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: "Arduino" Pro Micro
That board really looks good and Professionally done. Looking forward to your flight testing.
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: "Arduino" Pro Micro
Hi,
finally made the Sparkfun Bootloader working (download it here (link is in the comments section at the bottom of the page): http://www.sparkfun.com/tutorials/338)! Works on Win XP; still need to confirm Win7 and OS X!!!
EDIT! OS X is not working!!! Win7 works (but device needs to be re-connected after upload; maybe this is because I'm running Win7 in a virtual machine; would be good if somebody can reconfirm!). EDIT!
Find screenshots of the fuse/lock bit settings I've used so for the beginning enclosed.
Here's a simple sketch for testing the USB/UART communication:
.. and a screenshot of 'what you'll get'.
Time to port the code now!
aBUGSworstnightmare
finally made the Sparkfun Bootloader working (download it here (link is in the comments section at the bottom of the page): http://www.sparkfun.com/tutorials/338)! Works on Win XP; still need to confirm Win7 and OS X!!!
EDIT! OS X is not working!!! Win7 works (but device needs to be re-connected after upload; maybe this is because I'm running Win7 in a virtual machine; would be good if somebody can reconfirm!). EDIT!
Find screenshots of the fuse/lock bit settings I've used so for the beginning enclosed.
Here's a simple sketch for testing the USB/UART communication:
Code: Select all
/* Pro Micro Test Code
by: aBUGSworstnightmare
date: January 30, 2012
license: Public Domain - please use this code however you'd like.
It's provided as a learning tool.
This code is provided to show how to control the Ardafruit
ProMicro's BOOT LEDs within a sketch. It also serves
to explain the difference between Serial.print() and
Serial1.print().
Think of the ProMicro having two separate serial ports.
One port is for communication to and from the computer (over USB, the Serial Monitor); that's the one without the '1'.
And the other port is a real, hardware UART; that's the one with the '1' (RX1=PD2, TX1=PD3). That's where you could talk to another Arduino,
or any hardware device that requires serial communication.
Connect your FTDI to the Leonardo as follows:
PD2 --> TX of FTDI
PD3 --> RX of FTDI
GND --> GND (don't miss it!)
Now open a terminal programm and 'listen' to the FTDI
Download the sketch and open Arduiono Serial-Monitor when programm is running!
Enjoy!
*/
void setup()
{
pinMode(7, OUTPUT); // Set BOOT (GREEN LED on ARDAFRUIT BREAK OUT) LED as an output
Serial.begin(9600); //This pipes to the serial monitor
Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
}
void loop()
{
Serial.println("Hello world"); // Print "Hello World" to the Serial Monitor
Serial1.println("Hello!"); // Print "Hello!" over hardware UART
digitalWrite(7, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(7, LOW); // set the LED off
delay(1000); // wait for a second
}
.. and a screenshot of 'what you'll get'.
Time to port the code now!
aBUGSworstnightmare
Re: "Arduino" Pro Micro
Hi,
i got my promini now
it works with win7 x64 !
and i start testing and coding..
till now i have pin 9 & 10 working with timer 1 A & B HW PWM @488Hz
and also pin 5 & 6 with timer 4 A & D prescaled with "TCCR4B = TCCR4B & 0b11111000 | 0x8;" HW PWM @488Hz
thay are running at 8 bit atm .. but from datasheet thay may work with 16 or 11bit
now i need to get the usb work with the gui .. then i can check the RX input pins ..
for servos and motor 4-8 we have timer 3 A B C and timer 0 A B free.
timer 0 may be used for ampereDieter's 11bit RX input ..
i think ill upload the code tomorrow .. when i did more tests .. but i think it looks like it will work
regards Felix
i got my promini now
it works with win7 x64 !
and i start testing and coding..
till now i have pin 9 & 10 working with timer 1 A & B HW PWM @488Hz
and also pin 5 & 6 with timer 4 A & D prescaled with "TCCR4B = TCCR4B & 0b11111000 | 0x8;" HW PWM @488Hz
thay are running at 8 bit atm .. but from datasheet thay may work with 16 or 11bit
now i need to get the usb work with the gui .. then i can check the RX input pins ..
for servos and motor 4-8 we have timer 3 A B C and timer 0 A B free.
timer 0 may be used for ampereDieter's 11bit RX input ..
i think ill upload the code tomorrow .. when i did more tests .. but i think it looks like it will work
regards Felix
Re: "Arduino" Pro Micro
I work atm on serial/usb
i trie to do it with Serial .. but it wont work
i want to use Serial.write(buf,head); instead of UartSendData();.. but it says:
"Serial:139: error: no matching function for call to 'Serial_::write(uint8_t [256], uint8_t&)'
C:\Users\...\Desktop\arduino\hardware\arduino\cores\arduino/USBAPI.h:38: note: candidates are: virtual size_t Serial_::write(uint8_t)"
someone knows what i do wrong?
serial read works..
[edit] i uploaded my actual code here http://code.google.com/p/multiwii/sourc ... i_promicro (use the zip file ) [/edit]
regards Felix
i trie to do it with Serial .. but it wont work
i want to use Serial.write(buf,head); instead of UartSendData();.. but it says:
"Serial:139: error: no matching function for call to 'Serial_::write(uint8_t [256], uint8_t&)'
C:\Users\...\Desktop\arduino\hardware\arduino\cores\arduino/USBAPI.h:38: note: candidates are: virtual size_t Serial_::write(uint8_t)"
someone knows what i do wrong?
serial read works..
[edit] i uploaded my actual code here http://code.google.com/p/multiwii/sourc ... i_promicro (use the zip file ) [/edit]
regards Felix
Re: "Arduino" Pro Micro
Hi,
the communication with gui now works partially .. write dosent works .. i think its because the usb code i use atm. cant read arrays ..
im on the RX code now
[OT]
how can i delete files form branches? the MultiWii (without .ino) and the zip file can be deleted ...
but i dont know how to do it -.-
[OT]
regards Felix
the communication with gui now works partially .. write dosent works .. i think its because the usb code i use atm. cant read arrays ..
im on the RX code now
[OT]
how can i delete files form branches? the MultiWii (without .ino) and the zip file can be deleted ...
but i dont know how to do it -.-
[OT]
regards Felix
Re: "Arduino" Pro Micro
news
now everything except of GUI send settings to promicro seems to work
- conventional RX input with 6 channels works fine (tx & rx pin as aux 1 & 2)
-> attachInterrupt dosent works with 32u4 ATM. i had to do it without ..
- PPM sum should work (on tx pin)
- spectrum sattelite works with UART1
- promini to GUI over USB works now without Serial
- output for 0-8 ESC's or 0-8 Servos seems to work (ATM thay are with "just" 8bit resolution )
there is something i dont understand ... if i write something with serial monitor to the promicro, USB_Available() retuns the right length ...
but if the GUI writes the settings it always returns 1.. eaven if i do a while loop to wait -.-
is there something special how the GUI sends serial data?
regards
felix
now everything except of GUI send settings to promicro seems to work
- conventional RX input with 6 channels works fine (tx & rx pin as aux 1 & 2)
-> attachInterrupt dosent works with 32u4 ATM. i had to do it without ..
- PPM sum should work (on tx pin)
- spectrum sattelite works with UART1
- promini to GUI over USB works now without Serial
- output for 0-8 ESC's or 0-8 Servos seems to work (ATM thay are with "just" 8bit resolution )
there is something i dont understand ... if i write something with serial monitor to the promicro, USB_Available() retuns the right length ...
but if the GUI writes the settings it always returns 1.. eaven if i do a while loop to wait -.-
is there something special how the GUI sends serial data?
regards
felix
Re: "Arduino" Pro Micro
ronco wrote:is there something special how the GUI sends serial data?
done
now it looks like everything works just fine ..
i will do some flight tests tomorrow (if the weather let me do it)
i added the config pde but its the same as r501 (no changes)
http://code.google.com/p/multiwii/sourc ... i_promicro
i also made a connecting image:
regards
felix
Re: "Arduino" Pro Micro
Hi,
again some good news
now i have (with help of aBUGSworstnightmare) all outputs (also for the servos) of the promicro with full system resolution (1000->2000 = 1000->2000)
.. the first 4 motors still works with HW PWM!
i still didnt fly it .. becaus i have to finish my copter for it first ..
@ Danal
while checking the soft PWM outputs for hexa and octo i found that the spectrum satelite code does heavy jitter to the soft pwm interrupts
is there a way to fix or reduce this?
regards
felix
again some good news
now i have (with help of aBUGSworstnightmare) all outputs (also for the servos) of the promicro with full system resolution (1000->2000 = 1000->2000)
.. the first 4 motors still works with HW PWM!
i still didnt fly it .. becaus i have to finish my copter for it first ..
@ Danal
while checking the soft PWM outputs for hexa and octo i found that the spectrum satelite code does heavy jitter to the soft pwm interrupts
is there a way to fix or reduce this?
regards
felix
Re: "Arduino" Pro Micro
Hi ronco,
I'm using this RX routine:
It works for me. (but requires some changes in LCD configurator)
Discussion is here:
viewtopic.php?f=8&t=955&start=20
regards,
ziss_dm
I'm using this RX routine:
Code: Select all
#define SPEK_STATE_START 0x00
#define SPEK_STATE_HEADER01 0x10
#define SPEK_STATE_PAYLOAD00 0x20
#define SPEK_STATE_PAYLOAD01 0x30
void readSpectrum(){
static uint8_t g_state = SPEK_STATE_START;
static uint8_t val0;
register uint8_t state = g_state & 0xF0;
register uint8_t cnt_ = g_state & 0x0F;
if (SerialAvailable(1)) {
do {
uint8_t val1 = SerialRead(1);
switch (state) {
case SPEK_STATE_START:
val0 = val1;
state = SPEK_STATE_HEADER01;
break;
case SPEK_STATE_HEADER01:
state = SPEK_STATE_PAYLOAD00; cnt_ = 0;
// ToDo: Read status/RSI
#if defined(FAILSAFE)
if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0;
#endif
break;
case SPEK_STATE_PAYLOAD00:
val0 = val1;
state = SPEK_STATE_PAYLOAD01;
break;
case SPEK_STATE_PAYLOAD01:
state = SPEK_STATE_PAYLOAD00;
if ((cnt_++) == 0x06) state = SPEK_STATE_START;
uint8_t C = (val0 >> SPEK_CHAN_SHIFT) & 0x0F;
if (C < 10)
#if (SPEKTRUM == 1024)
rcValue[C] = (((val0 & SPEK_CHAN_MASK) << 8) | val1) + 988;
#endif
#if (SPEKTRUM == 2048)
rcValue[C] = (((val0 & SPEK_CHAN_MASK) << 8) | val1) >> 1) + 988;
#endif
break;
}
} while (SerialAvailable(1));
} else state = SPEK_STATE_START;
g_state = state | cnt_;
}
It works for me. (but requires some changes in LCD configurator)
Discussion is here:
viewtopic.php?f=8&t=955&start=20
regards,
ziss_dm
Re: "Arduino" Pro Micro
ronco wrote:@ Danal
while checking the soft PWM outputs for hexa and octo i found that the spectrum satelite code does heavy jitter to the soft pwm interrupts
is there a way to fix or reduce this?
regards
felix
Yes. Better/smaller/faster interrupt handler currently in test in my branch. I will merge into shared in a few days, and you can merge those changes into your port.
Thanks for doing this... I now have a couple of pieces of hardware, and will be looking at your build very soon.
Re: "Arduino" Pro Micro
Hi,
and thank you
using the satelite with a arduino micro will be nice for small copters .
i have to say its not realy a port! its more a support.
if we have successful flight tests done, it will be esasy to merge this code into actual MWC!
nothing of this code will interfere with promini or mega code...
regards
felix
and thank you
using the satelite with a arduino micro will be nice for small copters .
Danal wrote:... and you can merge those changes into your port.
i have to say its not realy a port! its more a support.
if we have successful flight tests done, it will be esasy to merge this code into actual MWC!
nothing of this code will interfere with promini or mega code...
regards
felix
Re: "Arduino" Pro Micro
... i finished my copter today and did a lot of flight tests with it
hardware:
- FC = Promicro
- Gyro = ginue WMP
- ACC = BMA020
- ESC's = 4 Dymond Smart 10 (similar to turnergy Plush) with sil-F334 chip (ginue software)
- Motors = 4x Scorpio S2208 (with 8x3,8 APC)
- RX = Spectrum DX6
- Lipo = 3s 3200mAh
- motor to motor diameter (X) = ~37cm (its asynchronous)
first test - does it fly?:
- it does
second test - cross test promicro vs. promini..
setup:
- same copter
- same sensors
- same reciver
- same WMC ver.
results:
- both fly well
- max P on promini = 3,5 (I and D are default)
- max P on promicro = 8 ! (I and D are default)
- promicro feels like twice stable as with promini (i think thats because of more then twice P)
so i think the high res PWM rocks !
regards
felix
hardware:
- FC = Promicro
- Gyro = ginue WMP
- ACC = BMA020
- ESC's = 4 Dymond Smart 10 (similar to turnergy Plush) with sil-F334 chip (ginue software)
- Motors = 4x Scorpio S2208 (with 8x3,8 APC)
- RX = Spectrum DX6
- Lipo = 3s 3200mAh
- motor to motor diameter (X) = ~37cm (its asynchronous)
first test - does it fly?:
- it does
second test - cross test promicro vs. promini..
setup:
- same copter
- same sensors
- same reciver
- same WMC ver.
results:
- both fly well
- max P on promini = 3,5 (I and D are default)
- max P on promicro = 8 ! (I and D are default)
- promicro feels like twice stable as with promini (i think thats because of more then twice P)
so i think the high res PWM rocks !
regards
felix
Re: "Arduino" Pro Micro
to may motivate some people to trie something new, i made a promini vs promicro compersion table
to have a clear look at the differences .. this table shows how it is now.. in future with other breakout boards (with all pins broken out) or complete FC's with the ATmega32_u4 , there will be more features like 6 HW PWM and no dubble pin usage for RXO and TXO available.
regards
Felix
to have a clear look at the differences .. this table shows how it is now.. in future with other breakout boards (with all pins broken out) or complete FC's with the ATmega32_u4 , there will be more features like 6 HW PWM and no dubble pin usage for RXO and TXO available.
regards
Felix
Re: "Arduino" Pro Micro
If you're redoing the new multiwii "reference platform" 2 years after it was created, and the only worthwhile upgrade is adding 0.5K of ram, you better look elsewhere.
Re: "Arduino" Pro Micro
Hey dongs .. i dont know your problem ... i dont redo anything ...
all changes on the MWC code to support the atmega32u4 are done with a few simple defines!
it is supported by Arduino so the difference to use it is just like it is with promini and mega.
and yes.. its not the revolution of multiwii but it has some advantages compered to the atmega328p .. why should we not use it?
regards felix
all changes on the MWC code to support the atmega32u4 are done with a few simple defines!
it is supported by Arduino so the difference to use it is just like it is with promini and mega.
and yes.. its not the revolution of multiwii but it has some advantages compered to the atmega328p .. why should we not use it?
regards felix
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: "Arduino" Pro Micro
ronco wrote:... i finished my copter today and did a lot of flight tests with it
hardware:
- FC = Promicro
- Gyro = ginue WMP
- ACC = BMA020
- ESC's = 4 Dymond Smart 10 (similar to turnergy Plush) with sil-F334 chip (ginue software)
- Motors = 4x Scorpio S2208 (with 8x3,8 APC)
- RX = Spectrum DX6
- Lipo = 3s 3200mAh
- motor to motor diameter (X) = ~37cm (its asynchronous)
first test - does it fly?:
- it does
second test - cross test promicro vs. promini..
setup:
- same copter
- same sensors
- same reciver
- same WMC ver.
results:
- both fly well
- max P on promini = 3,5 (I and D are default)
- max P on promicro = 8 ! (I and D are default)
- promicro feels like twice stable as with promini (i think thats because of more then twice P)
so i think the high res PWM rocks !
regards
felix
Hi,
It's interresting to see that a 16 bit hardware PWM allows higher PIDs than a 8 bit hardware PWM.
It's not possible for the PROMINI (or maybe just for Timer1) , but there maybe also some inmprovement possibilities for PMW on MEGA.
(I noticed a remaining error in your code about the servo mapping for bicopter)
Re: "Arduino" Pro Micro
Alexinparis wrote:Hi,
It's interresting to see that a 16 bit hardware PWM allows higher PIDs than a 8 bit hardware PWM.
It's not possible for the PROMINI (or maybe just for Timer1) , but there maybe also some inmprovement possibilities for PMW on MEGA.
(I noticed a remaining error in your code about the servo mapping for bicopter)
hi Alex,
ampereDieter did this improvements for mega with his mod .. but he did it in a "hardcore coder" way
i talked to him and there are some people testing his mod .. i think we may get some results soon.
i told him that it may be better to show an implemention that is not that complex. so there is a softer way to implement it without changing everything and with understandable code.
and .. can you show me where this bicopter servo code error is? i dont see it
regards
felix
Re: "Arduino" Pro Micro
Hi ronco,
As I can see only 2 channels are true hw PWM, the rest is interrupts. Am I missing something or why is that?
regards,
ziss_dm
As I can see only 2 channels are true hw PWM, the rest is interrupts. Am I missing something or why is that?
regards,
ziss_dm
Re: "Arduino" Pro Micro
Hi ziss,
do you mean in ampereDieters mod or in my promicro code?
in promicro code:
Timer 1 A & B and Timer 4 A & D is used as real hardware PWM.
if you mean that thing with TC4H ... its to set the high byte... because the timer is 11bit but the OCR register is just 8..
so it is a way to write to the OCR's nothing more .. the "real" 16bit register does the same but they do it automaticly.
from datasheet:
[edit]
maybe that helps
[/edit]
regards
felix
do you mean in ampereDieters mod or in my promicro code?
in promicro code:
Timer 1 A & B and Timer 4 A & D is used as real hardware PWM.
Code: Select all
// to write values > 255 to timer 4 A we need to split the bytes
static uint8_t pwm4_HBA; // high byte for timer 4 A
static uint16_t pwm4_LBA; // low byte for timer 4 A
pwm4_LBA = 2047-motor[2]; // channel A is inverted
pwm4_HBA = 0;
while(pwm4_LBA > 255){
pwm4_HBA++;
pwm4_LBA-=256;
}
TC4H = pwm4_HBA; // high byte
OCR4A = pwm4_LBA; // pin 5
if you mean that thing with TC4H ... its to set the high byte... because the timer is 11bit but the OCR register is just 8..
so it is a way to write to the OCR's nothing more .. the "real" 16bit register does the same but they do it automaticly.
from datasheet:
[edit]
maybe that helps
[/edit]
regards
felix
Re: "Arduino" Pro Micro
@ ziss_dm
i have a question.. you said thet soft pwm on promini works with 0,8 us Jitter..
is this because 2000 / 255 stepes = 7,84 ? means jitter is around 1step?
if it is like this. it may be also better with a 16bit timer ...
2000 / 16000 steps = 0,125 ... = 0,0125 us Jitter?
regards
felix
i have a question.. you said thet soft pwm on promini works with 0,8 us Jitter..
is this because 2000 / 255 stepes = 7,84 ? means jitter is around 1step?
if it is like this. it may be also better with a 16bit timer ...
2000 / 16000 steps = 0,125 ... = 0,0125 us Jitter?
regards
felix
Re: "Arduino" Pro Micro
Hi ronco,
I would say ~10us.
This is due other interrupt handlers in the system.
regards,
ziss_dm
I would say ~10us.
This is due other interrupt handlers in the system.
regards,
ziss_dm
Re: "Arduino" Pro Micro
Hi,
i did this test http://www.youtube.com/watch?v=n_g2s1nc ... rofilepage
that ziss_dm did with his new ESC firmware now with the promicro and ginue ESC's.
http://www.youtube.com/watch?v=hiqGf4M_ ... e=youtu.be
i think the results looks similar
regards
Felix
i did this test http://www.youtube.com/watch?v=n_g2s1nc ... rofilepage
that ziss_dm did with his new ESC firmware now with the promicro and ginue ESC's.
http://www.youtube.com/watch?v=hiqGf4M_ ... e=youtu.be
i think the results looks similar
regards
Felix
Re: "Arduino" Pro Micro
Hi,
with the permission of alex i have merged the promicro code now to shared
regards
Felix
with the permission of alex i have merged the promicro code now to shared
regards
Felix
Re: "Arduino" Pro Micro
Hi,
there is a new version of the promicro out now.. thay fixed the tx rx LED bug and the misslabeled pin.
also the power handling is better now
regrads
felix
there is a new version of the promicro out now.. thay fixed the tx rx LED bug and the misslabeled pin.
also the power handling is better now
regrads
felix
-
- Posts: 31
- Joined: Wed Nov 02, 2011 8:58 pm
Re: "Arduino" Pro Micro
Nice job ;p
in the multiwii source, i can't read the file "connecting promicro.jpg" an idea ?
Matt.
in the multiwii source, i can't read the file "connecting promicro.jpg" an idea ?
Matt.
Re: "Arduino" Pro Micro
Hey folks,
I don't want to hijack this thread but it seems like the best place to ask my question.
I've got an Arduino Pro Micro that I'm using on a project. I'd like to be able to read in data from an RC receiver. Being an Arduino newb, I have not completely wrapped my head around the PCINT functionality that is being used in the MultiWii code.
Could one of you code wizards send me a simple sketch that lets me read 6 (or more) channels (from individual pins) into variables that get printed out to the serial monitor?
Thanks for your help,
Tim
I don't want to hijack this thread but it seems like the best place to ask my question.
I've got an Arduino Pro Micro that I'm using on a project. I'd like to be able to read in data from an RC receiver. Being an Arduino newb, I have not completely wrapped my head around the PCINT functionality that is being used in the MultiWii code.
Could one of you code wizards send me a simple sketch that lets me read 6 (or more) channels (from individual pins) into variables that get printed out to the serial monitor?
Thanks for your help,
Tim