Posts

Robocar (Go to eie3105p2.blogspot.com for more updated info & photos)

Image
Most updated & more info at: eie3105p2.blogspot.com Soldering Sequence Resistor 560 ohm (R20) Green LED 3mm (D1) Photo-interrupters (U1, U2). They are in opposite orientation. Capacitors (C6, C10,C11,C12) Sockets 4-pin (J5, J6), Socket 7-pin (J7) Terminal blocks (J3, J4). Beware of the orientation. Battery holder. Check orientation Switch  Other modules Ball caster Infra-red light panel (use M3 x 8 screws) Gear-box (38.2:1). Use two drilled gears in place of photo-interrupters (U1, U2).  Wires connecting motor to PCB AWG#20 40mm in length for the end connecting to motor: stripped 2mm and tinned for the end connecting to terminal block: stripped 5mm, do not tin. solder wire to tab of motor. There is no need to push wire into eyelet of the tab.   Wheel The construction of the wheels are different to the illustration provided by vendor. Please refer to the sample given. Mounting post for Control Board M3 x 10 screw + nut brass post M3 x 25

Blue Pill Adapter Board

Image
  Soldering Sequence 1. Resistor 100 ohm (R10, R11) 2. Hearder 4-pin right angle (UART1) 3. LED red x 8 pieces (D0 - D7) 4. LED green (B6) 5. Capacitor (C1, C2) 6. Socket 20-pin x 2 pieces (BD1) 7. Socket 4-pin x 2 pieces (J2, J8) 8. Header 4-pin straight (UART3) 9. Tactile switch (A12) 10. Socket, 4-pin x 2pc (J5, J6), 7-pin (J7)

Joypad

Image
  Soldering Sequence 1. Diode (D9, D10) 2. Resistor, 1 ohm (R12) 3. Socket 5-pin (J2) solder on the component side 4. Tactile switch (SB5, SB6, SB8, SB9) 5. Socket 4-pin (J1) 6. Capacitor (C1, C2) 7. Socket 17-pin x 2 pieces (BD1) 8. Header 5-pin (UART1) 9. Battery holder (BT1) 10. Joystick + screw + nut MCU Pin Assignment A9(TX1), A10(RX1) - UART1: for PC communication B10(TX3), B11(RX3) - UART3: connect to WIFI module HC06 B5(UP), B6(RIGHT), B8(LEFT), B9(DOWN), B13(JOYSTICK) - GPIO: buttons A7(ADC12_IN7) - ADC12: VRY  JOYSTICK B0(ADC12_IN8) - ADC12: VRX JOYSTICK B1(ADC12_IN9) - ADC12: battery voltage divider

Test Programs

Please go to github page . https://github.com/ensylam/test-programs

PlatformIO

Image
 A student wanted to use PlatformIO for coding. I have heard of it for a while and would like to give it a try. It has an advantage of covering many platforms: stm32, avr, pic32. It provides all the tools (compiler and uploader) in a single installation. And it is rich in editing features. It also provides a number of popular frameworks such as arduino (I don't like it but its really good for high school students and hobbyist). I just tested it for our black pill board. It works! There is only one difference. It changes the stm32 header file to stm32f1xx.h. Whereas keil uses stm32f10x.h AVR - non arduino System Clock Setting on STM32F103 Project The default setting in PlatformIO is found to be 8 MHz for APB2. The setting in Keil is 72 MHz for APB2 and 36 MHz for APB1. The following code will boost up the frequencies. RCC->CFGR = RCC_CFGR_PLLMULL9 | RCC_CFGR_PLLSRC | RCC_CFGR_PPRE1_DIV2; RCC->CR |= RCC_CR_HSEON; while (!(RCC->CR & RCC_CR_HSERDY)); RCC->CR |=

serial bootloader and stm32flash

Image
  stm32flash is a flash program for STM32 MCU to upload program using the built-in serial bootloader over UART. The jumper should be set at boot mode when the stm32flash. stm32flash -b 115200 -w file.hex -v -g 0x0 COM6 Change COM6 to whatever port you are using. "-g 0x0" means run program after flashing. Omit it when your program is driving the right wheel because UART 1 share pin with TIMER 1. Remember to detach the USB2TTL as well. Make sure "file.hex" is generated by checking the appropriate box in "Options for Target": You can run stm32flash in keil uvision by setting the external tools: "#h" is the substitution of hex file name. Remind you once again. Use the 3.3 volts line on the USB2TTL. Never connect the 5 volts line to the robot car. stm32flash use SPACE as delimiter. Therefore your project name and folder name shall not contains SPACE. Chinese characters shall be avoided.

STM32F103 Black Pill

Image
Component Order in Soldering 1) right angle header 2) 3-pin headers 3) 17-pin headers (fixture required) Pinouts The on-board LED is connected to PB12. Pull it LOW to turn on . It can be programmed either through the 4-pin header or through UART1. To program through UART1, set the jumpers to SERIAL PROGRAMMING before power up. Normally the jumpers should be set in NORMAL MAIN FLASH. Schematic