Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:51 24 Nov 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 : command DEVICE SERIALTX

Author Message
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 05:46pm 15 Aug 2024
Copy link to clipboard 
Print this post

The instructions on page 89 contain the command DEVICE SERIALTX pinno,
baudrate, ostring$ and the note ‘NB command is blocking during transmission.’ What does NB command mean?
And is it 8N1 ?

@geoffg
The command is repeated on page 92. The same applies to DEVICE SERIALRX.
(WebMite User Manual MMBasic Ver 5.08.00 Revision 2)

Matthias
 
Andy-g0poy
Regular Member

Joined: 07/03/2023
Location: United Kingdom
Posts: 56
Posted: 05:56pm 15 Aug 2024
Copy link to clipboard 
Print this post

N.B.

Latin abbreviation for "nota bene"

Means "note well"

Andy
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 05:59pm 15 Aug 2024
Copy link to clipboard 
Print this post

NB just means "Note this:"
It means that the MMBasic program is suspended during transmission or reception. That'll be because you can't allow other processes to mess up the timing.

There's examples in Appendix A of the manual. Options for the port are set in the OPEN command.
Mick

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

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 06:12pm 15 Aug 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  It means that the MMBasic program is suspended during transmission or reception.


That's what I had feared

  Mixtel90 said  There's examples in Appendix A of the manual. Options for the port are set in the OPEN command.


I can only find the hardware UART examples Com1 and 2. How is OPEN supposed to work with ‘DEVICE SERIALTX pinno, baudrate, ostring$’?

Matthias
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 06:25pm 15 Aug 2024
Copy link to clipboard 
Print this post

The COM ports are buffered. That makes things much easier.

Sorry, I've not used DEVICE SERIAL. Maybe that isn't using the hardware UARTs and isn't buffered?
Mick

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

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 06:30pm 15 Aug 2024
Copy link to clipboard 
Print this post

No, it does not. That's when Com1 and Com2 are already occupied and you need another channel to send, SoftUart that is ;-) But I had already suspected this.

Matthias
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3800
Posted: 07:05pm 15 Aug 2024
Copy link to clipboard 
Print this post

How many COM ports do you need?

(Or COM-like.)

Maybe PIO could do an extra one?

John
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 07:41pm 15 Aug 2024
Copy link to clipboard 
Print this post

As many as possible!
Yes, thanks John for the tip. I already use the PIO for reception (Rx). As I use the Pico Wlan, I only have the 0 PIO of the two PIOs available. I can now use the 4 state machines for 2x Rx and 2xTX or and that was my hope: 4x Rx and another 4x via DEVICE SERIALTX. Then I would ideally have 2 Hardware Com + 4 Pio/Soft Com.

Or does anyone have a brilliant solution to put both Rx with interrupt and Tx in one state machine?

Matthias
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 09:16pm 15 Aug 2024
Copy link to clipboard 
Print this post

A host of Zeros. Two nice, buffered COM ports each and linked together over I2C. :)

Then when you run out of addresses use the other I2C port....

.
Edited 2024-08-16 07:17 by Mixtel90
Mick

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

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 06:11pm 17 Aug 2024
Copy link to clipboard 
Print this post

Unfortunately, I haven't quite understood it yet :-(
Now I want to try the other direction (send) and I fail ...
It looks like the OUT does not write from the OSR to the PIN.
Can anyone tell me my mistake?

Matthias


' pio out TEST
'--------------------------------------------------
'Only PIO 0 is available on the WebMite
'as PIO1 is used by the WIFI interface
'
'disconnect ARM from GP14
SetPin GP14,pio0
Dim d%,b%,o%
'
PIO ASSEMBLE 0,".program uart_tx"
PIO ASSEMBLE 0,".side_set 1"
PIO ASSEMBLE 0,"set pindirs, 1"
PIO ASSEMBLE 0,".wrap target"
PIO ASSEMBLE 0,"pull       side 1 [7]"
PIO ASSEMBLE 0,"set x, 7   side 0 [7]"
PIO ASSEMBLE 0,"bitloop:"
PIO ASSEMBLE 0,"out pins, 1          "
PIO ASSEMBLE 0,"jmp x-- bitloop   [6]"
PIO ASSEMBLE 0,".wrap"
PIO ASSEMBLE 0,".end program list"
'configure pio0 StateMachine 1
f=31250*8
'             a b c d    e    f    g      a,e=side set   c,g=OUT
p=Pio(PINCTRL 1,1,1,gp15,gp14,gp14,gp14)
e=Pio(execctrl gp15,Pio(.wrap target),Pio(.wrap) )
'                 7   .
s=Pio(shiftctrl 0,7,0,0,1,1)    
'write the configuration
PIO init machine 0,0,f,p,e,s,0
'start the pio0 code state machine 0
PIO start 0,0
'MAIN
 Do
   'nothing
   Pause 500
   o%=&haa
   Print Bin$(o%)
   'Print "Status1:", Pio(FLEVEL 0 ,0 , tx)
   PIO write 0,0,1,o%
   Print "..."
 Loop
End


Footnote added 2024-08-18 04:58 by homa
Wrong Thread!
This is the right one; https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=17155
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 06:33pm 17 Aug 2024
Copy link to clipboard 
Print this post

Hmmm...
DEVICE SERIAL TX and DEVICE SERIAL RX are not buffered. It doesn't matter in a way because the program hangs until they have completed or timed out. It could mess up other stuff, I suppose.

The hardware UARTs might continue to run using their buffers during this time.

PIOs would just run as normal providing they aren't waiting for the main CPU to come free.

Sorry, I can't comment on your program. I don't have enough PIO experience to follow it. :)

Could your com ports run only on request? I was wondering about using some sort of multiplexer with a single port.

If not then the answer might be to use a Parrallax Propeller to provide the ports.
Mick

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

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 07:03pm 17 Aug 2024
Copy link to clipboard 
Print this post

Hi Mick,

sorry, wrong thread.

What did you mean by:
  Mixtel90 said  A host of Zeros. Two nice, buffered COM ports each and linked together over I2C. :)

Then when you run out of addresses use the other I2C port....

.

I'm looking for i2c to uart controller ... but I only found a board that can't handle 31250 baud ...
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 07:35pm 17 Aug 2024
Copy link to clipboard 
Print this post

The RP2040-Zero is a cheap little Chinese version of the Pico. My idea is that each one has the usual pair of COM ports, so you get two buffered ports as usual. Hiwever, you could link a number of them together over I2C to one common master. That way you have all your ports buffered and handled independently (never more than two per processor) and can read/write them as required.

It was a bit tongue in cheek really, but it's pico-parallel-processing. :)
You could use a version of my RPZ Compute modules designed just for two COM ports each and plugging into a motherboard set up for I2C. If in doubt throw hardware at the problem until it goes away. :)

I2C to UART? The COM ports should be able to send and receive at that speed under MMBasic, I think. They have TX and RX buffers. You'll have to watch the buffer sizes though.
Mick

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


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

© JAQ Software 2024