Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSP430 Cloning - in contrast to using a programmer

206 views
Skip to first unread message

JUERGEN

unread,
Jul 18, 2015, 3:53:16 PM7/18/15
to
Though this is here a Forth related group, we do have a problem which needs knowledge in C and in Forth.
For our educational projects it is important that MSP430G2553s can be programmed without having Launchpads available - scouts and schools might not have them.
To program a TI Msp430G2553 you use 6 pins:
Plus GND RX TX TST Reset. The chip does not know where the data comes from.
The Cloning does nothing else than using 4 pins of the master and transfers all of the own flash INFORMATION except for the calibration data to a slave chip.
It seems that some of the ti Apps Notes contain the information - but in C.

Our project with the 1024 scouts SOLDERING TOGETHER SMALL FORTH COMPUTERS in 2 weeks is nearly ready.
We prepared a dropbox for the participants.
Anybody interested can have a look:
https://www.dropbox.com/sh/r3jafn83seexdi0/AAAH_t-V2zN5fZ987AyETLaha?dl=0
As you can understand, the exchange of new programs between the scouts and in schools would be very easy using our Cloning Technique.

Anybody here who knows the three: MSP430G2553 - C to understand how the programming is done - and then can suggest a way to have it done in Forth?

Any help appreciated as we want to carry it over after the event from the 430 world to the ARM world afterwards.

Howerd

unread,
Jul 18, 2015, 9:09:14 PM7/18/15
to
Hi Juergen,

Thank you for instigating and progressing this wonderful project!
Sorry that I can't devote more time to this at the moment to get physically involved....
I know you have a very tight deadline, I do not have all the information about what you are doing, but here are my comments :

> For our educational projects it is important that MSP430G2553s can
> be programmed without having Launchpads available
Yes - I would go further and say that each module should be programmable in-situ, while wired as part of the 1024 piece network.
This would mean that you cannot use the BSL (BootStrap Loader) system, because when in BSL mode some of the pin functions are changed, or pins are shared with other functions, and wiring the modules together to support both normal and BSL modes would be complex, if not impossible.

I don't know exactly what is on each module's circuit board, but I presume that you do not have any additional multi-drop hardware such as an RS485 driver.
The MSP430G2553 has hardware support for two interfaces with multi-drop capability : I2C and SPI. I2C is limited to 128 devices.
One module could use SPI to write to all 1023 others by daisy chaining serial out to serial in, but this would be rather slow (reading a byte from a module could take up to 1023 x 8 clocks).

A combine solution could be to run I2C along each row of 32 modules, then connect each end module to the next row down, in a zig-zag pattern.

Each module would then be programmed _once_ (as part of the assembly procedure) with a Forth kernel that supported a simple networking protocol, plus a Forth token interpreter, inspired by the way the GA144 operates.

Given this Forth kernel, you could clone programs by connecting any two modules together ( I2C 4 wires = Gnd, +V, SDA and SCL ) and invoking the "clone to neighbour token" using a push-button, serial port connection to Hyperterminal, or some other method.

BTW Does the module have a push button? This would be useful to allocate an I2C address to each module in turn. If not, each module in a row would have to be assigned its I2C address manually.

Once the full 32 x 32 network is wired up, the Forth kernel in each module could route a connection to each module in turn, using ideas similar to the GA144's "Ganglia" and "Snorkel" concepts -
http://www.greenarraychips.com/home/documents/greg/AN011-130608-GANGLIA1.pdf

In fact, the GA144 networking is a lot more complex than what is needed for an essentially one-dimensional line of 1024 modules.

Using this technique would not allow the Forth kernel to be re-programmed in situ, but it would allow every module in the system to have its "user program" updated or its LED switched on or off.
The "user program" would be written in Forth token codes ( 1 = DUP, 2 = SWAP , 3 = C@ , 4 = C! ... 74 = LEDoff, 75 = LED on , 76 = MS, 77 = literal8 ... ).

You could also use the GA144 technique of allowing each module to wait on data from its (left) neighbour which it interprets as token codes to be executed.
This is how Ganglia and Snorkels are propagated through the network in the GA144.

