PMB-RC1 (Arduino Compatible)


Introduction

The PMB-RC1 board is a general purpose Atmel ATmega328 based controller that can be used for many applications. It can be programmed using the Arduino software development system.

It was designed with RC model electronics in mind, such as stability control, video OSD, LED and accessory control. For this the hardware supports 8 PPM servo outputs, a serial PPM input, GPS serial connection and OSD interface. It can operate directly from an existing 5V supply or from a 2 or 3 cell LiPo or other battery or power supply.

Hardware Features

Arduino compatible with GPSThe board is shown here before component mounting but with the GPS module and a standard SD card to indicate size.

  • Arduino Compatible
  • ATmega328P at 16MHz
  • Serial programming connector (6-pin) for FTDI cable
  • Atmel 6-pin ISP header
  • Two 20-pin I/O headers
  • All I/O connections with series 1K resistors
  • 5V I/O + two with voltage dividers for higher voltage input
  • 2 on-board LED indicators
  • Serial EEPROM position
  • RC and robotics features:
    • 8 servo channels via 4017
    • PPM serial input
    • on-board Ublox GPS receiver module (off-board GPS antenna)
    • 5V regulator allows 2 or 3 cell LiPo power supply
    • 3.3V regulator for GPS or other sensors
    • basic on-screen-display video interface (optional)
  • Can operate from a 5V supply
  • Small size 31 x 62 mm

 

The 20-pin headers will accept 20-pin ribbon plugs for easy wiring out to other circuitry.

Programming

The PMB-RC1 can be programmed using any of a number of languages and platforms. Atmel and others supply assemblers and compilers. There are also open source tools available for Windows Linux and probably Mac.

Arduino is a popular programming environment that is a version of the C language. The Arduino IDE runs on Windows, Linux and Mac, is reasonably easy to use, works well, is quite powerful and well supported by a very active community.

To keep the PMB-RC1 small and the cost down a external FTDI or USB to serial (5V TTL) cable is required. These are cheap enough from many suppliers and one cable can support a number of projects. The Arduino IDE makes it reasonably easy to connect to the PMB-RC1 which supports the reset control from the IDE during programming.

The Atmel-ISP connector can be used to program the ATmega chip with your code using a programmer like the Atmel ACR-ISP-MKII. This also allows the Arduino Bootloader to be installed.

Arduino Bootloader

The easiest way to install the bootloader is to use a Atmel AVR-ISP-MKII programmer and the Arduino IDE. Install as if it was a  Pro-Mini board with ATmega328 at 16MHz and 5V.

When the bootloader is installed, the green LED blinks.

Using Ubuntu instructions. It’s like the Arduino Mini here.

Getting Started

You will need to have Arduino already installed on your PC and a USB serial cable with a 6-pin 0.1″ pitch female plug to connect to the PMB-RC1.

Note: without any extra load connected to the board, the 5V USB-Serial cable should be able to power the board from your PC. Cables and PCs vary so this is not a sure thing, but highly likely it will work.

  1. Connect the PMB-RC1 to the USB-Serial cable and plug it into the PC
  2. If necessary, apply power to the PMB-RC1 making sure to connect any supply of more than 5V only to position 10 of J3 the servo connector.
  3. In the Arduino IDE select the appropriate board (the Pro-Mini 328 16MHz at 5V should work) and connection port.
  4. You should be ready to go.
  5. Try the LED flash test sketch (program) which should flash the LEDs on the PMB-RC1 board.

I have been using Arduino running on Kbuntu Linux which has been working well for me.

I/O Protection (voltage ratings)

The Input Output (I/O) pins are all 5 volt rated with a few exceptions for higher voltage. All I/O that connects to the ATmega chip have 1K series resistors. These provide a level of protection for the chip from short circuits and short duration over-voltage; such as an accidental connection to a higher voltage supply. A side-effect benefit is that you can directly connect LED indicators from any I/O pin to 0V without needing a series resistor.

The Atmel-ISP connector does not have protection and should not normally be used as an I/O connector.

The disadvantage of series resistors is that it does limit the available current from each pin when used as an output. If you need more current, a transistor or mosfet is the best and safest solution.

