LED selector

Post details of your projects here.
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

After a download to the ARMmite board, the port doesn't work right. I have to
reset the board, then it's OK. TclTerm always works.

If I power the board down, and then power up, it takes a reset before the Comm
is right.

I can live with the download problem, but I can't live with the power-up
problem. I need to control the board from a power-up.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

You aren't managing the control lines correctly in your VB program

Take a look at Cor_UDP.zip in the files section, I believe it works correctly.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

Yes, I tried:

SerialPort1.DtrEnable = True
SerialPort1.DtrEnable = False

It didn't work at first, but I then added:

SerialPort1.Open()
SerialPort1.DtrEnable = True
SerialPort1.DtrEnable = False

This does work in all cases.

I published the solution to my Kingston Jump Drive, and then loaded it onto my
Laptop. I connected the ARMmite to two different USB ports, and the program
works on either port.

I have one small problem left. If I try to send data without the ARMmite
connected, I get a Windows Error message. I need to handle that error in the VB
code, and post my own message. I saw that error in the debugger, but ignored it
while I was working on other problems.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

You can intercept such exceptions in VB.Net to handle the error condition more
gracefully by using 'try' / 'catch' / 'finally' exception handling. For details
see:

http://msdn.microsoft.com/en-us/library ... s.71).aspx

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

I uploaded 2 files. Each is a subset of the code for the LED Selection Board.
One file is Visual Basic and runs on a PC, while the other file is C languge,
and runs on an ARMmite board.

The purpose of these files is to document the Serial Interface between the PC
and an ARMmite board.

I used a method to poll to find the Serial Port on the PC. It has worked on the
PCs that I have tried, but I don't know if it will always work.

The actual VB code uses 6 buttons, and sends 6 different characters to the
ARMmite board. The code to do this is redundant.
Attachments
WindowsGUI.doc
(21.5 KiB) Downloaded 583 times
ARMmite_Program.c
(1.73 KiB) Downloaded 548 times

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

It looks like a search/replace was done, to replace 'Port' with 'SerialPort1'.
The both the Import directives and the namespaces they reference have been
corrupted... and the type names in some declarations too.

Doesn't it screw with your ARM program to reset the board every time you connect
to send it a command?


-MM

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

I did a Replace All to change port to SerialPort1 when editing it before I
uploaded it. It's fixed now.

The PC connection is only made for calbration, and should be rarly used. The
program itself is so simple that it can be restarted any time. There is no
accumulated data. Except for 6 constants everything is recalculated on every
pass.

That brings me to my next problem. The purpose of the Calibration is to update
the Constants. They are defined as Const int, and are Read Only. I suppose that
they are located in Flash Memory. The Constants must be valid on Power-up.

I need a way to change values in Flash Memory. I think that there are some notes
on that. I should be able to locate the constants in memory from the .lss file.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

I found the 5 Constants that need to be changed by the Calibration proceedure.
They are located at 0x0430, 0x0434, 0x0438, 0x043c, & 0x0440.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

> I found the 5 Constants that need to be changed by the Calibration proceedure.
They are located at 0x0430, 0x0434, 0x0438, 0x043c, & 0x0440.

Those locations are in Flash. Flash is only writeable in blocks and as far as I
know only by the ARM. In theory JTAG might be able to do it.

The easiest would be for the ARM to accept a command from the PC to update those
locations, which would have to move to an area outside the code space, otherwise
you'd be erasing parts of the code.

If you truly want it independent of the ARM, you'd have to add an external
serial FLash that could be read at startup, and with muxing controls with the PC
controls could be written independently, though that seems pretty complex way to
do it.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: LED selector

Post by YahooArchive »

I think that I can change Flash Memory in 256 byte blocks. I have set a 256 byte
array in RAM. Upon initialization, I'll copy 256 bytes from ROM into RAM. This
block will contain the data that I want to change. I'll change the RAM bytes as
necesary, then write it back into Flash memory. The program will then have the
new data to work with until it's changed again. Since it uses the data directly
from ROM, the change will be immediate. Of course the new data will be available
after a power-up.

The other bytes in the 256 byte block will remain unchanged.

If the program is updated, the data block and the array location may have to be
updated. I haven't found a way to make the compiler locate data at my requested
location.

Post Reply