To sum up :
I would not try to make your module clone another module using the BSL system - you are saving $9.99 for a launchpad at the expense of a lot of complexity in both wiring and firmware.
I would copy the extremely clever solutions that Chuck, Greg and the Greenarrays folk have discovered, about how to pass Forth around a network.

I hope these comments are useful, and are not just muddying the waters.

Best regards, and good luck,
Howerd

















JUERGEN

unread,
Jul 19, 2015, 2:14:15 AM7/19/15
to
Howard, thanks for your feedback and sorry I was not clear eoough.
In this first step we are just talking about 2 modules: one is the master and one is the slave. The master emulates the Launchpad programming function.
The master is connected (somehow , pins not defined yet) with the 6 pins mentioned about the slave: Plus, GND, RX, TX, TEST, RESET. Transfer starts after power-on and the master just overwrites defined areas of the slave flash, should take about 10 seconds, then the LED of the slave starts flashing - job done.
Example: if I have 2 with the Forth Kernel, even if if I mess up one - 6 wires jumpered, switch on - 10 second later job done. And as nearly all Flash is programmed - it includes any application on the master as well.
No programmer, no PC - ideal for kids and schools and scouts. These are the modules as on www.forth-ev.de where you can see the 6 pins ( a bit) of the little MicroBoxes.

We will give the guys access to the files regarding the project - so no paper involved, they have their mobiles and tablets anyway.
Send an email to jue...@exemark.com and I will invite you to the dropbox.
All still a bit rough - but accessible and no PC needed during the soldering of the 200 scouts per day and as well for us wondering around between the 20 soldering tables.
And as some PCs will be there - programming simple examples in Forth and flashing LEDS can start.
Reprogramming a network might a step 2.

JUERGEN

unread,
Jul 19, 2015, 3:09:57 AM7/19/15
to
On Sunday, July 19, 2015 at 2:09:14 AM UTC+1, Howerd wrote:
Thanks Howard, the BSL it is. Soon hopefully FCBSL for Forth Clone BSL.
Here we are ONLY talking about 2 of our MicoBoxes and 6 wires connected somehow, not known on Master side yet, on Slave side our 6 pins on the connector: Plus, GND, RX, TX, TEST, RESET - the same 6 wires I jumper now to program chips external to the LP.
Hardware:
2uF plus to minus
1nF and 47k for RESET
270R and LED
plus the pre-programmed MSP430G2553 and the little PCB connected to the 2 AAA cells in a TicTac Box.
The name Microcontroller in a Box - MicroBox.
The reset switch is the paper clip in your pocket, and connecting the outer 2 pins of the 6 on the male connector.
You can solder it together yourself, swap the controller, repair, pocket size, in a box, low cost - the distinguishing points compared to Arduino, RPI and MicroBit.
Oh - not to forget: The Programmable, Repairable Intelligent IO for these 3.
And native Forth - VFX MSP430LITE or 4e4th ( or any others that fit on the chip).
Using the optional Shield you have more IOs as seen in the schematic further down. Or a custom shield, easy to understand as it only takes the 20 pins of the MSP430 to a higher level ...
The PCB is 40mm long and 16mm wide. Custom shield size open, just jumper how much you need in a way you like.
20 minutes or less and you can solder it just around the socket and no PCB. All of the component values are rather flexible - so no issues to find them, even a 28 pin socket cut to size ...
The absolute minimum is just the 47k directly soldered to the chip - pin 1 and pin 16. 6 wires to program via LP - 4 of them - plus minus Rx Tx connected via USBtoTTL to the PC and you can start programming, or do the same via Bluetooth and no wires, by adding a module to the same wires ( and then as well a power supply)
Schematic copied from uMMT description:

