home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   RBERRYPI      Support for the Raspberry Pi device      21,939 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,457 of 21,939   
   Peter Heitzer to john larkin   
   Re: Pi Pico Python speed   
   09 Feb 24 08:17:27   
   
   INTL 3:770/1 3:770/3   
   REPLYADDR peter.heitzer@rz.uni-regensburg.de   
   REPLYTO 3:770/3.0 UUCP   
   MSGID:  fe61dc82   
   REPLY: <4sqasihspiggr57t75cdtscmemttglrhs9@4ax.com> 9619ba18   
   PID: SoupGate-Win32 v1.05   
   john larkin  wrote:   
   >On 8 Feb 2024 08:10:20 GMT, "Peter Heitzer"   
   > wrote:   
      
   >>john larkin  wrote:   
   >>>Has anyone measured how fast a pico can do things running Python?   
   >>>Like, to start, wiggling a port pin as fast as possible?   
   >>   
   >>>I think the micro Python is an interpreter.   
   >>Yes, Python is interpreted.   
   >>I found https://wellys.com/posts/board-language_speed/   
   >>I think the performance of Micropython and Circuitpython should be   
   >>almost equal.   
   >>The nice thing is that you can test your code interactively in the   
   >>Python interpreter.   
      
   >Cool. We just did a MicroPython loop to raise and lower a port pin 4   
   >times, brute force inline code, as fast as we could. One up/down cycle   
   >takes about 14 microseconds on a Pico, with some jitter.   
      
   >We'll repeat it in c. I'm guessing that will be 20x faster.   
   I did a quick test yesterday evening using this few lines of code:   
      
   from machine import Pin   
   led=Pin(0,Pin.OUT)   
   switch=Pin(1,Pin.IN,Pin.PULL_UP)   
   while switch.value(): led.toggle()   
      
   GPIO0 was an output driving a LED. On GPIO1 I connected a momentary switch   
   to ground. On the output pin I got about 41 kHz until the switch was   
   pressed. With an endless loop:   
   while True: led.toggle()   
   I got 83 kHz.   
   I used Micropython v. 1.20; the Pico run at 125 MHz.   
   I also noticed some jitter. Normally one would not create a rectangle signal   
   this way but use a PWM channel for that task.   
      
   --   
   Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de   
      
   --- SoupGate-Win32 v1.05   
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)   
   SEEN-BY: 10/0 1 15/0 90/1 103/705 105/81 106/201 128/260 129/305 135/225   
   SEEN-BY: 153/757 7715 218/0 1 601 700 840 870 930 220/70 221/1 6 226/17   
   SEEN-BY: 226/30 100 227/114 229/110 112 113 200 206 307 317 400 426   
   SEEN-BY: 229/428 470 550 616 664 700 240/1120 266/512 267/800 282/1038   
   SEEN-BY: 291/111 292/854 301/1 113 812 310/31 320/219 322/757 335/364   
   SEEN-BY: 341/66 342/200 396/45 460/58 633/280 712/848 770/1 3 100   
   SEEN-BY: 770/330 340 772/210 220 230 5020/400 1042 5058/104 5075/35   
   PATH: 770/3 1 218/840 221/6 301/1 218/700 229/426   
      

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca