Page 1 of 100

Fred's firmware development diary

Posted: Sun Feb 17, 2008 1:31 am
by Fred
Hi,

Comments here: viewtopic.php?f=8&t=58&view=unread#unread

Before attempting to use any of the software found in this thread, please read our disclaimer here : http://www.diyefi.org/disclaimer.htm

Because I'm not stupid the first thing I did was extract the s19 that was on the board and working. I've saved that, and it's bigger than the ones that I downloaded that are supposed to be the same.

I verified that erase works by erasing, reseting and getting no response from it at all.

I reloaded the dump I took from it, reset, and verified that that still worked the same.

However, Something is funny about the way GCC+my memory.x+my makefile are compiling the code. I loaded my code on, but to have that happen without errors I had to disable eeprom (ok, fine) and ram (wtf??) So I have some playing around to do before my code will load and work. Of course, loading it without ram enabled is probably going to mean its a rather expensive 512K flash disk :-)

I might play for a while longer and see what I can suss out.

Fred.

Re: Fred's firmware development diary

Posted: Sun Feb 17, 2008 2:22 am
by Fred
OK, so I've confirmed why the error was occurring on load of my dumped s19 file. The dump (as I suspected) contained the Serial Monitor. Manually removing that from the dump caused the load error to cease occurring. The error did no harm because it had already written everything to flash before it occurred (block by block). attached are three files.

The first one is a raw dump (works, but gives error on load)
The second one is without the SM or vector table (doesn't work)
The third one is without the SM only (works with no error)

Now, on to finding out why my code won't load correctly.

Admin.

PS, apparently S19 files aren't allowed to be uploaded. My initial reaction was "why the hell not" but it's good because it forces you to zip things which is good practice anyway.

Re: Fred's firmware development diary

Posted: Sun Feb 17, 2008 12:12 pm
by Fred
OK, I thought I had found a clean way to configure the vector table address, however it does not work. Hopefully when I reconfigure it, it will stop trying to put them in RAM... and the code will work :-) fingers crossed.

Admin.

Re: Fred's firmware development diary

Posted: Sun Feb 17, 2008 12:43 pm
by Fred
Well, that's sorted out, however the LED never comes on, so I've got some work to do on the code. I've been ordered out for what the English call coffee (poor excuse for one really). Should make some progress by tonight.

Admin.

Re: Fred's firmware development diary

Posted: Sun Feb 17, 2008 6:09 pm
by Fred
Thanks to Alex Babkin for giving me some basic code to test against. It turns out that my problem was attempting to use ISR routines when there was no interrupt. I guess that the return sequence is different to a normal function and it messes something up...

I'm working on tidying the code up now that it functions and documenting what I have. I have some hardware to build and play with, then I can take a video of it working, post that up and cross one "mile stone" off that list!

Admin.

Re: Fred's firmware development diary

Posted: Sun Feb 17, 2008 8:45 pm
by Fred
Everything is tidied up and ready to go as far as I can tell. I've zipped up the project and s19 and I'm ready to post them as soon as I have a visual confirmation that they work as anticipated. I now have to cook dinner :-) But after that, I'm getting stuck into building some circuits to display output and capture input safely. There should be some basic code and runnable and video posted in this thread tonight.

Admin.

Re: Fred's firmware development diary

Posted: Mon Feb 18, 2008 1:06 am
by Fred
Well, it's just gone midnight, and I'm about to start work on the strip boards. There was a slight delay, read all about it here

Admin.

FreeEMS v0.0.1 released.

Posted: Mon Feb 18, 2008 4:12 am
by Fred
Matchbox20 did a song about this time of day once "It's 3am and I must be lonely" I think it went.

http://www.youtube.com/watch?v=NwRQ9wBHDyU

Attached is the s19 and the full source directory.

Don't judge me on this code, its a set of bare essentials for making those leds strobe in series at about 80rpm equivalent.

One strange thing that I noticed is that if I initialised the ports to 0 in the main method it behaved very differently than if I initialised it in the init.c file. If anyone knows why the behaviour is like that, please let me know asap. Seems very strange.

Admin.

Re: Fred's firmware development diary

Posted: Mon Feb 18, 2008 5:08 pm
by Fred
Additionally, I have started using sourceforge a little. I will continue to post the releases here too (till they get too big), however to save bandwidth, it would be better to grab them from sourceforge instead :

https://sourceforge.net/project/showfil ... _id=577573

Admin.

Re: Fred's firmware development diary

Posted: Tue Feb 19, 2008 12:45 pm
by Fred
The ADC inputs were extremely easy to access. I only had to set 4 bits in the control registers to make them scan and scan all ports and right justify the results and It worked.

http://www.youtube.com/watch?v=YIKgYhDMe58

Files are available here :

http://sourceforge.net/project/showfile ... _id=577736

and also attached.

Admin.