\ Device Pinout: MSP430G2553 20-Pin PDIP - and see the Serial Interface:
\ from left 1-GND 2-3.3V 3-RX 4-TX 5-Test 6-RESET the pins on the header
\ (TOP VIEW)
\ VCC-(+3.3V)---------[01 20]----------------(GND)-VSS
\ -AN1 -(LED1) -P1.0--[02 19]->P2.6 OUT2 -470R-LED-GND
\ -RXD-Serial->-P1.1--[03 18]->P2.7 OUT3 -470R-LED-GND
\ -TXD-Serial-<-P1.2--[04 17]--Test -( programming )
\ -S2-----------P1.3--[05 16]--RESET Switch S1 --
\ AN2-------- P1.4--[06 15]---P1.7 S3-------
\ --Sound-Out-- P1.5--[07 14]->P1.6 PWM OUT-270R/LED/
\ >(R to +) IN0 P2.0--[08 13]->P2.5 OUT1 -470R-LED-GND
\ >(R to +) IN1 P2.1--[09 12]->P2.4 OUT0 -470R-LED-GND
\ >(R to +) IN2 P2.2--[10 11]--P2.3 IN3 -- (R to +)---<

\ NOTE: In this program uMMT the 4 Inputs IN0..IN3 are internally
\ programmed, so an internal resistor is connected to Vcc;
\ as result, open inputs show the state of HIGH to the processor.
\ As well, please note that some of the functions will be
\ used later, not as part of the basic uMMT project described here.
\ Pin 14 PWM is connected to the resistor 270 Ohms and the LED to Ground.

And if you are into Wearables - we are planning a W-MicroBox - 2 little PCBs wrap around a 2032 cell. Then for the more advanced in SMD.

Jan Coombs <Jan-54 >

unread,
Jul 19, 2015, 5:10:45 AM7/19/15
to
On Sat, 18 Jul 2015 12:53:15 -0700 (PDT)
JUERGEN <epld...@aol.com> wrote:

> Though this is here a Forth related group, we
> do have a problem which needs knowledge in C
> and in Forth. For our educational projects it
> is important that MSP430G2553s can be
> programmed without having Launchpads available
> - scouts and schools might not have them. To
> program a TI Msp430G2553 you use 6 pins: Plus
> GND RX TX TST Reset. The chip does not know
> where the data comes from. The Cloning does
> nothing else than using 4 pins of the master
> and transfers all of the own flash INFORMATION
> except for the calibration data to a slave
> chip. It seems that some of the ti Apps Notes
> contain the information - but in C.


You've probably been looking at the USB bootstrap
loader project. [1]

The bootstrap programming technique is documented
separately. [2]

There will need to be a small bit of logic in the
cloning lead to generate the required startup pin
sequencing to get the target into bootstrap mode.

The remaining serial port protocol can be written
in Forth, provided that the comm ports will
work reliably at 9600 baud.


> Our project with the 1024 scouts SOLDERING
> TOGETHER SMALL FORTH COMPUTERS in 2 weeks is
> nearly ready. We prepared a dropbox for the
> participants. Anybody interested can have a
> look:
> https://www.dropbox.com/sh/r3jafn83seexdi0/AAAH_t-V2zN5fZ987AyETLaha?dl=0
> As you can understand, the exchange of new
> programs between the scouts and in schools
> would be very easy using our Cloning Technique.
>
> Anybody here who knows the three: MSP430G2553 -
> C to understand how the programming is done -
> and then can suggest a way to have it done in
> Forth?
>
> Any help appreciated as we want to carry it
> over after the event from the 430 world to the
> ARM world afterwards.


Yes, all the better if you can feed the interest,
and keep the network of users intact after he
main event.

In theory you could use a subset of your six
pins, and use JTAG, but I've not seen any docs
about this yet, and the Forth code for
bit-banging this would be more complex.

Jan Coombs
--
email valid, else fix dots and hyphen
jan4clf2014@murrayhyphenmicroftdotcodotuk

[1] [USB] Bootstrap Loader (BSL) [open-source
project] for MSP low-power microcontrollers
http://www.ti.com/tool/mspbsl

[2] MSP430 Programming Via the Bootstrap Loader
(BSL)
http://www.ti.com/lit/ug/slau319j/slau319j.pdf




Howerd

unread,
Jul 19, 2015, 5:49:16 AM7/19/15
to
On Saturday, July 18, 2015 at 8:53:16 PM UTC+1, JUERGEN wrote:
Hi Juergen,

> Thanks Howard, the BSL it is. Soon hopefully FCBSL for Forth Clone BSL.
I think I was trying to solve the next problem!

BTW how are you planning to connect the devices together (in step 2)?
I notice a resistor connected to a common wire on your 16 module setup...

Best regards,
Howerd

JUERGEN

unread,
Jul 19, 2015, 2:39:27 PM7/19/15
to
A Simple Protocol as you probably would expect from me - just the additional resistor and no other hardware - all battery powered units are having the RX connected to the master who feeds them via the serial interface. They have their position number and pick out the data they need. Resistors are needed for safety as all of the battery voltages are different.
Could work without batteries - but then 1024 x 10mA = 10A and a lot of spikes ...
As well if a unit fails - this LED just stays dark or on.

And if we add a neighbour wire connection we have a back channel - other options open and to be defined.

JUERGEN

unread,
Jul 19, 2015, 2:44:17 PM7/19/15
to
Jan, TI was surprised when I suggested the CLONING - they tried it and it worked - in C. This I was told by TI technical marketing US last year.
Yes, there will be a few more connections to get the slave into programming mode, but I was told it is ok - obviously not yet in Forth ...
but should be only a bit of IO toggeling I assume. There are 14 IO pins

Jan Coombs <Jan-54 >

unread,
Jul 20, 2015, 3:11:15 AM7/20/15
to
On Sun, 19 Jul 2015 11:44:16 -0700 (PDT)
JUERGEN <epld...@aol.com> wrote:

> On Sunday, July 19, 2015 at 10:10:45 AM UTC+1, Jan Coombs
> wrote:
> > On Sat, 18 Jul 2015 12:53:15 -0700 (PDT)
> > JUERGEN <epld...@aol.com> wrote:
> >
> > > Though this is here a Forth related group, we
> > > do have a problem which needs knowledge in C
> > > and in Forth. For our educational projects it
> > > is important that MSP430G2553s can be
> > > programmed without having Launchpads available
...
> > > Anybody here who knows the three: MSP430G2553 -
> > > C to understand how the programming is done -
> > > and then can suggest a way to have it done in
> > > Forth?

> >
> > [2] MSP430 Programming Via the Bootstrap Loader
> > (BSL)
> > http://www.ti.com/lit/ug/slau319j/slau319j.pdf
>
> Jan, TI was surprised when I suggested the CLONING - they
> tried it and it worked - in C. This I was told by TI technical
> marketing US last year. Yes, there will be a few more
> connections to get the slave into programming mode, but I was
> told it is ok - obviously not yet in Forth ... but should be
> only a bit of IO toggeling I assume. There are 14 IO pins

Yes, if an extra two pins are available then the logic in the
cloning lead can be eliminated, but this makes the connections
on the host board more complex.

Good labelling and clear instructions will be important to
the life of your boards!

Good scouting, Jan Coombs.

JUERGEN

unread,
Jul 20, 2015, 4:09:30 PM7/20/15
to
A Master set of 2 10 pin headers and
a Slave set of 2 10 pin headers
should do the job
or there might be less, depending on where the needed pins are.

Jan Coombs <Jan-54 >

unread,
Jul 20, 2015, 6:16:21 PM7/20/15
to
On Mon, 20 Jul 2015 13:09:29 -0700 (PDT)
JUERGEN <epld...@aol.com> wrote:
> > > > > ... For our educational projects it
> > > > > is important that MSP430G2553s can be
> > > > > programmed without having Launchpads available

> > > > [2] MSP430 Programming Via the Bootstrap Loader
> > > > (BSL)
> > > > http://www.ti.com/lit/ug/slau319j/slau319j.pdf

> A Master set of 2 10 pin headers and
> a Slave set of 2 10 pin headers
> should do the job
> or there might be less, depending on where the needed pins are.

The six pin header is just right for the target:
0V, ~3V, RxD, TxD, /RST and TEST

For the source you need to be able to sequence /RST and TEST
correctly to put the target in BSL mode (see pg 6 of BSL Users
Guide)

These could be driven by any two free pins on the source micro.

The target memory can then be written using the serial port
protocol detailed in the above Guide.

HTH, Jan Coomb.
0 new messages