Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:31 30 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite PIO Assembler (PIOASM) via MMEdit5 and MMReplace

Author Message
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 06:55am 15 Jan 2023
Copy link to clipboard 
Print this post


???????????????????????????????????????????????????????????????????

»»»»  Picomite PIO Assembler (PIOASM)  ««««
? Available for Linux and Windows 64 bit
? Embedded in MMReplace addon for MMEdit5

This post details a Picomite PIO Assembler for PIO instructions for the Picomite PIO controllers. Its my contribution inspired by @Volhout's excellent tutorial on the PIO Explained Picomite and @Mixtel90's initial work on the Picomite PASM assembler.

It is embedded into the existing MMReplace - Addon for MMEdit Version 5. So to use it you will need to use MMEdit5 available from here  with the MMReplace Addon for MMEdit5 installed. (Now available for both Linux and Windows)
Essentially two new directives  are added:
#PIOSTART   -indicates the start of PIO source code.
#PIOEND     -indicates the end of the PIO source code.

When the MMBasic code with the embedded PIO source is sent via MMReplace back to MMEdit or to MMCC to load, the PIO source is assembled and commented out, then the relevant MMBasic SETPIN ,PIO commands to program the PIO, Initialise the PIO and Start(optionally) the PIO  state machine are inserted.

The PIO source has it own directives which provide all the information to allow the PIO Assembler to fully set the EXECCTRL, PINCTRL and SHIFTCTRL registers so the MMBasic PIO helper functions are not required.

The use to labels in the source is supported so you don't have to hard code the JMP addresses.

The MMEdit Actions Menu

 
The MMReplace --> MMEdit option will load the process code back to another Tab in MMEdit. Comments will be preserved.

The MMReplace --> MMCC option will load the processed code directly to the Picomite via MMCC, comments will be removed. If any syntax or out of range errors in the PIO source are detected the code is not loaded and a window will open to show the errors.

A third option is added to the MMEdit5 Action menu
MMReplace --> PIOCheck
This will not load to either MMEdit or MMCC, but will only process the PIO source and display the result in a window. This is meant to help in development of PIO code. The window will show the resultant generated PIO code and MMBasic commands as well a display any syntax errors or out of range parameters detected.

House Keeping
To get the PIO assembler you need to install the latest MMReplace from the MMReplace thread. The MMReplace files and documentation will be maintained in that thread.

This Picomite PIO Assembler thread should be used for any issues/comments/suggestion on the PIO Assembler.
The MMReplace executable may be added to this thread from time to time to post a quick fix to any issues with the PIO Assembler functionality and would be relevant until the MMReplace thread and install package is updated with the fix and any documentation.


The Picomite PIOASM Source
The PIO source instructions are embedded into the MMBasic program. The new directive
#PIOSTART is used to indicate the start of the PIO code.
The directive
#PIOEND indicates the end of the PIO source.
The PIO code consists of a number of directives to tell the assembler the information it requires to be able to assemble the instructions which follow.
You can use as many pairs of the #PIOSTART #PIOEND directives as required to program  the required number of state machines.
C-style block comments are supported via /* and */
#DEFINE, #IFDEF, #ELSE, #IFNDEF and #ENDIF conditional statement allow code to be conditionally compiled.
And addition directive which is placed before the #PIOSTART directive can be used to control the behaviour of the Assembler.
#PASMCFG [nosetpin] [noinitiate] [showregisters]
Generally this is not required.
nosetpin if present will make the SETPIN pin ,PIOx commands into comments, if you don't want them in the output.
noinitiate will do the same for PIO INITIATE commands
showregisters was used during development and has be left active. It causes the relevant register to be shown with before and after values when any directive is processed by the compiler. Useful if you think its not doing the correct thing.


The Picomite PIOASM Directives
The Directives are listed below. These include the directives as described in RP2040 Datasheet section 3.3.1 as well as additional ones to allow the Picomite PIOASM to produce the complete MMBasic commands.These are used to directly set the relevant EXECCTRL, PICTRL and SHIFTCTRL 32 bit registers so their full meaning/effect can be by referencing the RP2040 Datasheet section 3.7 Register List where the bits in each register are detailed.

Where a directive or an instruction requires a value, these can be entered as decimal, hex, binary, exponential format or as GPx as desired. i.e.
63000000 , 63e6, 5, &b11111, &h1f and GP5 are all valid formats for a value.
In addition for instruction JMP addresses a label can be used.

'--- MANDATORY Directives. Required for each program.
.program <program name> 'tells the assembler it a new environment
.pio  [0|1]              'nominates the PIO to use.
.sm  [0-3]               'nominates the state machine
.frequency 63e6         'needed for PIO Initiate command.
.origin [0-31]          'Indicates which instruction the sm starts at.

'--- Directives added in the instruction section.
.wrap_target    'Indicates the start of the main loop - used to set EXECCTRL register.
.wrap           'Indicates the end of the main loop used to set EXECCTRL register.


The following directives are only required if the default value is not suitable.

'----Directives require to set EXECCTRL register ----
' Only required if you need to change the default value.
.jmp_pin GP0       'GPIO number used as condition for JMP PIN instuctions. Range(GP0-GP29) -Default is 0
.out_en_sel 0     ' Sets OUT_EN_SEL bits 23:19 in EXECCTRL register. range (0-31) i.e 5 bits default 0
.inline_out_en 0  ' Sets INLINE_OUT_EN bit 18 in EXECCTRL register. range (0-1) i.e 1 bit    
.out_sticky 0     ' Sets OUT_STICKY bit 17 in EXECCTRL register. range (0-1) i.e 1 bit  
.status_sel 0     ' Sets STATUS_SEL bit 4 in EXECCTRL register. range (0-1) i.e 1 bit default 0
.status_n 0        ' Sets STATUS_N bits 3:0 in EXECCTRL register. range (0-15) i.e 4 bits  default 0

'----Directives require to set PINCTRL register---
' only required if you need to change the default value.
.sideset_base 0      'The pin to which the LSB of the SIDE value is written.The next significant bits written next pins.Range(GP0-GP29) default 0
.set_base 0          'lowest numbered pin asserted by SET PINS or SET PINDIRS instructions.range(GP0-GP29)
.set_count 5         'no of pins asserted by a SET. Range (0-5) - default is 5
.out_base 0          'lowest numbered pin asserted by OUT PINS,OUT PINDIRS or MOV PINS instruction.Range(GP0-GP29) Default 0
.out_count 0         'no of pins asserted by OUT PINS,OUT PINDIRS or MOV PINS instruction. Range(0-32) default is 0
.in_base 0           'Pin number which is mapped to LSB of IN bus.Higher pins map the next most significant bit.(GP0 to GP29) default 0
                     'A modulus 32 operator is applied to pin number so if next pin was GP32 would become GP0.
'----Directives require to set SHIFTCTRL register----
' Only need if you require to change from the default values.
.push_thresh 0    'Number of bits shifted into ISR before autopush or PUSH IFFULL. 0 is default and means 32
.pull_thresh 0    'Number of bits shifted out of OSR before autopull or PULL IFEMPTY. 0 is default and means 32
.autopush 0       'Push automatically when ISR is filled. i.e. when IN instruction causes ISR counter to reach PUSH_THRESH
.autopull 0       'Pull automatically when OSR is emptied. i.e. when OUT instruction causes OSR counter to reach PULL_THRESH
.in_shiftdir 1    '1 = shift ISR to right (data enters from left) 0 = to left. Default is 1.
.out_shiftdir 1   '1 = shift out of OSR to right. 0 = to left. Default is 1.
.fjoin_rx 0       'When 1 RX FIFO steals the TX FIFO and becomes twice as deep. TX FIFO is disabled. Default is 0
.fjoin_tx 0       'When 1 TX FIFO steals the RX FIFO and becomes twice as deep. RX FIFO is disabled. default is 0

---- Directives to control Picomite PIOASM operation.
.nostart     'No parameters. Will tell the assembler to comment out the MMBasic PIO START command so the state machine will not be started automatically.

.decode &HXXXX  ' Will disassemble the &HXXXX PIO code into its source instruction.


The PIOASM Instructions
All the Picomite PIOASM instructions are as outlined in RP2040 Datasheet section 3.3.6 and follow a common pattern:
<instruction> (side <side_set_value>) ([<delay_value>])
where:
<instruction> Is an assembly instruction detailed in the following sections.
<side_set_value> Is a value to apply to the side_set pins
<delay_value> Specifies the number of cycles to delay after the instruction completes. e.g.
jmp &H12                  'an unconditional JMP
jmp pin &h12              'conditional jump
jmp pin &h12 side 0       'conditional jump with sideset
jmp pin &h12 side 1 [31]  'conditional jump with sideset and delay of 31

