In The Ever lasting Chain Of Experiments The Next Project, ultrasonic anti-fouling for boats.
So wrote the soft, could just make a number of inceasing freuencies with fixed times.. Here I will try to explain the principle of linked list to you new progrummers. I like linked list because, well, you can do many things with it. Slightly more difficult to progrom than just increasing counters etc, but so much more versitile.
After reading some papers on the effect of ultrasonics on lifeforms in the water, and especially on boat huls, it seems to me that there are as many opinions, tests, and different results, as experiments.
Now would it not be nice to be able to specify a list of frequencies excecuted in any order you want for any duration you want! And it should be possible to change that in a simple way, in this case I chose RS232 at 4800 Bd serial link (something to do with NMEA but that is an other story).
And in asm of course.
So this morning while watching Alaska survival race or something on what was it channel, why do it to yerself, but OK, gave me courage to finish the code now one hour exactly after that. This is the asm:
formatting link
This is the help menu (type h for it)
Panteltje (c) anfo-0.2 Commands DnnnnnENTER set day, range 0-65535 EnnNTER select entry number in linked list to program, range 0-39, default 0 GnnnnnENTER set clock speed calibration, timer0 reload for 100 ms, default 59285 HnnENTER set hour h help (this) LnnENTER set cycle by cycle current limit, range 0-31, default 16 MnnENTER set minute NnnENTER set pointer to next entry for selected entry, range 0-39, default 1 RnnnENTER set number of 100 ms waits between frequency changes for selected entry, range 0-255, default 3 (300 ms) FnnnENTER set frequency in kHz for selected entry, range 0-100, default 20 kHz v print status Z1234ENTER enter test mode, default off z disable test mode
Below is the status report if you type 'v'
Now here you can see the idea of the linked list:
The program starts at entry 0 at the top, send 20 kHz for 600 ms, then jumps to entry 1.
entry 1 sends 30 kHz for 200 ms, then jumps to entry 2
entry 2 sends 40 kHz for 300 ms and then (here comes the versatility - non linearity) jumps to entry 4
entry 4 sends 70 kHz (no idea if these transducres like that) for 500 ms, and then jumps to entry 0 again, and it all starts over again.
You can specify any entry and it parameters and where it jumps to, so any sequence, or even jump to itself for just one frequency.
All settings saved in EEPROM.
Got the idea?
clock calibration 59285 current limit 16 days 0
0:1.40 test mode n selected entry 2
0 : 20 kHz 6 1/10 s next 1
1 : 30 kHz 2 1/10 s next 2
2 : 40 kHz 3 1/10 s next 4
3 : 255 kHz 255 1/10 s next 255
4 : 70 kHz 5 1/10 s next 0
5 : 255 kHz 255 1/10 s next 255
6 : 255 kHz 255 1/10 s next 255
7 : 255 kHz 255 1/10 s next 255
8 : 255 kHz 255 1/10 s next 255
9 : 255 kHz 255 1/10 s next 255
10 : 255 kHz 255 1/10 s next 255
11 : 255 kHz 255 1/10 s next 255
12 : 255 kHz 255 1/10 s next 255
13 : 255 kHz 255 1/10 s next 255
14 : 255 kHz 255 1/10 s next 255
15 : 255 kHz 255 1/10 s next 255
16 : 255 kHz 255 1/10 s next 255
17 : 255 kHz 255 1/10 s next 255
18 : 255 kHz 255 1/10 s next 255
19 : 255 kHz 255 1/10 s next 255
20 : 255 kHz 255 1/10 s next 255
21 : 255 kHz 255 1/10 s next 255
22 : 255 kHz 255 1/10 s next 255
23 : 255 kHz 255 1/10 s next 255
24 : 255 kHz 255 1/10 s next 255
25 : 255 kHz 255 1/10 s next 255
26 : 255 kHz 255 1/10 s next 255
27 : 255 kHz 255 1/10 s next 255
28 : 255 kHz 255 1/10 s next 255
29 : 255 kHz 255 1/10 s next 255
30 : 255 kHz 255 1/10 s next 255
31 : 255 kHz 255 1/10 s next 255
32 : 255 kHz 255 1/10 s next 255
33 : 255 kHz 255 1/10 s next 255
34 : 255 kHz 255 1/10 s next 255
35 : 255 kHz 255 1/10 s next 255
36 : 255 kHz 255 1/10 s next 255
37 : 255 kHz 255 1/10 s next 255
38 : 255 kHz 255 1/10 s next 255
39 : 255 kHz 255 1/10 s next 255
Yes there is an hour counter too, days, hours is difficult... I disabled the OLED driver code in the asm isting as the OLED is not connected yet (else get error messages from i2c driver), and same for the cycle by cycle current limit as I am still waiting for transformer cores. But this is just to explain linked lists to you new progrummers.
As you can see no need for C, BASIC, snakes, or whatever crypto or dangerous animals, just simple asm.
The video:
formatting link
hard to see the .5 uS dead time beween the two push pull drive signals, but it is there.
ASM is cool, fast, simple ~/compile/pantel/anfo_pic # jppp18 -i anfo.hex -e -p -Y parport_data=0x378 Loading hex file: Program 7574 bytes at address 0x000000 ID 0 bytes at address 0x200000 Config 14 bytes at address 0x300000 EEPROM 0 bytes at address 0xf00000 Erasing chip. Writing program space. Writing config space. Verifying program space. Verifying config space. Ready.
7.5 kB (yes kilobyte)
Maybe I should add some more default frequenies, already much better than whatever else is available I think. Anyways the linked list in EEPROM saves you from reprogramming the chip if new research shows different freqencies.
Just a snapshot, need coffee now.