Thursday, June 17, 2021

Scripting Part 2


The scripting language is mostly done now.  One new item is start script on power up.  This will be a control bit set by the PC/Mobile.  It can be cancelled by simply sending a HALT script command.  This makes installation for shows and the like, much simpler.  Connect the Brick Controller to a power supply and the script is running.  

Now I need to finish the MP3 section.  I would like to show it at #bricksbythebay.



Tuesday, June 15, 2021

Bricks By the Bay


 This weekend (virtual).  You can get tickets here.

We will be showing our line of Brick Controllers, Power Supplies and new Soft Wear.

We will be presenting on Saturday between 4PM and 5PM PDT.




Brick Controller Enclosure


What we have here is an enclosure for the USB Power supply and the Brick Controller.  These are designed mostly for the MOCs that I build.  There main purpose is to attach to the back of the MOC and provide a support methodology for the small wires that are used to light the MOC.  I have generated a quick instruction set that can be found on the web site, here.  Below is a short video explaining how it works.



Monday, June 14, 2021

Daughter Card for Brick Controller 2

Spent more time on this than I wanted.  At first I thought there was a PCB error, then realized I had swapped the two SPI ports from the proto I built earlier.  This meant having to chase down ANSEL, TRIS and port settings on the PIC32.  Once that was solved, the drive registered with Windows and we were off and running.  One interesting item is any SPI baud rate above about 500KHz has no effect on the time to write to the FLASH memory (SST26).  For now I dont care, as long as it reads fast enough to keep the MP3 decoder pipeline full.

Next was to place the MP3 decoder chip on the daughter card.  This again was chasing down incorrect settings on the PIC32, but it was finally started to respond.  Now I need to connect a headphone jack to the board and see if it is decoding properly.  The PCB design has a class D amplifier on it, I just have not improved my soldering skills enough to try it.


Wednesday, May 26, 2021

Scripting Part 1

Overview

Multiple things going on, but mostly been working on the scripting language.  I decided to put my head down and work through the issues.  I am finally at the 98% point.  There are still commands to implement and testing to be done, but it finally works.

Converting to 64 bit instructions was a complicated process.  In the original Brick Buddy, there were 4 motors and 4 LEDs.  This allowed for the state of these devices to be coded into one 32 bit command.  Thus on execution, the 4 motors and the LEDs could be updated in a single instruction.  The Brick Buddy 2 has PWM control for both the motors and the LEDs.  The PWM value is contained in an 8 bit value.  Thus for the 4 motors and 10 LEDs we need 112 bits. 

 

Script Structure

The command format needed to change.  The upper 20 bits are consistent throughout.  The upper 8 bits is the command.  Instead of 4 bits in the previous 32bit format, this provides more flexibility for commands.  The next 12 bits is the time stamp.  I considered expanding this, but 409.6 seconds (over 6 minutes) still seems adequate for any script.  I am sure someone will come up with a need for more, but for 99% of the users this will be adequate.  The remaining 44 bits are command dependent.  

The motor command fit nicely into 64 bits.  The lower 32 bits contain the PWM value for each motor.  The next 8 bits contain the motor state (OFF, FWD, RVS, BRAKE) for each motor.  The LED command got more complicated and was broken into three commands, LED 1-LED 4, LED 5-LED 8 and LED 9-LED 10.  Again the bottom 32 bits contain the PWM value and the next 12 bits contain the LED mode (OFF, STEADY, BURST, CYCLE, PULSE).  

The remaining commands for WAIT, INPUT and MP3 functions still need to be worked out, but these are simple compared to the complexity of the Motor and LED commands.

 

Implementation

The major problem in moving from PC/Mobile control to script control, was changing the underlying structure from a single device update to multiple devices simultaneously.  As pointed out earlier, the 32 bit structure with all the Motors and LEDs in one command was identical to what the PC/Mobile control was doing.  But in the 64 bit structure, many devices could be updated simultaneously with 4 commands or more being executed in the same time period.  Fortunately I had built most of the underlying functionality to handle this, but middle layer was geared toward the single control of the PC/Mobile interface.  This is now fixed, but it came at a price of some major reorganization.

 

 

Wednesday, April 21, 2021

Development - LED Control #3

Here is what the PC GUI end up as.  It is a little busy and I may change the theme to distinguish it from the current version.  I like that it will match the Android app.  Except the Android app has separate screens for motor and LED control.  I went with labeling brightness here, to make the Android APP more obvious.  You generally start with the PC first for development, then use the Phone to do actual control.


Still to do some cleanup and then move on to Motor Control.


Bricks By The Bay - Update #1

 

 


Looks like we will be doing virtual vending at the Bricks By The Bay 2021.  We are starting to work on what we will be showing and what specials we will be offering.  So follow us and Bricks By The Bay to see what is happening and when. 

Twitter

#makerpower  #bricksbythebay

Facebook

@mymakertools  @bricksbythebay

Instagram

#mymakertools  #bricksbythebay_official