The sections of the instruction can be separated by a space(s) or a comma. e.g.
jmp pin &h12 ,side 1, [31] 'is valid

The Picomite PIOASM will allow you to place hints within the instruction by enclosing them in brackets. These are ignored but can held clarify the source. e.g
jmp x--(<>0 ) &h12  'is valid and interpreted as jmp x-- &12

Labels are supported so the following is valid.
label1:
jmp pin label1
See RP2040 Datasheet section 3.3.5 for labels.


Picomite PIO Assembler - Error Trapping
The assembler will report the following errors:
? The mandatory directives not supplied.i.e. .program, .pio, .sm, .frequency or .origin (even if its 0)
? Attempt to add a directive with an out of range parameter value
? Attempt to use a JMP PIN instruction if .jmp_pin directive not set.(needed even if its GP0)
? Attempt to use a SET PIN instruction if .set_count is 0 or .set_base not set.
? Attempt to use OUT PIN instruction if .out_count is 0 or .out_base is not set
? Attempt to use IN instruction if .in_base not set.Even if its GP0)
? Attempt to use the SIDE parameter if .sideset_base is not set.Even if its GP0
? Attempt to use SIDE parameter value greater than number of bits allocated .side_set parameter.
? Attempt to set DELAY greater than a value that fit in the bits allocated to DELAY after .side_set has taken bits.
? Attempt to set a value for SET PIN, OUT PIN that will not fit into the allocated bits for that function.
? Attempt to set both .fjoin_rx and .fjoin_tx to 1 at the same time.
? A label cannot be resolved
? If the program counter for the PIO exceeds 31 i.e. too many instructions.
? The source, destination or operator for any instruction is invalid.
? .wrap or .wrap_target indicators not included in the source.
? Attempting to allocate a pin to both PIO0 an PIO1


The PIO Assembler Output
? The PIO Assembler will produce the MM Basic SETPIN instructions to associate the used pins with the appropriate PIO.
? The PIO Assembler will produce the PIO PROGRAM LINE command to load each state machine.A comment will be inserted to show the locations of any labels and the .wrap and .wrap_target location.
? The PIO Assembler will produce the PIO INITIATE command to initiate each state machine.
? The PIO Assembler will produce the PIO START command to start each state machine.(the .nostart directive will make this into a comment if required)

When sending directly to the Picomite via MMCC normal comments are stripped from the output.You can ensure a comment is passed through by using ; as the comment indicator in lieu of ' i.e.
; This will be loaded into the Picomite as a comment.
' This wont be loaded.

When the output is sent back to MMEdit all comments are preserved, so you can see the whole thing.You could then send this to MMCC from MMEdit.

When the output is sent via MMReplace --> PIOCHECK a window is opened that shows only the PIO output, displaying any errors. You would use this the verify the PIO source will compile without errors before attemting to load it.


Example  - Compiling Source and viewing the resultant MMBasic code.

The source file
This is the source file that will produce the code to match Volhout's hand coded
exercise Lesson 10 on page 6. 74HC595 Shift Register.

'My Pico 16Meg 'target port\com5:115200 le\lf s\picomite
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
;Volhouts PIO course. Lesson 10 on page 6. 74HC595 Shift Register,
'Volhout's program version 2. PULL only 8 bits. serial in and parallel out
'Source code for Picomite PIO Assembler
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

#PIOSTART
'--------- Directives -----------
.program  HC595 Test  'MANDATORY! Tells the compiler new program has commenced.
.pio 1                ' MANDATORY! The PIO used (0-1)
.sm 0                 ' MANDATORY! The state machine used. (0-3)
.origin 0             ' the position in the program store where the state machine will start execution. (0-31)
.frequency 1e5        'The frquency used when initiating the PIO State Machine. e.g.63000000 or 63e6 accepted.

.set_base GP0         'lowest numbered pin asserted by SET PINS or SET PINDIRS instructions.range(GP0-GP29)
.set_count 2         'no of pins asserted by a SET. Range (0-5) - default is 5
.out_base GP2        'lowest numbered pin asserted by OUT PINS,OUT PINDIRS or MOV PINS instruction.Range(GP0-GP29)
.out_count 1         'no of pins asserted by OUT PINS,OUT PINDIRS or MOV PINS instruction. Range(0-32) default is 0
.in_shiftdir 0       '1 = shift ISR to right (data enters from left) 0 = to left. Default is 1.
.out_shiftdir 0      '1 = shift out of OSR to right. 0 = to left. Default is 1.

