Pololu P-Star 25K50 Micro User Manual Download Page 4

2. Contacting Pololu

We would be delighted to hear from you about any of your
projects and about your experience with the P-Star. You can

contact us

[https://www.pololu.com/contact]

directly or post on our

forum

[http://forum.pololu.com/]

Tell us what we did well, what we

could improve, what you would like to see in the future, or
anything else you would like to say!

Pololu P-Star User’s Guide

© 2001–2019 Pololu Corporation

2. Contacting Pololu

Page 4 of 46

Summary of Contents for P-Star 25K50 Micro

Page 1: ...s 16 5 2 Getting into bootloader mode 17 5 3 Compiling a program with MPLAB X and XC8 19 5 4 Programming using p load 25 6 The P Star Bootloader 26 6 1 Memory organization 26 6 2 Startup procedure 27...

Page 2: ...product 2072 not included to connect to a computer Features and specifications Programmable Microchip PIC18F25K50 or PIC18F45K50 microcontroller 32 KB flash 8 KB used by bootloader leaving 24 KB avai...

Page 3: ...ated current 1 100 mA 500 mA Auxiliary 3 3 V regulator Dimensions 1 0 6 2 0 0 7 Weight 2 1 3 g 3 5 g 1 These values are rough approximations for comparison purposes Available current depends on input...

Page 4: ...Star You can contact us https www pololu com contact directly or post on our forum http forum pololu com Tell us what we did well what we could improve what you would like to see in the future or any...

Page 5: ...Star 25K50 Micro The diagram is also available as a printable PDF https www pololu com file 0J799 p star 25K50 micro pinout pdf 161k pdf For more information about the PIC18F25K50 microcontroller and...

Page 6: ...port via a USB A to Micro B cable https www pololu com product 2072 not included The USB connection can be used to transmit and receive data from the computer and a preloaded USB bootloader makes it p...

Page 7: ...e operating no matter how low VIN is When the P Star 25K50 Micro is being powered through VIN regardless of whether USB is connected the sum of the 5V output current GPIO output current and current us...

Page 8: ...fboards breadboards https www pololu com category 28 solderless breadboards or 0 1 female connectors https www pololu com category 50 0 1 2 54 mm female headers P Star 25K50 Micro with included option...

Page 9: ...tar 25K50 Micro schematic diagram This schematic is also available as a PDF P Star 25K50 Micro schematic diagram Pololu P Star User s Guide 2001 2019 Pololu Corporation 3 P Star 25K50 Micro Page 9 of...

Page 10: ...k pdf Dimension diagram A dimension diagram is available as a PDF P Star 25K50 Micro dimension diagram https www pololu com file 0J798 p star 25K50 micro dimensions pdf 202k pdf Pololu P Star User s G...

Page 11: ...ini SV P Star 45K50 Mini SV bottom view 4 1 P Star 45K50 Mini SV pinout and components P Star 45K50 Mini SV pinout diagram Pololu P Star User s Guide 2001 2019 Pololu Corporation 4 P Star 45K50 Mini S...

Page 12: ...D serves as an indicator for when the board is transmitting serial data If you are not using serial the LED can be used as a normal LED To avoid interference with connected serial devices the bootload...

Page 13: ...to USB power For example this could allow a battery powered device to turn off the regulator and avoid draining its battery while it is connected to a computer USB power input The P Star can be powere...

Page 14: ...y default BATLEV is connected to the RE1 pin through a cuttable trace on the bottom of the board This means that RE1 can be used as an analog input to measure the external power supply voltage Cutting...

Page 15: ...shown with a vertical 5 pin ICSP programming header installed 4 2 P Star 45K50 Mini SV schematic and dimensions Schematic diagram A schematic diagram is available as a PDF P Star 45K50 Mini SV schemat...

Page 16: ...vices category but if your P Star was set up with an older driver then it might still be in Pololu USB Devices Mac OS X If you are using Mac OS X you should download and install the Pololu USB Bootloa...

Page 17: ...tton The P Star will go into bootloader mode if the RB6 line is high immediately after a reset This will work no matter what type of application is loaded on the P Star For example if your P Star is o...

Page 18: ...If the application uses USB it should disable the USB module by clearing USBEN and then wait for at least 100 ms before starting the bootloader in order to give the computer time to detect that the ap...

Page 19: ...Microchip for 8 bit PICs Both programs run on Windows Max OS X and Linux 1 Download and install the latest versions of MPLAB X http www microchip com mplabx and XC8 http www microchip com compilers 2...

Page 20: ...t use MPLAB X to the load the program onto the board 7 For the compiler select XC8 8 For the Project Name choose something like p star1 and choose the folder you want it to be in Click Finish to creat...

Page 21: ...akes up the first 8 KB of flash memory In the File menu select Project Properties In the XC8 linker category select the Additional options sub category In the Codeoffset box enter 0x2000 which is 8 10...

Page 22: ...by opening the Window menu and selecting Projects Left click the sign next to Source Files to expand it and verify that your project has no source files yet Then right click on Source Files select Ne...

Page 23: ...in and then click Finish This should create a new file named main c and open it for editing 12 Copy and paste the following code into main c Pololu P Star User s Guide 2001 2019 Pololu Corporation 5 G...

Page 24: ...tion about the hardware peripherals and registers on the PIC see the PIC18F25K50 http www microchip com PIC18F25K50 PIC18F45K50 http www microchip com PIC18F45K50 datasheet For information about MPLAB...

Page 25: ...mething like Device Pololu P Star 45K50 Bootloader Serial number 00203525 Erasing flash Progress Done Erasing EEPROM Progress Done Writing flash Progress Done Sent command to restart device The w opti...

Page 26: ...uld correspond to a NOP Entry and interrupt vectors The entry vector and interrupt vectors are remapped by the bootloader to the beginning of the application section The application s entry vector sho...

Page 27: ...as an ASCII string with a null terminator byte The extra bytes after the null terminator are all set to zero Addresses 0x80 0xA1 contain the serial number in USB string descriptor format The extra by...

Page 28: ...D are used to communicate with the USB host RB6 is driven high to turn on the yellow LED but never driven low RB7 is driven high to turn on the green LED but never driven low The bootloader does not u...

Page 29: ...C18F25K50 and PIC18F45K50 have several configuration bits in flash memory For the P Star the values of those configuration bits are shown in the table below These configuration bits cannot be changed...

Page 30: ...ig WDTPS 256 CONFIG3H pragma config PBADEN ON pragma config SDOMX RB3 pragma config CCP2MX RC1 pragma config T3CMX RC0 pragma config MCLRE ON CONFIG4L pragma config STVREN ON pragma config LVP ON prag...

Page 31: ...ls The CPU takes at least 4 cycles to execute a single instruction so it can execute up to 12 million instructions per second 12 MIPS The PCLKEN configuration bit is set to 0 so it is possible to shut...

Page 32: ...be enabled by setting the SWDTEN bit in the WDTCON register The watchdog postscaler is set to 1 256 so the watchdog timer s period is about 1048 ms Read write protection The region of flash memory occ...

Page 33: ...Pin 6 should be left unconnected In addition to making these connections the P Star must also be powered the PICkit 3 does not supply power The picture below shows one way to connect a P Star to a PIC...

Page 34: ...be directly connected to this five pin header or it could be connected through a set of male female premium jumper wires https www pololu com category 67 male female premium jumper wires This configur...

Page 35: ...5 pin programming header installed P Star 45K50 Mini SV on a breadboard shown with a vertical 5 pin ICSP programming header installed Pololu P Star User s Guide 2001 2019 Pololu Corporation 7 Program...

Page 36: ...programs for the P Star that show how to use the USB interface and other parts of the P Star The README md file in the repository has instructions for building the examples with the MPLAB Xpress onli...

Page 37: ...load it as a ZIP archive be sure to extract the files from the ZIP archive before continuing 3 Run the MPLAB X IDE 4 In the File menu select Open Project and navigate to apps hid_mouse MPLAB X Select...

Page 38: ...other example app in M Stack except for the bootloader app Where to find more information We recommend reading the README txt file that comes with M Stack For information about USB see the USB 2 0 Sp...

Page 39: ...s two types of code absolute and relocatable These instructions will show how to write absolute code where the location of every instruction and variable is known ahead of time The alternative is relo...

Page 40: ...this choice does not matter because we will not use MPLAB X to the load the program onto the board 7 For the compiler select MPASM 8 For the Project Name choose something like p star1 and choose the...

Page 41: ...category check the Build in absolute mode check box then click OK 10 Now we need to create the assembly source file Locate the Projects pane If the Projects Pololu P Star User s Guide 2001 2019 Pololu...

Page 42: ...If pic_8b_simple asm is not visible in the menu you can find it by selecting Other Microchip Embedded and then MPASM assembler 11 Choose a file name such as main and then click Finish This should cre...

Page 43: ...eet For information about MPLAB X you can find useful resources under the Help menu and in the docs directory inside your MPLAB X installation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22...

Page 44: ...your MPLAB X installation If you have questions you can post in Microchip s MPASM forum http www microchip com forums f16 aspx or the Pololu Robotics Forum http forum pololu com Pololu P Star User s G...

Page 45: ...CBASIC PRO http store melabs com cat PBP html MicroCode Studio with a simple program for the P Star 25K50 Micro 1 Download and install PICBASIC PRO from the PICBASIC PRO Compiler Downloads page http p...

Page 46: ...k Next 9 For the Programmer Filename enter p load exe Click Next 10 Click the Find Manually button and select the p load bin folder If you installed p load in the default location the bin folder can b...

Reviews: