
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
||
|
Hallo zusammen, gerade eben habe ich festgestellt, daß PicoMite ein "PIO Programming Package" enthält. Damit können I/O-Pins sehr schnell geschaltet und abgefragt werden. Google-KI: "Der RP2350-Mikrocontroller besitzt drei programmierbare E/A-Blöcke (PIO) mit insgesamt 12 State Machines (4 pro Block), die zeitkritische Schnittstellen in Hardware ohne Hauptprozessor-Last realisieren." Hier einmal ein Beispiel: 'A complete PIO implementation that toggles a GPIO pins can be implemented 'in MMBasic as shown below. 'From "PicoMite_User_Manual.pdf", Release 1.3, Page 243. 'disconnect ARM from GP0 setpin gp0,pio1 'use GP0 as output pin for PIO 1 'pio program used '0 E081 'SET pin output '1 E001 'SET pin high '2 E000 'SET pin low '3 0001 'jmp 1 'program pio 1 using an array to write the program in PIO memory, and start Dim a%(7)=(&h0001E000E001E081,0,0,0,0,0,0,0) PIO program 1,a%() 'configure pio 1 statemachine 0 p=Pio(pinctrl 0,1,,,,gp0,) 'define SET uses 1 pin, and that is GP0 f=3000000 '3051 Hz is lowest frequency CPUSPEED 200000 PIO init machine 1,0,f,p 'use default for execctrl, shiftctrl, start 'address(=0) 'start the PIO 1 state machine 0 PIO start 1,0 'PIO is independent of the ARM CPU and continues until it is stopped. 'Entering the MMBasic editor will stop the PIO. Mit Hilfe dieses Beispielprogramms ist es möglich, eine Frequenz von 1 MHz an GP0 zu erzeugen. Dabei läuft das PIO-Interface im Hintergrund, neben der normalen Programmabarbeitung! Mittels der Variable "f" kann dabei die Taktfrequenz des PIO-Controllers gestellt werden. Es ist CPUSPEED/65536 bis CPUSPEED möglich. Und der CPUSPEED liegt bei 200 MHz. Es ist also möglich, Frequenzen bis 66.7 MHz zu erzeugen! ![]() Freundliche Grüße Dietmar Meine Homepage: http://ccintern.dharlos.de/ |
| Antwort schreiben |