'------ Source ----------------------
.wrap_target
SET PINDIRS(GP4-GP0) 3        '&h0 &hE083 set GP0 GP1 GP2 output
SET PINS(GP4-GP0) 0           '&h1 &hE000 initialize clock and load low
MOV OSR ! NULL                '&h2 &hA0EB OSR = &hffffffff
OUT PINDIRS 1                 '&h3 &h6081 SET GP2 output (shif 1 bit logic 1 into pindir)
label1:
SET X 7                       '&h4 &hE027 go through al 32 bits (31...0)
PULL BLOCK                    '&h5 &h80A0 wait for data in FIFO and load in OSR
OUT NULL 24                   '&h6 &h6078 shift data in OSR 24 bits
label2:
OUT PINS 1                    '&h7 &h6001 send 1 bit to GP2
SET PINS(GP4-GP0) 1           '&h8 &hE001 rising edge clock
SET PINS(GP4-GP0) 0           '&h9 &hE000 falling edge clock
JMP X-- label2                '&hA &h0047 jump to 7 when X<>0, post decrement X
SET PINS(GP4-GP0) 2           '&hB &hE002 start latch pulse
SET PINS(GP4-GP0) 0           '&hC &hE000 end latch pulse
JMP label1                    '&hD &h0004 restart the whole shift cycle
.wrap

#PIOEND

; --- the MMBasic Code to Interact with the State Machine ---
'Check the the read data in MMBasic
dim d%
do
   for i%=0 to 7
    PIO WRITE 1,0,1,(1<<i%)
    pause 500
  next i%
 
loop
END


The program as loaded by MMCC
This is the produced MMBasic as loaded into the picomite using the
MMReplace --> MMCC option from the actions menu.

'My Pico 16Meg 'target port\com5:115200 le\lf s\picomite
'Volhouts PIO course. Lesson 10 on page 6. 74HC595 Shift Register,
'---Start of Generated Code and Commands---
'.wrap_target
PIO PROGRAM LINE 1,&h00,&hE083  'SET PINDIRS(GP1,GP0) 3
PIO PROGRAM LINE 1,&h01,&hE000  'SET PINS(GP1,GP0) 0
PIO PROGRAM LINE 1,&h02,&hA0EB  'MOV OSR ! NULL
PIO PROGRAM LINE 1,&h03,&h6081  'OUT PINDIRS 1
'label1:
PIO PROGRAM LINE 1,&h04,&hE027  'SET X 7
PIO PROGRAM LINE 1,&h05,&h80A0  'PULL BLOCK
PIO PROGRAM LINE 1,&h06,&h6078  'OUT NULL 24
'label2:
PIO PROGRAM LINE 1,&h07,&h6001  'OUT PINS 1
PIO PROGRAM LINE 1,&h08,&hE001  'SET PINS(GP1,GP0) 1
PIO PROGRAM LINE 1,&h09,&hE000  'SET PINS(GP1,GP0) 0
PIO PROGRAM LINE 1,&h0A,&h0047  'JMP X-- label2
PIO PROGRAM LINE 1,&h0B,&hE002  'SET PINS(GP1,GP0) 2
PIO PROGRAM LINE 1,&h0C,&hE000  'SET PINS(GP1,GP0) 0
PIO PROGRAM LINE 1,&h0D,&h0004  'JMP label1
'.wrap
SetPin GP0,PIO1 'SET
SetPin GP1,PIO1 'SET
SetPin GP2,PIO1 'OUT
PIO INIT MACHINE 1,0,100000,&H8100002,&HD000,&H0,&H0
PIO START 1,0
' --- the MMBasic Code to Interact with the State Machine ---
Dim d%
Do
   For i%=0 To 7
    PIO WRITE 1,0,1,(1<<i%)
    Pause 500
  Next i%
Loop
End





Reverse Assembly of handcoded examples using the .decode directive.
The .decode directive is designed to assist in turning some of the hand coded examples into source that can be compiled or modified and recompiled without need to hand code the instructions.
The steps are:

? Place a copy of the published working program into MMEdit
? Comment out all code, except the MMBasic at the end which interacts with/makes use of the PIO. You can use the C style /*    */ tags to mark a block as comments.
e.g.


