Wireless Programming

basically miscellaneous, if it doesn't fit another sub-forum enter it here, we might even promote it to its own sub-forum
Post Reply
kochevnik
Posts: 24
Joined: Sat Jun 15, 2013 3:27 pm

Wireless Programming

Post by kochevnik »

In the Basic Tools program there is a setting for various baud rates - when I change this from 19200 to 9600 , is this allowing me to program the Basic Chip @ 9600 or is it just changing the communication settings and if I want to program the chip itself I will have to change back to 19200 ?

I loaded the simple program below - sends serial data @ 9600 baud and loaded it in Basic Tools @ 19200. Then changed the comm settings to 9600 and I get the data coming in just like it should be. Try to reprogram the chip @ 9600 and does not work.

I have a wireless serial comm device called and XRF

http://shop.ciseco.co.uk/xrf-wireless-r ... o-pic-etc/

which I have used with other mcu's before, works good, cheap - but it's default baud rate is 9600 so I would like to be able to program the basic chip @ that rate.

Possible or not ?

Thx
Matt


Code: Select all

PRINT "START"	

OUTPUT (7)
BAUD(0) = 9600 

DO

	WAIT(250)
	OUT(7) = 1
	FOR Y = 1 TO 1000
	NEXT
   	WAIT(250)
   	OUT(7) = 0
   	
   	PRINT X
   	PRINTF("HELLO")
LOOP


PRINT "END"



kochevnik
Posts: 24
Joined: Sat Jun 15, 2013 3:27 pm

Re: Wireless Programming

Post by kochevnik »

OK - couple more hours on this - I almost have this working - I ended up reprogramming the XRF to run @ 19200. I can definitely get serial info wirelessly from the BasicChip thru the XRF. I am also trying to be able to actually PROGRAM the BasicChip over the air.

Here is the link to the process I used :
http://www.openmicros.org/index.php/art ... /150-otamp

So what I did is program the chip using a USB FTDI. It blinks & sends a serial HELLO message back to let me know what is going on (see program above).
So when I open BasicTools, the chip stops processing. I can hit run or reset and the chip starts processing again - this part works for both the FTDI & the wireless XRF setup (after having first programmed the chip with the FTDI. But when I go to actually PROGRAM the chip in wireless mode, I get the output at the end of this message (very bottom - see messages from both 8.23 & 8.26). This to me looks like it programmed correctly. But when I hit run or reset after programming, I get :
run program :
Executing...
And the chip never starts up - if it did start up correctly, I would see the led flashing like normal & be getting the HELLO serial message back from the BasicChip. Just hangs at 'Executing' and the 'Stop' button lights up as if it is running correctly but it isnt.

If I hit reset after the 'failed' reprogram, I get this :
Welcome to ARMbasic Ker
like part of the message chopped off.

If I hit Stop after the 'failed' reporgram , I get this :
Welcome to ARMbasic Kernel[8.25] with Floating Point Copyright 2013, Coridium Corp.
for the BASICchip
which is the normal 'welcome' message. Hitting Run or again, gives me the same 'Executing ... ' message. this is the same message I got with my STR(single) problem - looks like it is running but it isnt.

To fix this, I go back, reprogram with the FTDI and off it goes, everything OK and back running again - until I try to reprogram with the XRF. I should note, everything else appears to work fine, Stop, Reset, Run, Load etc

So is there some way I can find out why what is happening ?

Really be great to be able to wireless reprogram these chips.

Analyzing D:/coridium/BAK/BLINK-05.bas
Programming Flash 1114...
ARMbasic[8.23e] on the PC Copyright 2013, Coridium Corp.
*+*+
... ( 0.21K code + 0.02K string)/20K 0.07/2K data programmed


Analyzing D:/coridium/BAK/BLINK-05.bas
Programming Flash 1114...
ARMbasic[8.26b] on the PC Copyright 2013, Coridium Corp.
*+*+
... ( 0.21K code + 0.02K string)/20K 0.07/2K data programmed

kochevnik
Posts: 24
Joined: Sat Jun 15, 2013 3:27 pm

Re: Wireless Programming

Post by kochevnik »

If it helps - I also have these 'AT' commands to mess with the XRF so it can change the way it sends/receives data :

http://openmicros.org/index.php/article ... -reference

Offhand - to me it seems like it is programming the chip correctly and then there is one last step/command that the software does to 'cement' or validate the programming on the chip and that is the step that isnt working.

Or maybe not :)

basicchip
Posts: 1029
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Wireless Programming

Post by basicchip »

All the BASICs setup the baud rate on UART0 for 19.2Kb after reset. They all wait for about 1/2 second to see if an ESC character comes in, if it does they drop into the Welcome Message and expect commands at 19.2Kb If no ESC comes in the user program will startup (this is in the Help by the way).

When BASICtools startup they will reset the device and send the ESC character, the assumption being that you are running BASICtools in order to re-program the parts.

As you have found your user program can switch baud rates on UART0, and can communicate to the XRF that way.

One important reason why it comes up at some fixed baud rate, is to have a predictable starting point, so that people can alter UART0 or even pin controls, and they don't end up "bricking" a part.

If your program would END, it would drop back into the monitor (which accepts commands to download programs), but it assumes the UART0 is set up correctly.

So while you could not use the standard BASICtools to program at something other than 19.2Kb, you could load programs with some other means after your program ENDs. BASIC programs are compiled on the PC and generate a file that can be downloaded to the ARM, and you could do this with some custom terminal program (or by hacking BASICtools, which we supply the source in Tcl, though be warned it is one of those programs that has evolved quite a bit over the years and is not well documented, probably should get re-written from scratch one of these days). That file is %temp%\coridium\__temp.out

kochevnik
Posts: 24
Joined: Sat Jun 15, 2013 3:27 pm

Re: Wireless Programming

Post by kochevnik »

Thx for the help - I spent most of another day trying different things - was able to dump the memory and tried to load the temp.out file 'manually' - a whole bunch of different things, but in the end, no joy. Not a big deal tho, I probably should not have spent so much time on this but the challenge got to me :)

The general serial comms seem to work fine and that's the important thing - OTAMP (over the air programming) was just a plus.

Post Reply