Published:2011/8/1 21:30:00 Author:Phyllis From:SeekIC
By Jim Spence
ByVac-Terminal
ByVac-Terminal does have some built-in features to get maximum performance and ease of use from the Swiss Army Knife. Version 1.0 is free from the Free Downloads section of our website: www.elektor-electronics.co.uk. As an example, to download a program from your text editor you can simply use ’Send File’. If however you are using the EEPROM memory space then there is a noticeable delay while the program line is written. An option on some terminal emulators is to send line by line and insert a delay between lines. This works fine but you have to cater for the worst case meaning the download is much slower than it should be.
Built into TCB is the ’LOADB’ command that has a very simple protocol and it works like this. After issuing the command TCB waits for a line of BASIC to be sent, when the line is received it is processed and an ASCII code 6 (ACK) is sent back to the terminal to indicate it is ready for the next line. This simple protocol works exceptionally well and the ByVac terminal has this protocol built in.
Another advantage is that it is capable of using the in-circuit programming features so assembler code can be written and downloaded into the code space.
We’ve already seen how to turn the on board LED on and off using a simple program that you typed in at the terminal. You can verify that everything is okay by typing:
Pz 1=254
Pz1=255
The above action should hove turned the LED on and then off again. You can edit TCB programs by re-typing the line, to remove a line simply type the line number. This however can become very tedious. A much better way is to create and edit the program using "Notepad" or a similar text editor and then downloading this to the board.
Open your text editor and enter the program below. This is very similar to the program you used in the TCB introduction. Note that at lines 20 and 40, instead of assigning a value directly to port 1 a logical operator (’and’ ’or’) is used. This will have the same effect but it does not affect any of the other lines on the same port. Observe also the "end" without o line number at the bottom of the program. This will tell TCB that the download has finished. In practice, if you forget to do this it still works okay.
10 for j = 1 to 10
20 pz1 = pz1 and 254
30 gosub 500
40 pz1=pz1 or 1
50 gosub 500
60 next j
70 end
500 fro k = 1 to 20
510 next k
530 return
end
Save the program with the extension TCB, e.g. "LedFlash.tcb" If you are using Notepad be careful to select all file types before saving otherwise you end up with a file called "LedFlash.tcb.txt". This only happens on the first save but it is something to be aware of.
As indicated TCB has a very simple but effective file transfer protocol that the ByVac-Terminal takes advantage of. Start the terminal and use the initial settings as shown in Figure A. Note that the "End of line wait for character" is checked. At the terminal type LOADB as Figure B.
TCB is now ready to accept a basic program using the simple protocol. Use File and ’Transmit text file" or use the forth icon from the left. Select your file "LedFlash.tcb" and it will be loaded into TCB.
The program will load, type RUN to see the fruits of your efforts. To speed things up if you alter the text transfer settings to that of Figure C. The terminal will now type in LOADB for you if you select a file with an extension "tcb". Changes to the RS232 settings require the connection between the PC and the Swiss Army Knife to be broken and then restored again.
Use the fifth icon from the left to reload the some file. The cycle for development then becomes:
1. Edit program
2. Save
3. Use the reload icon
4. RUN
5. Back to 1
If you want to stop the program running use CTRL-C or simply press reset. The beauty of an interactive system such as this is that everything is immediate, you can try things out at the command line and it will be instantly activated. At the end of development you have your finished product.
Two dice programs, one simple and the other, well, slightly less simple, to test the above sequence may be found on our website.
Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/08/01/Swiss_Army__(5).html
Print this Page | Comments | Reading(365)
Author:Ecco Reading(33527)
Author:Ecco Reading(3534)
Author:Ecco Reading(3250)
Author:Ecco Reading(3816)
Author:Ecco Reading(5341)
Author:Ecco Reading(3318)
Author:Ecco Reading(3474)
Author:Ecco Reading(3620)
Author:Ecco Reading(4017)
Author:Ecco Reading(3820)
Author:Ecco Reading(3761)
Author:Ecco Reading(3790)
Author:Ecco Reading(6105)
Author:Ecco Reading(3778)
Author:Ecco Reading(4587)