/*
'disconnect ARM from GP2
setpin gp2,pio1

'configure pio1
p=Pio(pinctrl 0,1,,,,gp2,) 'GP2 is lowest PIO assigned for SET
e=PIO(execctrl 0,1,5)      'wrap 5 to 1
f=63e6                     '63MHz

'line code comment
' 0     E081   set GP2 output, not GP2 is assigned in pinctrl
'.wrap target
' 1     80A0   PULL OSR blocking
' 2     A027   MOV OSR->X
' 3     E000   SET GP2 low
' 4     0044   JMP (X<>0) X-- line 4
' 5     E001   SET GP2 high
'.wrap

'program pio1
pio program line 1,0,&hE081
pio program line 1,1,&h80A0
pio program line 1,2,&hA027
pio program line 1,3,&hE000
pio program line 1,4,&h0044
pio program line 1,5,&hE001

'write the configuration
PIO init machine 1,0,f,p,e,,0

'start the pio1 code
PIO start 1,0
*/

'MMBasic program to start a single GATE pulse

do
 input "type a value in seconds, 0 to quit";a
  count% = int(a * f) 'a seconds at piospeed f, 1 instruction / loop
 PIO WRITE 1,0,1,count%
loop until a=0
end

Don't deleted it, you want to reference some of it later.
? Now add you #PIOSTART and #PIOEND directives just above the code not commented out.
? Add the basic directives .program .pio and .sm as well.
? Add the a .frequency directive by looking at the commented code for the frequency.
? Now create the .decode directives by extracting information from the commented program.
The main requirement is the .decode and then the instruction code. e.g.
.decode &hE081
.decode &b1110000010000001   'binary and a comment is allowed.
Best practice would be to include the original comment along with the instruction code so you can compare the compiled result. As below.

#PIOSTART
.program test of decode 'comment allowed here
.pio 1
.sm 0
.frequency 63e6

.decode &hE081   'E081 set GP2 output, not GP2 is assigned in pinctrl
.decode &h80A0   '80A0 PULL OSR blocking
.decode &hA027   'A027 MOV OSR->X
.decode &hE000   'E000 SET GP2 low
.decode &h0044   '0044 JMP (X<>0) X-- line 4
.decode &hE001   'E001 SET GP2 high



? Now run the MMReplace --> PIOCHECK Action. You get the window shown below
Highlight the decoded instructions and use CTRL+C to get them into the clipboard for windows.Linux is right click and copy.
Paste them below the .decode directives. Comment out the .decode directives.




? Now make a few refinements to the source by making reference to the original code.
Look at the JMP instructions which have hard coded addresses. Insert labels at the relevant places and reference them in the JMP instuctions.
Look at the PIO (EXECCTRL..) function and use its information to place .wrap and .wrap_target lines. Also use it to set the .origin directive and the .jum_pin directive.
Look at the PIO (PINCTRL ..) function and use it  to set the relevant base and count directives. e.g. .set_base GP2, .set_count 1
Look at the PIO (SHIFTCTRL ..) function and use it  to set any relevant directives.



#PIOSTART
.program test of decode 'gerry was here
.pio 1
.sm 0
.frequency 63e6
.origin 0
.set_base GP2
.set_count 1

/*
.decode &hE081   'E081 set GP2 output, not GP2 is assigned in pinctrl
.decode &h80A0   '80A0 PULL OSR blocking
.decode &hA027   'A027 MOV OSR->X
.decode &hE000   'E000 SET GP2 low
.decode &h0044   '0044 JMP (X<>0) X-- line 4
.decode &hE001   'E001 SET GP2 high
*/

'----------------------------------------------------------------------------
'                 Decoded Instructions
'----------------------------------------------------------------------------
SET PINDIRS(GP4-GP0) 1        '&h0 E081 set GP2 output, not GP2 is assigned in pinctrl
'.wrap_target
PULL BLOCK                    '&h1 80A0 PULL OSR blocking
MOV X OSR                     '&h2 A027 MOV OSR->X
SET PINS(GP4-GP0) 0           '&h3 E000 SET GP2 low
label1:
JMP X-- label1                '&h4 0044 JMP (X<>0) X-- line 4
SET PINS(GP4-GP0) 1           '&h5 E001 SET GP2 high
'.wrap
#PIOEND




? Now run the MMReplace --> PIOCHECK Action again. You get the window shown below
If its error free you are ready to try it on the Picomite. Use the
MMReplace--> MMCC Action to load it.




