Re: February, January Pilcon Mind Maps
Dear Nehal, > Please find Mind Maps of February and January Pilcons here: Great! I took a printout of the Penti mind map and stuck it on the cupboard near my work station. :) Many thanks. R On Fri, 26 Feb 2021 at 13:12, Nehal wrote: > Hi List, > > Please find Mind Maps of February and January Pilcons here: > > https://picolisp.com/wiki/?pilcon-mindmaps > > Thanks > Nehal > > > > Volunteer and Former Intern, Free Software Foundation Boston, > Massachusetts, USA > > FOSS, Picolisp and AI Awareness Activist > > Quora English: https://www.quora.com/profile/Nehal-Singhal > > Quora हिन्दी: https://hi.quora.com/profile/Nehal-Singhal >
Re: Announce: PilBox - Building Mobile Apps in PicoLisp
Dear Alex, dear PicoLisp community, > it is now possible to build Android Apps completely in PicoLisp! Wow! This is really great Alex! Thank you! Fantastic news. R
Re: French localization
Dear Eric, > However, I will find time if Roman need help or if he wants to share > the work between us. Perfect! I have already started working on it. I have one last file to write. I will send it to you once I finish. It would really help if you could review it once. Alex can then merge the code into his master copy. Would that work Alex? R On 2 March 2017 at 12:19, CILz <cilz...@cilzone.fr> wrote: > Hi, > > I've been overbooked the past few weeks because of a new job. Hence > nothing new on my side, sorry. > > However, I will find time if Roman need help or if he wants to share the > work between us. > > Best, > Eric > > > Le 02/03/2017 à 02:50, Raman Gopalan a écrit : > > > Dear Alex, greetings! :) > > > How is the situation? Does anybody have good news? ;) > > I would like to work on this activity. I can start working on it > today. Should I just email the files to you OR is there a better way? > > R > > On 28 February 2017 at 15:33, Alexander Burger <a...@software-lab.de> > wrote: > >> On Tue, Jan 24, 2017 at 07:49:43AM +0100, Alexander Burger wrote: >> > Dear PicoLispers, >> > >> > is anybody able and interested to do the French localization of >> PicoLisp? >> >> How is the situation? Does anybody have good news? ;) >> >> ♪♫ Alex >> -- >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >> > > >
Re: French localization
Dear Alex, greetings! :) > How is the situation? Does anybody have good news? ;) I would like to work on this activity. I can start working on it today. Should I just email the files to you OR is there a better way? R On 28 February 2017 at 15:33, Alexander Burgerwrote: > On Tue, Jan 24, 2017 at 07:49:43AM +0100, Alexander Burger wrote: > > Dear PicoLispers, > > > > is anybody able and interested to do the French localization of PicoLisp? > > How is the situation? Does anybody have good news? ;) > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Embedded miniPicoLisp: Electronics For You, April 2016
Dear PicoLisp community, greetings! This is rather late news but a slightly modified version of "Reviving Lisp for smaller programmable machines" is now published in the Electronics For You magazine, April, 2016 (issue volume. 48, no. 4), India. A copy of Hempl (A modified miniPicoLisp without MiniCodeROM which runs on Mizar32 and STM32) is included in the compact disk. The source can also be downloaded from [1]. R References: [1]: http://www.efymag.com/currentissue.asp?id=12
Re: How to use PWM?
Dear JB, > When I plug the data cable into any pin on the entire board the > servo spins clockwise, even when plugged into PWM0 and (pwm-stop 0) > being called. Understand. The servo might be responding that way to the default level of the pins on the Mizar32. What does your multimeter say for the level of the pin? > clockwise, even when plugged into PWM0 and (pwm-stop 0) being called. OK; We'll get to the PWM itself in just a bit. > On another point is there a dedicated ground pin? Sure; I've used it long ago but I can't remember exactly which pin in the JTAG connector; But I can tell you how to find it. Put your multimeter in beeper mode (it beeps when the circuit is closed and keeps quiet when there's no connection). Put one of the probes of your multimeter on the GND of your voltage regulator. Well, I can tell you that the GND on the voltage regulator should the the pin in the middle. The other probe touches the pins at the 4 corners of your JTAG connector (the left most pin in the bottom row; The one closer to the SD card is the one if I can remember correctly). One of the combinations will trigger a beep; And you'll find your GND pin. > I plugged the PWM0 port into an oscilloscope and it was littered > with static, according to my electrical engineering tutor there is a > bad ground and I need to earth it. Have you tried this [1] example? Can you please check if you can reproduce this example with an LED OR even better, remove the LED and put the probes of the oscilloscope there. You should see the waveform. We can then workout your specific example. We first make sure your connections are OK. > Another another point, my LCD display still doesn't work and I don't > know what to do about it. I'll get back to you on the LCD. R References: [1]: https://github.com/simplemachines-italy/examples/blob/master/pwmled/pwm-led.l On 19 January 2016 at 21:02, J Bwrote: > I'm trying to use the PWM module to control a parallax servo I purchased. > I'm trying to get it to spin both ways as I need it for a project, I have > tried to spin the servo both clockwise and anti clockwise but I do not know > how to set a 20ms gap between each pulse, I need 1.7ms to go anti clockwise > with a 20ms gap and 1.3ms with a 20ms gap to spin clockwise. I've converted > the ms into frequency but it doesn't change the direction. When I plug the > data cable into any pin on the entire board the servo spins clockwise, even > when plugged into PWM0 and (pwm-stop 0) being called. > > On another point is there a dedicated ground pin? I plugged the PWM0 port > into an oscilloscope and it was littered with static, according to my > electrical engineering tutor there is a bad ground and I need to earth it. > > Another another point, my LCD display still doesn't work and I don't know > what to do about it. > > The attachment is a datasheet for the servo I bought. > Thanks. >
Re: Why won't the LED flash?
Dear Josh, greetings! Firstly, great to know you're playing with your board! Perfect! > Why does this small amount of code not make the onboard LED flash? I think you're not providing enough delay for you to see the off state of the LED. Why don't you try this? I've just inserted an additional delay. (pio-pin-setdir *pio-output* 'PB_29) (pio-pin-sethigh 'PB_29) (loop (pio-pin-setlow 'PB_29) (tmr-delay 0 10) (pio-pin-sethigh 'PB_29) (tmr-delay 0 10) ) > Any ideas? Also this example on the hempl wiki book: This example doesn't blink the on-board LED. It just reads the status of an input pin (SW-1 I think; the one near the voltage regulator) and turns the blue LED on when this input switch is pressed. > # And now, the main loop > (de prog-loop () >(init-pins) >(loop > (if (= 0 (pio-pin-getval button)) > (pio-pin-setlow led) > (delay 10) > (pio-pin-sethigh led) > (delay 10) ) ) ) Please copy the example on your micro-SD card and point picolisp in the direction of this file. If this doesn't happen, something strange is happening. We can then debug. But I'm almost certain it'll work :) Hempl# picolisp /mmc/user-button.l R P.S. You may also use the internal transient symbol `*tmr-sys-timer*' in the function tmr-delay. I think it uses a hardware PWM channel to generate the time (can't remember which; I'll have to see the sources again). That makes the timing accurate. On 18 December 2015 at 22:08, Joshwrote: > Why does this small amount of code not make the onboard LED flash? > (pio-pin-setdir *pio-output* 'PB_29) > (pio-pin-sethigh 'PB_29) > (loop (pio-pin-setlow 'PB_29) > (tmr-delay 0 10) > (pio-pin-sethigh 'PB_29)) > All that happens in the blue LED turns on and stays on, even though the > code clearly says for it to go from high to low repeatedly. Any ideas? Also > this example on the hempl wiki book: > > # A simple program which demonstrates > # the usage of user-buttons. > # declare pins > (setq led 'PB_29 button 'PX_16) > > # a simple delay function > (de delay (t) >(tmr-delay 0 t) ) > > # make sure the LED starts in > # the "off" position and enable > # input/output pins > (de init-pins () >(pio-pin-sethigh led) >(pio-pin-setdir *pio-output* led) >(pio-pin-setdir *pio-input* button) ) > > # And now, the main loop > (de prog-loop () >(init-pins) >(loop > (if (= 0 (pio-pin-getval button)) > (pio-pin-setlow led) > (delay 10) > (pio-pin-sethigh led) > (delay 10) ) ) ) > > (prog-loop) > > Doesn't make the LED flash it just stays on. > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Mizar32 - What order do functions have to appear?
> Scratch that, I hit enter and it worked. Great! I'm glad you're able to use your board. Have a lot of fun with it! :) Happy hacking! R On 17 December 2015 at 22:50, Joshwrote: > Scratch that, I hit enter and it worked. > > > On 17/12/15 21:14, Josh wrote: > > Sorry for waiting so long before replying. I have moved to Linux, I have > installed Picolisp and installed minicom but running minicom just returns > "minicom: cannot open /dev/ttyACM0: No such file or directory" what do I do > about this? Thanks. > > On 03/12/15 12:25, J B wrote: > > Thanks for the quick reply. I'm not using Linux, my Mizar lives at college > where I am building my project for college. The college PC's are using Win > 7 and I don't think they have any terminal software installed on them, > although HyperTerm is installed by default, it's probably blocked as I > can't find it. I may be able to get hyperterm unblocked or bring in a > portable terminal emulator on a usb stick, but I'm not sure. Do I need any > special cables for the emulator or is it just the USB power cable? Also, > once that's set up how do I invoke Picolisp? Thanks. > > -- > From: ramangopa...@gmail.com > To: picolisp@software-lab.de > Subject: Re: Mizar32 - What order do functions have to appear? > Date: Wed, 2 Dec 2015 03:30:10 +0100 > > > Dear JB, greetings! > > > So I started creating a little program to act as a digital counter > > with the blue led flashing at each change of logic state, it came to > > Perfect way to begin! > > > my attention very quickly that there is some hidden format that the > > code has to be in and some rules that I can’t find written. It seems > > Actually, nothing is hidden or implicit at all. :) So, let's fix your > problem for you. > > > to me that you can’t set a pin direction unless you are going to use > > it in the immediate program and I personally can’t seem to get > > smaller functions of “sethigh” and “setlow” to ever work. > > You can set the direction of a pin in any context in PicoLisp. The > code you have in autorun.l must set its direction. Here's how it > works. Think of it as the default state of the pin. Some pins can be > high by default; some can be low. This is MCU specific - This > particular device works this way. The same code on an LM3S8962 Texas > Instruments Cortex clone behaves the other way. > > # Will set the dir of PB_29 and turn the blue LED "on" > # automatically. > (pio-pin-setdir *pio-output* 'PB_29) > > # Will turn the blue LED "off". > (pio-pin-sethigh 'PB_29) > > So, your function should be: > > (de high (pin) >(pio-pin-setlow pin) ) > > > Is there like a comprehensive list of the way I need to be writing > > these programs? > > It's regular PicoLisp. No different. Just that it runs on the MCU. :) > > > I experiment a lot and I do not have the vga board so I have no > > console on screen, I’m kinda running blind and need all the heads up > > I can. > > Oh! This is quite easy. Can you please use a serial terminal emulator? > I use minicom. It's a nice tool. In case you don't have it, please get > it (or another of your choice) and configure it for 115200 baud, 8N1 > and no hardware flow control. So, assuming an Ubuntu GNU/Linux and > minicom: > > $ sudo apt-get install minicom > $ minicom -D /dev/ttyACM0 > > The above should get you the Hempl shell. Invoke PicoLisp directly > from the shell. You can then type away interactively - like you would > with regular PicoLisp. You can also edit PicoLisp files on your SD > card using iv, the vi clone. > > Hempl# iv /mmc/autorun.l > Hempl# picolisp /mmc/autorun.l > > Please let me know if this helps you. Good luck! > > R > > On 1 December 2015 at 23:08, J B wrote: > > So I started creating a little program to act as a digital counter with > the blue led flashing at each change of logic state, it came to my > attention very quickly that there is some hidden format that the code has > to be in and some rules that I can’t find written. It seems to me that you > can’t set a pin direction unless you are going to use it in the immediate > program and I personally can’t seem to get smaller functions of “sethigh” > and “setlow” to ever work. Is there like a comprehensive list of the way I > need to be writing these programs? I experiment a lot and I do not have the > vga board so I have no console on screen, I’m kinda running blind and need > all the heads up I can. Thanks. > > > > >
Re: Mizar32 - What order do functions have to appear?
Dear JB, greetings! Firstly, sorry for the slight delay in my reply. > terminal software installed on them, although HyperTerm is installed > by default, it's probably blocked as I can't find it. I Please see this [1] link. TeraTerm helps? OR as John suggested, Termite might work too! Thanks John! > any special cables for the emulator or is it just the USB power > cable? Nothing else at all. Just the USB power cable. :) That cable serves two purposes - board power and RS-232 emulation over USB (using Atmel's USB_CDC software stack). I'm pretty sure Mizar32 can work with Windows - I don't see a reason why it can't work. The Mizar32 should get recognized as a serial device. For that, I think you need a few drivers from Atmel. I'm not very familiar with the Windows side of things. But for a quick solution, would it be very hard for you to install GNU/Linux on Windows within a VM? (I know it's an ugly solution). I can check with the guys at SimpleMachines if they can point us in the direction of the drivers. I'll post again as soon as I have some news. > Also, once that's set up how do I invoke Picolisp? Thanks. Once you have the handshake between the PC and your Mizar32, simply press "reset" on your board. (SW-2; I guess). In any case, you're looking for the switch which is away from the voltage regulator IC. (There are just 2 switches on the board). Once reset, you should see the Hempl prompt on your serial terminal emulator. Let me get back to you with more information. R References: [1]: wiki.eluaproject.net/Terminal Emulators for eLua On 3 December 2015 at 13:25, J Bwrote: > Thanks for the quick reply. I'm not using Linux, my Mizar lives at college > where I am building my project for college. The college PC's are using Win > 7 and I don't think they have any terminal software installed on them, > although HyperTerm is installed by default, it's probably blocked as I > can't find it. I may be able to get hyperterm unblocked or bring in a > portable terminal emulator on a usb stick, but I'm not sure. Do I need any > special cables for the emulator or is it just the USB power cable? Also, > once that's set up how do I invoke Picolisp? Thanks. > > -- > From: ramangopa...@gmail.com > To: picolisp@software-lab.de > Subject: Re: Mizar32 - What order do functions have to appear? > Date: Wed, 2 Dec 2015 03:30:10 +0100 > > > > Dear JB, greetings! > > > So I started creating a little program to act as a digital counter > > with the blue led flashing at each change of logic state, it came to > > Perfect way to begin! > > > my attention very quickly that there is some hidden format that the > > code has to be in and some rules that I can’t find written. It seems > > Actually, nothing is hidden or implicit at all. :) So, let's fix your > problem for you. > > > to me that you can’t set a pin direction unless you are going to use > > it in the immediate program and I personally can’t seem to get > > smaller functions of “sethigh” and “setlow” to ever work. > > You can set the direction of a pin in any context in PicoLisp. The > code you have in autorun.l must set its direction. Here's how it > works. Think of it as the default state of the pin. Some pins can be > high by default; some can be low. This is MCU specific - This > particular device works this way. The same code on an LM3S8962 Texas > Instruments Cortex clone behaves the other way. > > # Will set the dir of PB_29 and turn the blue LED "on" > # automatically. > (pio-pin-setdir *pio-output* 'PB_29) > > # Will turn the blue LED "off". > (pio-pin-sethigh 'PB_29) > > So, your function should be: > > (de high (pin) >(pio-pin-setlow pin) ) > > > Is there like a comprehensive list of the way I need to be writing > > these programs? > > It's regular PicoLisp. No different. Just that it runs on the MCU. :) > > > I experiment a lot and I do not have the vga board so I have no > > console on screen, I’m kinda running blind and need all the heads up > > I can. > > Oh! This is quite easy. Can you please use a serial terminal emulator? > I use minicom. It's a nice tool. In case you don't have it, please get > it (or another of your choice) and configure it for 115200 baud, 8N1 > and no hardware flow control. So, assuming an Ubuntu GNU/Linux and > minicom: > > $ sudo apt-get install minicom > $ minicom -D /dev/ttyACM0 > > The above should get you the Hempl shell. Invoke PicoLisp directly > from the shell. You can then type away interactively - like you would > with regular PicoLisp. You can also edit PicoLisp files on your SD > card using iv, the vi clone. > > Hempl# iv /mmc/autorun.l > Hempl# picolisp /mmc/autorun.l > > Please let me know if this helps you. Good luck! > > R > > On 1 December 2015 at 23:08, J B wrote: > > So I started creating a little program to act as a digital counter with > the blue led flashing at each change of logic state, it came to my > attention
Re: AES on PicoLisp
Dear Mike, > I've implement AES on PicoLisp. Pure brutality and limits: Great news! I had a quick look at the files. I'm sure they can run on the Mizar32 embedded computer out-of-the-box. I'll post again when I have the chance to run it :) It's interesting - we have the FATFS on Mizar32. File I/O possible too! It would be great to enhance it for decryption. R On 7 December 2015 at 14:11, Mike Pechkinwrote: > hi, > > I've implement AES on PicoLisp. > Pure brutality and limits: > o) AES128 only > o) no decryption (boring after all this) > o) less GC mess > o) no ECB-CBC modes > o) key length only 128 bits > Works, tests passed. > > > https://bitbucket.org/mihailp/tankfeeder/src/7e40db44e61e72db4a7f172a0434fadd323a8e78/crypto/?at=default > > Next will be SHA3 and Curve25519. > > p.s. If you have something real fun to implement let me know. > > Mike > >
Re: Mizar32 - What order do functions have to appear?
Dear JB, greetings! > So I started creating a little program to act as a digital counter > with the blue led flashing at each change of logic state, it came to Perfect way to begin! > my attention very quickly that there is some hidden format that the > code has to be in and some rules that I can’t find written. It seems Actually, nothing is hidden or implicit at all. :) So, let's fix your problem for you. > to me that you can’t set a pin direction unless you are going to use > it in the immediate program and I personally can’t seem to get > smaller functions of “sethigh” and “setlow” to ever work. You can set the direction of a pin in any context in PicoLisp. The code you have in autorun.l must set its direction. Here's how it works. Think of it as the default state of the pin. Some pins can be high by default; some can be low. This is MCU specific - This particular device works this way. The same code on an LM3S8962 Texas Instruments Cortex clone behaves the other way. # Will set the dir of PB_29 and turn the blue LED "on" # automatically. (pio-pin-setdir *pio-output* 'PB_29) # Will turn the blue LED "off". (pio-pin-sethigh 'PB_29) So, your function should be: (de high (pin) (pio-pin-setlow pin) ) > Is there like a comprehensive list of the way I need to be writing > these programs? It's regular PicoLisp. No different. Just that it runs on the MCU. :) > I experiment a lot and I do not have the vga board so I have no > console on screen, I’m kinda running blind and need all the heads up > I can. Oh! This is quite easy. Can you please use a serial terminal emulator? I use minicom. It's a nice tool. In case you don't have it, please get it (or another of your choice) and configure it for 115200 baud, 8N1 and no hardware flow control. So, assuming an Ubuntu GNU/Linux and minicom: $ sudo apt-get install minicom $ minicom -D /dev/ttyACM0 The above should get you the Hempl shell. Invoke PicoLisp directly from the shell. You can then type away interactively - like you would with regular PicoLisp. You can also edit PicoLisp files on your SD card using iv, the vi clone. Hempl# iv /mmc/autorun.l Hempl# picolisp /mmc/autorun.l Please let me know if this helps you. Good luck! R On 1 December 2015 at 23:08, J Bwrote: > So I started creating a little program to act as a digital counter with > the blue led flashing at each change of logic state, it came to my > attention very quickly that there is some hidden format that the code has > to be in and some rules that I can’t find written. It seems to me that you > can’t set a pin direction unless you are going to use it in the immediate > program and I personally can’t seem to get smaller functions of “sethigh” > and “setlow” to ever work. Is there like a comprehensive list of the way I > need to be writing these programs? I experiment a lot and I do not have the > vga board so I have no console on screen, I’m kinda running blind and need > all the heads up I can. Thanks. >
Re: Announce: MCU based PicoLisp machines for sale
Oops: Missed a tiny part of it. Sorry. (*) I've tried the miniCodeROM patch for miniPicoLisp. While it works like a charm on my GNU/Linux box, there's some more work left on the AVR codebase before I can fully integrate it with Hempl. Hopefully, very soon! On 4 November 2015 at 03:03, Raman Gopalan <ramangopa...@gmail.com> wrote: > > Dear PicoLisp community, > > Greetings! I trust you're all doing well! Thank you for all the > interesting discussions in the mailing list. I have something to share > with you all. > > I'd like to announce `Hempl' [1], a software system for programming > (32-bit) machines like (hacker friendly, free as in freedom) Mizar32 > [2] in miniPicoLisp. SimpleMachines [3] produced Mizar32 > specifically for virtual machines like PicoLisp and Lua. > > Here are the Mizar32 specifications: 66MHz AVR32 CPU, 32MB SDRAM, > I2C, SPI, PWM, ADC, SD card interface, USB with UART, Ethernet (no > Lisp module yet), character LCD and VGA add-on modules. > > There are quite a few (I guess a few hundred) Mizar32 boards in the > lab in Sicily waiting to be sold. Every single board can practically > work as a tiny PicoLisp machine (runs Hempl) and can connect to a VGA > interface and a PS/2 keyboard (if that's the configuration you'd like > to use it in). > > It can also be used over the USB using an FTDI chip interface [4] or > using a (terribly slow) USB CDC stack running on the chip. (One can > also make it work over Telnet). It comes with support for most HW > peripherals. Here's how a simple PWM looks like on Mizar32: > > # Make the LED slowly fade up and down forever > # > # Connect a LED in series with a > # 330 ohm resistor between PWM0 pin > # (BUS4 pin 7) and GND (BUS4 pin 1) > > (setq >pwmid 0 # Which channel to use? >speed 3000 # PWM frequency in Hz >fadetime 1 # How many secs to fade up? >nsteps 100 ) # How many steps in the fade? > > (setq delay (/ (* (pwm-getclock tmrid) fadetime) >nsteps ) ) > > (pwm-start pwmid) > > (loop ># Fade the LED up >(for duty nsteps > (pwm-setup pwmid speed duty) > (tmr-delay *tmr-sys-timer* delay) ) > ># Fade the LED down >(for (i nsteps (ge0 i) (dec i)) > (pwm-setup pwmid speed i) > (tmr-delay *tmr-sys-timer* delay) ) ) > > Here are the key features of Hempl: > 1) Full control of the hardware platform (MCU) with miniPicoLisp (*) > 2) Shell environment for user interaction > 3) FAT file system (for the SD/MMC card interface) > 4) XMODEM protocol for convenient sharing of files with PC > 5) A tiny (monolithic) vi clone for editing PicoLisp code on-the-fly > > The Mizar32 comes with documentation [5] and also provides examples > on how to use the HW peripherals in PicoLisp. Here's an article [6] on > "Reviving Lisp for smaller programmable machines". A lot of Hempl's SW > architecture is discussed there. Thanks again Alex for putting it up! > > SimpleMachines can use some of the money from the sales of these > boards for its upcoming HW project - the Avior32. It is another MCU > development board around an ARM Cortex clone from ST. For every > Mizar32 board sold with our beloved PicoLisp, SimpleMachines will > donate a part of the sales money to PicoLisp. > > If you feel like giving us a hand, you can write an email to Sergio > Sorrenti (in CC) or order it on 4star [7]. You can then compile the > Hempl sources and type away on the Mizar32 in PicoLisp. This chapter > [8] shows how one can compile Hempl and install the firmware on the > MCU. > > Please give us your suggestions. Good day! > > R > > References: > [1]: https://github.com/simplemachines-italy/hempl > [2]: https://en.wikibooks.org/wiki/Hempl > [3]: http://www.simplemachines.it > [4]: https://www.adafruit.com/products/284 > [5]: https://en.wikibooks.org/wiki/Hempl > [6]: http://picolisp.com/wiki/!download?-A300 > [7]: http://4star.it > [8]: https://en.wikibooks.org/wiki/Hempl/Compiling_Hempl >
Re: miniCodeROM: Conditionally #including references from ram.d and
Dear Alex, I'm sorry for the delay in response. What comes to mind is using the C preprocessor to build init.s from a copy or a template. Brilliant! I'll think about the implementation and get back to you. Thanks again! Good day, R On 28 February 2015 at 13:17, Alexander Burger a...@software-lab.de wrote: Dear Raman, peripherals. For example, if one does not require the pulse width modulation functions, she can simply disable the compilation of the PWM PicoLisp module by commenting it out. ... #if defined PICOLISP_PLATFORM_LIBS_ROM ... Now with miniCodeROM, I must (in theory) place the above conditions (#ifdefs, other application specific macros for conditional compilation) in init.s and expect to find them in ram.d/rom.d. ... However, I see there's no direct way to put user specific code/macros (like the one above) in init.s. I see! Right, the init.s mechansim doesn't handle this. While this might require a tweak in gen3m.c, is there an easier way to conditionally include ROM and RAM references in main.c? (rom.d ram.d includes). What comes to mind is using the C preprocessor to build init.s from a copy or a template. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
miniCodeROM: Conditionally #including references from ram.d and rom.d
Dear Alex, dear List, Alcor6L uses platform configuration files to configure the PicoLisp build for a specific hardware target. One may then edit this file (platform_conf.h) to include/exclude Lisp support for specific hardware peripherals. For example, if one does not require the pulse width modulation functions, she can simply disable the compilation of the PWM PicoLisp module by commenting it out. #define PICOLISP_PLATFORM_LIBS_ROM\ _ROM(PD)\ _ROM(TERM)\ _ROM(MIZAR32_LCD)\ _ROM(ELUA)\ _ROM(CPU)\ _ROM(TIMER)\ _ROM(I2C)\ _ROM(SPI)\ _ROM(PIO)\ _ROM(UART)\ ADCLINE /* _ROM(PWM) */ In the older miniPicoLisp (before miniCodeROM), I had placed these conditionally compilable modules (like PWM) in tab.c like this: static symInit Symbols[] = { #if defined PICOLISP_PLATFORM_LIBS_ROM # undef _ROM # define _ROM(module)\ PICOLISP_MOD_##module PICOLISP_PLATFORM_LIBS_ROM #if defined PICOLISP_TARGET_SPECIFIC_LIBS PICOLISP_TARGET_SPECIFIC_LIBS #endif #endif {doAbs, abs}, // More code here Now with miniCodeROM, I must (in theory) place the above conditions (#ifdefs, other application specific macros for conditional compilation) in init.s and expect to find them in ram.d/rom.d. The main.c file (which then includes ram.d and rom.d) will then know the PicoLisp HW modules it has to include in the build. However, I see there's no direct way to put user specific code/macros (like the one above) in init.s. A feature in gen3m which (blindly) copies user text to ram.d may help in this situation but even if this were possible, there is no direct way to produce this information alongside what is already generated in rom.d. While this might require a tweak in gen3m.c, is there an easier way to conditionally include ROM and RAM references in main.c? (rom.d ram.d includes). R P.S. The same applies to internal immutable symbols. For example, if the terminal module isn't included in the build, there's no need to include the internal symbols *term-wait* *term-nowait*.
Re: miniPicoLisp: miniCodeROM in Alcor6L
Dear Alex, I see that the original has in these cases any const __attribute__ ((__aligned__(2*WORD))) Rom[] = { Does this make any difference? After all, I would expect 'WORD' to be 4 on a 32-bit machine. It seems to be making a difference. When I simply print the size of `WORD' (renamed to `PICOLISP_WORD' to resolve a conflict with one of avr32's device defines) I get 4. Clear. However, when I don't explicitly use the variable attribute, I run into an Unaligned memory fault. Is there another way around this? Perhaps a stack problem? Also, I'm not sure if allocating 's' in the middle of a code body is right. I always did that in an explicit code block { .. }, but perhaps current C versions can handle this. Perhaps you can debug what string exactly you get in 's'? `s[]' holds the data correctly. The code was indeed working as expected. I felt silly. It turns out that I had two copies of `pio-pin-setdir' (typo). I simply had to change it to `pio-port-setdir'. pio-pin-setdir {plisp_pio_pin_setdir} -- pio-pin-setpull {plisp_pio_pin_setpull} pio-pin-setval {plisp_pio_pin_setval} pio-pin-sethigh {plisp_pio_pin_sethigh} pio-pin-setlow {plisp_pio_pin_setlow} pio-pin-getval {plisp_pio_pin_getval} pio-pin-setdir {plisp_pio_port_setdir} -- R P.S. I will also try to run this on my stm32f103re and post the results here. On 25 February 2015 at 12:54, Alexander Burger a...@software-lab.de wrote: Hi Raman, thanks for the report! 2) I assumed step-1 should be sufficient but I ran into an Unaligned memory fault when I executed the build with step-1 alone. I then introduced variable attributes for `Rom' and `Ram' (included in main.c). any const Rom[] __attribute__ ((aligned (8))) = { #include rom.d }; any Ram[] __attribute__ ((aligned (8))) = { #include ram.d }; I see that the original has in these cases any const __attribute__ ((__aligned__(2*WORD))) Rom[] = { Does this make any difference? After all, I would expect 'WORD' to be 4 on a 32-bit machine. any plisp_pio_pin_setdir(any ex) { any x, y; // Some code here x = cdr(x); NeedSym(ex, y = EVAL(car(x))); char s[bufSize(y)]; bufString(y, s); ret = pio_value_parse(s); PIO_CHECK(ret); plisp_pio_gen_setdir(ex, NULL, ret, PIO_PIN_OP, dir); return Nil; } I would then invoke my function like this: (pio-pin-setdir *pio-output* 'PB_29) Strange, but it looks like a part of 'PB_29 is getting stripped somehow
miniPicoLisp: miniCodeROM in Alcor6L
Dear Alex, dear list, A very good morning! It has been a while! I trust you are all doing well. I finally have core miniPicoLisp (with the miniCodeROM enhancement) running on my Mizar32 (at32uc3a). While PicoLisp itself works out of the box, I had a few concerns about the microcontroller specific sections. I did exactly 2 changes to get the MCU specific functions to work. I just wanted to check if I was doing the right thing (or if I could do it better). My init.s file looks like this [1]. I have enabled the functions at the end in my local copy. 1) The MCU specific functions (unlike regular PicoLisp functions) have long names (solely for consistency); e.g. `pio-pin-sethigh'. gen3m generates 64-bit values for them (ram.d). I forced `-m32' (gcc) on the compilation for gen3m. 2) I assumed step-1 should be sufficient but I ran into an Unaligned memory fault when I executed the build with step-1 alone. I then introduced variable attributes for `Rom' and `Ram' (included in main.c). any const Rom[] __attribute__ ((aligned (8))) = { #include rom.d }; any Ram[] __attribute__ ((aligned (8))) = { #include ram.d }; Things are now (mostly) fine on Mizar32 but I'm not sure this is the right way to fix the problem. While it works on Mizar32, I'm not sure how it might respond on stm32. (64KB SRAM). Is there a better way to fix the problem? I'm yet to test all MCU specific PicoLisp functions but I quickly found one problem in one of my functions - `pio-pin-setdir' (sets port pin direction; input or output). The C implementation internally uses bufString() to get the pin value to set. Please see sample below. any plisp_pio_pin_setdir(any ex) { any x, y; // Some code here x = cdr(x); NeedSym(ex, y = EVAL(car(x))); char s[bufSize(y)]; bufString(y, s); ret = pio_value_parse(s); PIO_CHECK(ret); plisp_pio_gen_setdir(ex, NULL, ret, PIO_PIN_OP, dir); return Nil; } I would then invoke my function like this: (pio-pin-setdir *pio-output* 'PB_29) Strange, but it looks like a part of 'PB_29 is getting stripped somehow. The same function call worked before miniCodeROM but now, Lisp tells me that 'PB_2' is an invalid port. I'm yet to see the bufString implementation but do you think steps 1 2 are influencing this behaviour somehow? R References: [1]: https://github.com/simplemachines-italy/Alcor6L/blob/master/src/picolisp/src/init.s
Re: MiniPicoLisp Code in ROM
Dear Alex, Top of the morning to you! definitions in miniPicoLisp can now be put into ROM space. This helps to save precious RAM on embedded systems. Great news for applications that require PicoLisp on a microcontroller! I only had a quick look at the codebase. A lot has changed! :) Alcor6L has a mode called 'optram' (RAM optimization) which currently doesn't optimize anything for PicoLisp. One can save some RAM by changing platform configuration files and tweaking the build. This is what I used to get PicoLisp to do some crunching in 64K. The next activity for me is to get the miniCodeROM feature to compile (along with gen3m) when `optram' is set to 1 (which includes with it few disadvantages you mention in your wiki + a slight hit on performance I assume since everything is now placed in the flash). Also, currently there are many internal (MCU peripheral specific, immutable) PicoLisp symbols like *tmr-sys-timer* in Alcor6L which have to be listed in init.s. It's certainly some work. Thanks Alex, I'll post again once I've included the changes for the RAM optimization mode. Good day, R On 7 October 2014 11:57, Alexander Burger a...@software-lab.de wrote: Hi all, definitions in miniPicoLisp can now be put into ROM space. This helps to save precious RAM on embedded systems. I've put an article about how to do this into the Wiki: http://picolisp.com/wiki/?miniCodeROM ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Announce: PicoLisp on bare metal
Dear Alex, determining the size, by loading slightly modified sources into standard miniPicoLisp. The target system would have had dedicated hardware to interface with, but the project didn't get of the ground (yet?). OK. I understand. It will be really nice to port the lib/http.l codebase for Alcor6L since we have a uIP stack on the microcontroller for ethernet Apps. I'm sure I'll have many questions when I get to it (a sock library for PicoLisp on Mizar32 :) Although the uIP interface is a bit buggy, it still works. One can still use PicoLisp over a telnet session. R On 22 September 2014 12:02, Alexander Burger a...@software-lab.de wrote: Dear Raman, FYI: I did some experiments for a minimal web server (loading the full miniPicoLisp 'pil' environment plus lib/http.l, lib/xhtml.l and lib/form.l). It occupied about 500 kB. This was OK because we had a limit of 1 MB. Wow! Fantastic! But just a question. Since miniPicoLisp doesn't come with support for sock or other system specific functions, how did you manage to get lib/http.l to work with it? Am I missing something? Sorry, I didn't fully explain. These experiments were only about determining the size, by loading slightly modified sources into standard miniPicoLisp. The target system would have had dedicated hardware to interface with, but the project didn't get of the ground (yet?). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Announce: PicoLisp on bare metal
Dear Alex, FYI: I did some experiments for a minimal web server (loading the full miniPicoLisp 'pil' environment plus lib/http.l, lib/xhtml.l and lib/form.l). It occupied about 500 kB. This was OK because we had a limit of 1 MB. Wow! Fantastic! But just a question. Since miniPicoLisp doesn't come with support for sock or other system specific functions, how did you manage to get lib/http.l to work with it? Am I missing something? R On 21 September 2014 14:54, Alexander Burger a...@software-lab.de wrote: Dear Raman, on extremely small systems back then in Munich. However, I was reluctant to mention it here, because I didn't think it was in _that_ range (i.e. 128 kB (?)). Sure. The stm32f103re has just 64KB internal SRAM. PicoLisp can run on it. Wow, great! I wasn't aware of that degree of smallness :) I remember I was also able to load pilog.l (I can check the details again and get back to you on that one). FYI: I did some experiments for a minimal web server (loading the full miniPicoLisp 'pil' environment plus lib/http.l, lib/xhtml.l and lib/form.l). It occupied about 500 kB. This was OK because we had a limit of 1 MB. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Announce: PicoLisp in Hardware (PilMCU)
Dear Alex, we are proud to announce PilMCU, the Lisp Machine on a Chip! :) Fantastic! This is truly amazing. Congratulations! R On 19 September 2014 17:09, Alexander Burger a...@software-lab.de wrote: Hello List, we are proud to announce PilMCU, the Lisp Machine on a Chip! :) We, that is George Orais (who persuaded me into the project) and me. Georg built the actual machine in Verilog, and I did the changes and extensions to PicoLisp. PilMCU is an implementation of 64-bit PicoLisp directly in hardware. A truly minimalistic system. PicoLisp is both the machine language and the operating system: * Memory management is trivial, just the Lisp heap and the stack * The built-in database is extended to hold a file system * One SSD per database file for mass storage * Processes run as tasks and coroutines * Events (timing and interrupts) via a 'wait' instruction * Complex I/O protocols are delegated to peripheral chips The final hardware can be very lightweight. Low transistor count and power consumption. No overhead for an OS. It is conceivable for a later stage to put many interconnected CPUs on a single chip. At present, we have it running in the Verilog simulator, and in an emulator (adaption of the PicoLisp 'emu' architecture). How shall we proceed? We need investors (or crowdfunding) to polish, manufacture and distribute the real thing. We imagine something in the line of an Embedded Lisp Machine or a Lisp Machine Kit. Perhaps for home brewing, educational institutions and/or robotics research? Is anybody interested -- or knows people who are? For the fun of it, here is a sample session: $ make mcuvvp -M. -mtty mcu # Build and start Verilog engine : $ make emu./emu ssd@ ssdA # Or: Build and start the emulator : Now we are in an environment equivalent to the standard 'pil +'. The database is open on two image files for two SSD drives. Besides the normal, full DB functionality : (show *DB) {1} (7 . {17}) T ({2} {20} {56} {64} {105} {146}) - {1} you can call 'in', 'out', 'load' and 'rm' on files which are maintained in external symbols: : (dir) - (lib.l lib/) : (dir lib) - (btree.l db.l dbg.l misc.l pilog.l sq.l) : (in lib/db.l (read)) - (de dbs Lst (default *Dbs (_dbs 1))) : (out foo/bar/mumble.l (prinl Hello world)) - Hello world : (in foo/bar/mumble.l (line)) - (H e l l o w o r l d) : (dir foo/bar) - (mumble.l) : (cd foo/bar) - foo/bar/ : (dir) - (mumble.l) : (pwd) - foo/bar/ Path names are stored as a normal B-Tree in the DB root: : (scan) foo/bar/mumble.l {172} lib.l {2} lib/btree.l {64} lib/db.l {105} lib/dbg.l {20} lib/misc.l {56} lib/pilog.l {146} lib/sq.l {166} They point to external symbols, like {2} for lib.l. (load '{2}) is equivalent to (load lib.l) The values of these symbols hold the file size: : (show '{2}) {2} 12401 - {2} They should not have properties, and store the raw file data invisibly in dynamically maintained DB blocks. The rest of the system is standard PicoLisp :) ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Announce: PicoLisp on bare metal
Dear PicoLisp community, Firstly, Alex, thank you so much for PicoLisp! It has been so much fun. Today has been such a great day! Strawberry Pil (That's certainly a nice name!) has put me in imagination mode. Great work! I'm writing this mail to primarily answer Jerome Moliere's questions. This is also yet another announcement. am working on a connected watch project running on a very tiny hardware (MCU running a Cortex ARM 3 from ST microelectronics). I'd like to know if you have experience running PicoLisp in such environment ? Of course, you can run PicoLisp on a microcontroller; Specifically on an ARM Cortex clone such as stm32f103re (stamp module[1]). It is basically mini PicoLisp on bare metal (modified of course). I'd like to announce Alcor6L [1], a project launched by SimpleMachines, Italy [2] which aims at providing PicoLisp for MCUs (among other things). It provides complete hardware support for Mizar32 [3] (and other Cortex clones). The system provides a software interface for interactively and incrementally programming microcontrollers in PicoLisp. One can access all MCU peripherals with PicoLisp. For instance, take a look at this hello-world in PicoLisp [4]. Similarly, this is how one could use a PWM in PicoLisp [5]. I could also write to a 16x2 LDC in French like this [6]. Alcor6L on Mizar32 is also well documented [7]. I have a tiny Lisp machine at home around Mizar32 and PicoLisp [8]. It connects to a VGA monitor and a keyboard. I use it to do most of my prototypes. You can see the tic-tac-toe (written by Alex) running on it [8] (Also, please notice the *Love Lambda*. Thanks Sergio!). Yes, it could also run the game of life. It has a shell and also a tiny vi [9] clone for editing code. I've also been trying to port an emacs clone for the MCU. So far, no luck. The OS would be NuttX (RTOS). This is certainly possible. I've been able to run PicoLisp as a task in RTX. (a CMSIS compliant RTOS). Running PicoLisp within NuttX should be very possible. It would also be nice to wire the the OS specific sections. At the moment, PicoLisp on bare metal can't do any OS specific calls. We're also actually seriously considering NuttX for Alcor6L. Please give us your suggestions on Alcor6L. Jerome, please let us know if this work if useful to you. I've put Sergio in CC. He made SimpleMachines, Mizar32 and Alcor6L possible! Good weekend! R References: [1]: http://www.futurlec.com/ET-STM32_Stamp.shtml [2]: http://simplemachines.it [3]: http://en.wikibooks.org/wiki/Mizar32#mediaviewer/File:MIZAR32.jpg [4]: https://github.com/simplemachines-italy/examples/blob/master/led/blink-inf-mizar32.l [5]: https://github.com/simplemachines-italy/examples/blob/master/pwmled/pwm-led.l [6]: https://github.com/simplemachines-italy/examples/blob/master/lcd/french.l [7]: http://en.wikibooks.org/wiki/Mizar32 [8]: http://commons.wikimedia.org/wiki/File:LISP-MACHINE.JPG [9]: https://github.com/simplemachines-italy/Alcor6L/blob/master/src/iv/iv.c