Distributors

U.K

www.byvac.com

BV502 V2

The BV502 (Mini-Max) PIC32MX170

This is a small self contained microcontroller board with an on board operating system; ByPic that can be programmed using the serial interface and just a simple text file.

The pins are on a 0.1” (2.45mm) pitch and so can be plugged into a breadboard or a standard strip board. The module is intended to be plugged into a larger system or used multiple times to provide a distributed network, one for each joint on a robot for example.

**NOTE: It comes with the pins but not attached so that the user can use it either way round.

Size: 25mm x 45mm

Hardware

The board is based on a PIC32MX170F256D that has 256k Flash, 64k RAM and operates at 40MHz.

Version c, previous version is here

It has an on board regulator and so can be powered from 5V (up to 6V). All of the pins have been brought to the edges of the board in port order for convenience. The PCB markings reflect the port name and so C0 is for example port c pin 0.

5V Tolerant Pins

MCLR

RA7, RA8, RA9, RA10

RB5, RB6, RB7, RB8, RB9, RB10, RB11

RC4, RC5, RC6, RC7, RC8, RC9

Serial Interface

This is connected to UART2 (115200 Baud, 8 data bits, 1 or 2 stop bits) and is the main form of communication with the board. There is also a UART1 that can be used for any other general communication, this is accessed via the pins round the board. The MX1 has a pin select facility and so this can be directed to several alternative pins.

As an example UART1 could be any of the following:

TX    RX
A0    A2*
B3    B6
B4*   A4
B15   B13
B7    B2
C7    C6
C0    C1
C5    C3

* These pins are used in the standard ‘rookie’ software.

The UART2 interface is at the front of the board, using a USB to serial this can also supply power and reset via DTR. Programming is done via the UART 2 interface by sending text to the device. This can be saved to the processors flash to become a stand alone application.

RX: Is an input and will receive signals from a USB to serial converter or similar. It must NOT be connected to a COM port directly (i.e. the 9 pin type)

TX: Is the output

WiFi

This can be added instead of the USB to serial converter, the IDE can then be a web application.

Wifi to Serial adapter

I2C Interface

The I2C interface can either be a slave or master. It has built in 10k pull up resistors and is wholly controlled by software. A library is available for either master or slave. To use this interface the software needs to be installed first via the serial interface.

SCL: B8
SDA: B9

Power

Power is supplied to the board from either the serial, I2C or GPIO connectors. The board works at 3.3V and this is provided by the on board regulator. The maximum voltage the regulator can handle is 6V and so can be supplied via 4x1.5V cells for battery operation.

PIC32

The processor is a PIC32MX170F256D, this has 256K flash and 64K ram. A proportion of the flash is taken with the ByPic operating system. However there is still sufficient room for complex programs. The actual spare flash is approximately 133k which is good enough for several thousand lines of code.

Some other features of this processor are:

  • 40MHz clock rate
  • 20uA low current mode (may not be achievable on this device)
  • Audio features
  • ADC 10 bit
  • Charge Time Measurement Unit
  • Comparators
  • Timers (5)
  • SPI, I2C, UART x 2
  • Some pins are 5V tolerant

Circuit Diagram

Click image to enlarge(Version c) previous version is here.

SD Card

(** Requires PCB Version b and above **)

To use an SD card with this device do the following.

1) Replace the normal firmware with the SD Card firmware here

See that the log in screen is different as it attempts to mount the SD card. There is no consequence of not having a card at this stage.

2) Wire up an SD card using a suitable holder using the following wiring

PORT Description SD Card
RB15 Clock CLK (SCK)
RB6 MISO DO (MISO)
RB5 MOSI DI  (MOSI)
RB14 CS CS (SDCS)

** Don't forget the SD Card requires 3.3V. Some SD Card holders have an on board regulator in which case use the +V and connect it to the 5V pin on the SD Card holder.

3) Insert an SD card, reset and you will now see that the firmware will show a 0:/ ok prompt, this means that the SD is in place. NOTE the prompt will only show if there is an actual formatted SD card in place.

If you get error(14) See troubleshooting.

Programming

ByPic

The device has installed ByPic. This is permanently in flash and makes programming much easier. No programmer is required simply download the code using a serial connection, the code is written in text, this includes the libraries and so can be modified by the user as required.

To get started connecting the device to a serial port and using the ByPic language follow this link.

Using PICkit

The IC can also be programmed using a PICkit simply by offering up the device to 5 pins that have been arranged for that purpose. NOTE: If a PICkit is used the boot loader will no longer be available.

The above is the pin connections for a standard PICkit. At the time of writing there is no PICKit 2 firmware available that will program the MX170 so a PICKit 3 must be used via MPLAB.

SD Card Troubleshooting

If you get error 14 when trying to load a file from the SD:

MX170_~1.bas  << this must be MX170_rookie3_part1.bas
MX170_~2.bas  << this must be MX170_rookie_part2.bas

If the files are dragged across to the SD Card using Windows then they can get mixed up. If this is the case simply rename them so that MX170_~1 is MX170_~2 and MX170_~2 is MX170_~1. You can verify the contents of the file against what it should be simply by looking at them in notepad.

History

  • September 2014 - Processor changed from PIC32MX150F128D to PIC32MX170D256D
  • October 2014 - PCB has been updated (version c) it has two extra pins