the code as loaded into the Picomite.

'My Pico 16Meg 'target port\com5:115200 le\lf s\picomite
Option explicit
Dim integer f,a,count
'---Start of Generated Code and Commands---
PIO PROGRAM LINE 1,&h00,&hE081  'SET PINDIRS(GP2) 1
'.wrap_target
PIO PROGRAM LINE 1,&h01,&h80A0  'PULL BLOCK
PIO PROGRAM LINE 1,&h02,&hA027  'MOV X OSR
PIO PROGRAM LINE 1,&h03,&hE000  'SET PINS(GP2) 0
'label1:
PIO PROGRAM LINE 1,&h04,&h0044  'JMP X-- label1
PIO PROGRAM LINE 1,&h05,&hE001  'SET PINS(GP2) 1
'.wrap
SetPin GP2,PIO1 'SET
PIO INIT MACHINE 1,0,63000000,&H4000040,&H5080,&HC0000,&H0
PIO START 1,0
Print Hex$(Pio(pinctrl 0,1,,,,gp2,))
Print Hex$(Pio(execctrl GP0,1,5))
f=63e6
Do
Input "type a value in seconds, 0 to quit";a
Print
count% = Int(a * f) 'a seconds at piospeed f, 1 instruction / loop
PIO WRITE 1,0,1,count%
Loop Until a=0
End


Trouble shooting the .decode directive.
These are a couple of things I came across when it would not work first go.
Check the original code that utilises the PIOs (the bit you kept) still gets all the values it requires, typically f (frequency) might be used but we have commented it out, so it needs to be added back in. Setting OPTION EXPLICIT will highlight these.

If the original code does not use a PIO (EXECCTRL ...) function the .wrap_target is at the top and .wrap is at the bottom. .origin is 0. .jmp_pin defaults to GP0
If the original code does not use a PIO (PINCTRL ...) function then .sideset_count is at its default value of 5.
If the original code does not use a PIO (SHIFTCTRL ...) function then all value are at default, however if PIO (SHIFTCTRL.. ) is used and is
s=PIO (SHIFTCTRL x,x,x,x,0,0) you will need the two directives
.in_shiftdir 0    '1 = shift ISR to right (data enters from left) 0 = to left. Default is 1.
.out_shiftdir 0   '1 = shift out of OSR to right. 0 = to left. Default is 1.
to match the two zeros in the last two parameters, as these change these from their defaults of 1
If the code does not work, try loading the original program and verify that it does actually work.

To Do
The error checking as specified above may not yet all be implemented/tested.
The intention is to implement a .define directive to allow use of a symbol for some data values, so you can change its value in one spot.

Hoping it proves useful,
Gerry
Edited 2023-01-15 17:40 by disco4now
Latest F4 Latest H7
 
George H
Newbie

Joined: 03/07/2020
Location: United States
Posts: 24
Posted: 10:10pm 15 Jan 2023
Copy link to clipboard 
Print this post

This is awesome!!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 10:54pm 15 Jan 2023
Copy link to clipboard 
Print this post

You have been busy Gerry!

I will send you a PM with a suggested change to the installation instructions re adding the external programs to the inf file. Nothing major but might help some end-users.
I will send the suggestions later today. Too busy picking cherries this morning...

Jim
VK7JH
MMedit   MMBasic Help
 
IanT
Regular Member

Joined: 29/11/2016
Location: United Kingdom
Posts: 84
Posted: 09:15am 16 Jan 2023
Copy link to clipboard 
Print this post

I read through this yesterday Gerry (although I didn't understand much of it) but thought "WoW" what another great piece of work.

I'm just commenting because I thought some praise was due. I'm afraid I don't have much to contribute to the Forum. I guess I'm one of the many who are just grateful for all the effort others put into the 'Mites and are happy to share with us.

I've got some PicomiteVGA boards on the way and my Grandson is going to get one built for his birthday. My wife doubts he will be very interested but I thought it worth a try. More fun than just playing endless tank battles on an iPad? A tough competition but I know which is likely to be better for him. Anyway, we'll give it a shot.  

Regards,

IanT
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5731
Posted: 10:01am 16 Jan 2023
Copy link to clipboard 
Print this post

I love this. Well done, Gerry! :)
If I eventually dive into the PIO world I'll almost certainly be using this.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 10:36am 16 Jan 2023
Copy link to clipboard 
Print this post