There are 2 pins on J2 that provide voltage dividers (2K2 + 1K) inputs for voltage monitoring. The maximum voltage that can be applied is 16 volts. This allows direct monitoring of batteries; 12V or up to 3-cell LiPo.

The only other place to connect more than 5V is position-10 on J3, the higher voltage supply input.

The servo PPM outputs have 100 ohm series resistors simply to limit short circuit current.

Power Supply

The PMB-RC1 circuitry operates at 5 volts.

NOTE: Applying more than 5V to the other power pins will damage the CPU and void the guarantee.

There is a 5V regulator on the board but you must connect any supply greater than 5V only to position 10 of J3, the servo connector. This can be unregulated up to 15 volts DC.

A external 5V DC regulated supply can be connected to any of the 5V and 0V pins of the IO headers J1 or J2 or any servo channel of J3. For RC application, this would normally come from the ESC or UBEC.

NOTE: There are 2 solder jumpers on the back of the board that connect or separate the servo 5V, the 5V regulator and the rest of the board. This allows the servos to be powered from a separate 5V supply or UBEC.

Servo Supply

When powering more than one or two miniature servos a external 5V DC supply will be needed to handle the higher current required. A ESC or UBEC can be used to power the servos and the PMB-RC1 or just the servos, with the PMB-RC1 powered from a separate supply. If separated, the 0V is common between the two supplies.

To separate the 5V supplies, use a soldering iron to open the jumper J7 on the back of the board. By default J6 and J7 are bridged.

Digital Servos: These can be very hostile on the 5V power supply. They often draw short but high current pulses from the supply. If the supply cannot deliver the voltage will drop, introducing noise on the supply. The danger is that if the same supply runs the rest of the board, the voltage drips and noise can cause the CPU to randomly reset. This may appear to be a software bug that you just can’t find.. but it’s not.

Use a UBEC with any digital servos.

RC Specific Features

These are probably only of use to people doing Radio Control or robotics projects but could be useful for anything requiring a servo actuator (ventilation) or a motor controller (fan or pump). PPM outputs can be used to control switches to handle heavy loads etc. Video OSD is for FPV but could also be used with security cameras etc.

PPM Servo outputs

Eight PPM outputs can be generated by the CPU by clocking the 4017 counter. The CPU resets the counter taking it back to the beginning and then each clock pulse moves the “1” to the next output. Each PPM pulse length is determined by the time between the clock pulses. The channel outputs ripple through from 0 to 9 sequentially. Outputs 1 to 8 are available on the servo pins.

There are several Arduino libraries available to make this work. The 4017 reset is connected to PD5, the 4017 clock is connected to PD9

Timing is controlled by output-compare OCR1A and its interrupt. The interrupt routine looks at a table of channel data and adds the required time to the current T1 count to determine the next output compare count. The OCR1A interrupt service checks the current position, pulsing the reset to return to channel-0 or pulsing the clock and setting the next OCR1A period.

Normal PPM (pulse position modulation) servo control uses +ve pulses ranging from 1 to 2 mS and repeating every 20mS.

PPM Serial input

This is a simple connection to a Input Capture of the ATmega that works with the 16-bit Timer-1. An interrupt routine is required to capture input transitions, determine and store PPM pulse lengths.

In a simple form it could capture one PPM channel; a 1-2mS pulse repeating every 20mS or so. The more complex method captures a series of channels in a single serial stream which can be tapped out of many RC transmitters on the trainer port, or with a bit of relatively simple trickery from some RC receivers. NOTE: many 2.4G receivers may not have a serial PPM stream available as it’s all handled within the receivers cpu. The only solutions then are to use a converter to take multiple channels from the receiver and turn it into a serial stream or use another type of receiver.

The serial PPM format varies slightly between systems. The transmitted PPM signal contains a series of channel pulses and a longer sync gap, some including the gap within the 2mS, for a pulse varying from say 0.7 to 1.7 mS with a 0.3mS gap.

Note: Some receivers output their PPM channels in sequence, 1 then 2 then 3 and so on. Some output all channels beginning at the same time. I think these are more likely the newer 2.4G receivers and less common.

GPS Receiver and 3.3V

