Friday, June 12, 2020

BC2 and LED Control with I2C

After a successful power up, I moved on to the I2Cbus interface.  On the I2C bus is the LED controller, LP5569, and the USB Power Controller, STUSB4500.  The STUSB4500 was not in ready stock anywhere, so that was a DO NO INSTALL during assembly.  The STUSB4500 is only accessed once and that is during PCB configuration, at least that is the current implementation.  So I built the Harmony 2.0 driver around the LP5569.  What I have now is a very basic driver that does the following:
  • RESET
  • Initialize
  • Configuration (enable/disable)
  • Register Dump
  • Update all PWM registers
  • Basic Write Register
  • Basic Read Register
  • Read/Modify/Write Register
There is still a lot of clean up work and optimization that needs to happen.  This is a standalone program for now, which means it will need to be integrated with the other pieces.  But I am quite happy with the current state.

There were some development issues.  The PICKIT4 does not seem to like MPLAB 4.2 very much.  It would hang occasionally and does not the PIC32 register or SFRs.  Changing back to the PICKIT3, at least solved the register and SFR issue.

The LED control in Brick Controller 2 consists of 10 LED ports.  In the original Brick Controller there were only four LED ports and this was not sufficient.  The LP5569 will control 9 LEDS either individually or in up to 3 RGB groupings.  Port 10 is under direct software control and is connected to a PWM port on the PIC32.  The intention is to have ON/OFF, Burst, Cycle and the PWM functionality on all 10 LED ports, but we will see how this goes.  The LP5569 is a much more capable device with multiple types of controls, but these advanced features will have to wait until the basic BC2 is done.

The next step is implement the PWM features of the PIC32 that will be used with the 4 motor ports and LED port 10.  I will be using LED port 0 as the prototype, since in this implementation it is much easier to observe.

Here is a quick video of a single LED with varying intensity.


Monday, June 8, 2020

BC2 Power Up

After checking for shorts on the PCB and finding none, I applied power.  I suspected it would not work without the USB Power controller and I was correct.  But grounding the control for the P_FET brought 5 VDC to the power section and all the DC-DC converters powered up. 

Then I built the Board Support Package for the Microchip MPLAB X Harmony system.  Finally did a very simple program to blink the BLUE/YELLOW USB connection LEDs that I use in all of the MyMakerTools products.   The result is below.


Next is to build the I2C driver and the application code for the LP5569 LED controller.  I have this mostly done from a previous prototype, but need to convert it to the Harmony structure.

Saturday, June 6, 2020

BC II PCBs have Arrived

Received the Brick Controller II PCBs.  Over the next few days I will be doing the necessary static testing to ensure that 1) I designed it correctly and 2) the manufacturer built it correctly.  Follow the progress here as I test these in conjunction with the MP3/FLASH module. 




Brick Buddy PC Software

Started cleaning up the PC software for the Brick Buddy line of controllers.  One single software package will work for the entire line of Brick Buddys, at least as I see them today.  The PC software will interrogate the attached device and determine what it is and then load the appropriate software options. 

When the software first starts and when no recognizable device attached, then the control center window will show this:


At this point the user needs to connect a Brick Buddy device to the PC.  Once the device is connected, the PC will begin to enumerate the device and determine it's identity.  Once the identity is determined, the window on the PC will expand to show what device is connected, device status and what if any options are available.  This is shown in the figure below.


This change should make it much easier for everyone to use the PC based software to program and control their individual Brick Buddy devices.


Wednesday, June 3, 2020

MP3/FLASH Test Platform (Update 2)



Surprisingly the FLASH portion fired right up and worked.  I am now cleaning up the code.  first step was to correct all the USB descriptors so the Brick Buddy PC software will properly recognize the device.  Since the Brick Controller II will be sold without this module, the firmware had to be modified to only check for the device once and not continually.  Dont need to be wasting PIC32 bandwidth looking for things that are not there.  Other cleanup is needed as I dig into this deeper.  But next I am going to modify the Brick Buddy PC GUI and software to handle the new controller.

Monday, June 1, 2020

MP3/FLASH Test Platform (Update 1)

The PCBs are assembled as shown below.  The MP3 decoder has not arrived yet, thus I will only be testing the FLASH drive for now. 



More later as we progress with the testing.

Sunday, May 31, 2020

MP3/FLASH Test Platform


While I am waiting for the main BCII PCB to come back, I am building a test platform for the MP3/FLASH  add on module.  I had developed the code for this module using the Microchip PIC32MX Curiosity Board, a MikroBus Click MP3 module and a MikroBus Click 64Mb FLASH Module.  There is still more code development and I thought it would be better to use the known Microchip Curisoity board to develop on than the new untried BCII PCB. 


I designed a small carrier PCB that would plug into the two MikroBus slots on the Curiosity board and pickup all the signals. 




Then the completed MP3/FLASH module would plug into the carrier board.  Here is a picture of how that will look.

Now all I have to do is assemble the two boards.  The carrier will be easy.  The MP3/FLASH module will be more challenging.  Plus the MP3 portion is handled by a VS1053B and only AdaFruit had them in stock.They are in NYC, so we will see how long this takes for them to come in.