Hi Mick,
Thanks for your PASM stuff, that got me started. I was away in the caravan over Xmas with no mites,but eventually got the laptop out and played with your PASM on MMB4W. This is where it all lead to. Its basically your frame work for the assembler and reverse assembler, and with Volhout's explanations/lessons it all came together.
Gerry
Latest F4 Latest H7
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5731
Posted: 12:09pm 16 Jan 2023
Copy link to clipboard 
Print this post

You obviously understood what you were doing better than I did. :D
The PIO is just plain weird to me ...
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3537
Posted: 12:29pm 16 Jan 2023
Copy link to clipboard 
Print this post

@disco4now,

Thank you whole heartedly. This is a level of integration that I would not have been able to pull off. I know I wanted to look at PASM, but would always have treated it as a separate entity. Now it is integrated/combined in the MMEdit IDE.

I will look at this soon. My days of hand-assembling seem to be over....

Thank you,

From and Exited Volhout

P.S. I assume PIO INITIATE refers to PIO INIT MACHINE
Edited 2023-01-16 22:38 by Volhout
PicomiteVGA PETSCII ROBOTS
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 09:33pm 17 Jan 2023
Copy link to clipboard 
Print this post

Updates to Picomite PIOASM

The installation files/instruction have been updated
Update MMReplace PIoASM Intallation Files

The installation instructions have been improved to minimise the risk of overwriting any existing Action items.

The PIOASM within MMReplace has several fixes added.

WAIT and IRQ should now be fully functional

The SIDE parameter should now work correctly and respect the OPT parameter in
.side_set 2 opt

Some refinements to the ERROR trapping

The #PASMCFG nohints noinit parameters are now accepted.
noinit will comment out the PIO INIT MACHINE command.
nohints will turn off some comments normally added the the output. The affected pins for SET,SIDE,OUT etc are added as hints (GP4-GP0) to identify which pins a command will affect. This is based on the directives set, so you can easily see if you are targeting the pins you expect.
Latest F4 Latest H7
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3537
Posted: 01:30pm 18 Jan 2023
Copy link to clipboard 
Print this post

Hi Gerry,

Is it possible that the linux zip has an empty "source" directory ?
Do you need the purebasic file to run MMReplace ?

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 07:24pm 18 Jan 2023
Copy link to clipboard 
Print this post

  Volhout said  Is it possible that the linux zip has an empty "source" directory ?
Do you need the purebasic file to run MMReplace ?

The source is not needed to run MMReplace.

It can be taken from the Windows distribution if you want to have a look.

Jim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 07:24pm 18 Jan 2023
Copy link to clipboard 
Print this post

double post
Edited 2023-01-19 05:25 by TassyJim
VK7JH
MMedit   MMBasic Help
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 12:43am 19 Jan 2023
Copy link to clipboard 
Print this post

More Updates to Picomite PIOASM

The installation files/instructions have been updated
Updated MMReplace PIOASM Intallation Files at the end of this thread

The PIOASM within MMReplace has these fixes added.
The .nostart directive is fixed, previously corrupted the output.
You need the .nostart directive to prevent PIOASM producing the PIO START command when using the new PIO DMA_OUT command.

Some more refinements to the ERROR trapping
Some enhancements to the hints shown in the output

Also the .side_set directive is added to the directives section above.
.side_set is required when compiling so compiler knows whether SIDE parameter is required or optional and how many bits are left for delay.

The Picomite PIOASM Directives (Ammended)

'--- MANDATORY Directives. Required for each program.
.program <program name> 'tells the assembler it a new environment
.pio  [0|1]              'nominates the PIO to use.
.sm  [0-3]               'nominates the state machine
.frequency 63e6         'needed for PIO Initiate command.
.origin [0-31]          'Indicates which instruction the sm starts at.

'--- one of these .side_set combinations (.side_set 0 is the default)
.side_set [0-5]             'Indicates number of bits used by SIDE.Every instruction must have a SIDE parameter if > 0
.side_set [0-5] opt        'Indicates SIDE is optional.The SIDE parameter is only added when required.
.side_set [0-5] pindirs  'pindirs if present indicates side-set data is asserted to pin directions instead of pin values.
                                  ' SIDE_PINDIR bit 29 in the EXECCTRL register is set to 1
Edited 2023-01-19 12:04 by disco4now
Latest F4 Latest H7
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024