The board supports a Ublox GPS module and provides a super-cap backup. A 3.3V DC regulator powers the GPS module. The GPS antenna is off-board. The intention was to use a mouse type antenna with internal LNA (low noise amplifier). Although heavier than on-board ceramic antennas, these external antennas work better and allow optimal positioning. The antenna lead should be kept as short as possible. To reduce size and cost, the antenna lead is soldered to the board.

On Screen Display – OSD

This is an optional extra that few applications will require. It is a hardware interface of 2 parts. The first is a LM1881 video frame and line sync detector that interrupts the CPU. The second is a driver that can superimpose either white or black pixels with an optional greyed background.

Note: this requires a lot of code support, CPU time and dedicated use of the SPI port. PPM input and output may be possible while generating OSD but you will have to be an interrupt genius to get all those ducks in a row.

Images

   
   

.

Connections

J1 is a general I/O connector

pin function – CPU ref. note Arduino ?
1 0V supply common 0V
2 0V supply common 0V
3 +5V supply +5V
4 +5V supply +5V
5 PD4 PCINT20/XCK/TO (2) . digital 4
6 PC6 RESET/PCINT14 (29) . digital
7 PD3 PCINT19/OC2B/INT1 (1) . digital 3
8 PD2 INT0/PCINT17 (32) . digital 2
9 PD0 RXD/PCINT16 (30) . digital 0
10 PD1 TXD/PCINT17 (31) . digital 1
11 +3.3V (GPS power) . +3.3V
12 0V (GPS power) . 0V
13 PC5 ADC5/PCINT13 (28) SCL analog 5
14 PC4 ADC4/PCINT12 (27) SDA analog 4
15 PC3 ADC3/PCINT11 (26) . analog 3
16 PC2 ADC2/PCINT10 (25) . analog 2
17 PC1 ADC1/PCINT9 (24) . analog 1
18 PC0 ADC0/PCINT8 (23) . analog 0
19 ADC7 (22) . analog 7
20 0V supply common 0V

J2 is a general I/O connector

pin function – CPU ref. note Arduino ?
1 0V supply common 0V
2 0V supply common 0V
3 +5V supply +5V
4 +5V supply +5V
5 PD6 res-divider digital 7
6 0V supply common 0V
7 PD7 res-divider digital 7
8 0V supply common 0V
9 PD5 4017-15-reset digital 5, timer-0B
10 PD6 . digital 6, timer-0A
11 PD7 . digital 7
12 PB0 PPM-in digital 8
13 PB1 Timer-1-OC1A, 4017 clk. digital 9, timer-1A
14 PB2 . digital 10, timer-1B, SS
15 PB4 LED digital 12, MISO
16 PB3 . digital 11, timer-2A, MOSI
17 ADC6 . analog 6
18 PB5 LED digital 13
19 Video-OSD . .
20 0V supply common 0V

J3 is the servo, PPM input and higher voltage supply connector

position channel 4017-pin   header pins
1 PPM ch-5 4017 pin 1 4017-ch1 0V / +5V / PPM
2 PPM ch-1 4017 pin 2 4017-ch1 0V / +5V / PPM
3 PPM ch-2 4017 pin 4 4017-ch1 0V / +5V / PPM
4 PPM ch-6 4017 pin 5 4017-ch1 0V / +5V / PPM
5 PPM ch-7 4017 pin 6 4017-ch1 0V / +5V / PPM
6 PPM ch-3 4017 pin 7 4017-ch1 0V / +5V / PPM
7 PPM ch-4 4017 pin 10 4017-ch1 0V / +5V / PPM
8 PPM ch-8 4017 pin 9 4017-ch1 0V / +5V / PPM
9 PPM input serial PPM CPU-PB0 0V / +5V / PPM
10 SUPPLY 15V DC maximum   0V / n.c. / +V

J4 is the Arduino Compatible programming (FTDI) connector

position function note ..
1 DTR 100n to reset ?
2 TXD data out ?
3 RXD data in ?
4 +5V supply ?
5 0V supply common ?
6 0V supply common ?

J5 is the Atmel ISP header

pin function note ..
1 MISO data ?
2 +5V supply ?
3 SCK clock ?
4 MOSI data ?
5 RESET RST ?
6 0V common ?

Additional Useful Information

Fuse bit Tutorial: Here
AVR fuse calculator: Here

.