Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Terry Coles
On Thursday, 21 January 2021 11:45:36 GMT PeterMerchant wrote:
> About the USB connections, I thought that the specified length for USB
> connections was 5 Metres? Are you going further than that at WMT?

No.  The two Pis are in the same Equipment Case.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread PeterMerchant



Do you not compile the C code before uploading it to an Arduino or similar?
I've never used an Arduino but have always assumed that the compiler was in
the IDE not the device.


been using a Wemos D1 which has some of these features plus Wifi, and
programmed in c.

That's an interesting device too, albeit a lot less capable than this latest
offering.

The microPython is the attractive thing.  When i was evaluating the options at
WMT in 2016, I plumped for the RPi Zero because it was half the price of the
cheapest Arduino, but more importantly it supported Python.


Yes, The Arduino IDE has a 'verify' Button that compiles the code and reports 
errors, and also the 'upload' button that compiles and then uploads the 
firmware to the device.  I am using the Wemos like a remote control unit with 6 
buttons as inputs, and I2C display, and MQTT over Wifi to my Raspberry Pi.  And 
powered by a USB powerbank, as I never wired up the 4 battery AA pack.

When I first got the Wemos I tried to load the MicroPython on to is 
unsuccessfully a few times, so It was interesting after I got given the Arduino 
Unos  to discover that I could program the Wemos using the IDE.

I concur that you did the right thing back then choosing the Raspberry Pi for 
all the work at the WMT.

About the USB connections, I thought that the specified length for USB 
connections was 5 Metres? Are you going further than that at WMT?

Peter


--
 Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Ralph Corderoy
Hi Terry,

> You are guilty of selective quoting.  :-)

Ah, sorry.

> When I referred to USB Networking, I was talking about the technique
> described in your link.

Yes, I see that now.

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Terry Coles
On Thursday, 21 January 2021 10:17:49 GMT Ralph Corderoy wrote:
> > USB Networking works extremely well.
> 
> ...
> 
> > traffic has still to be carried over USB and then be converted to
> > TCP/IP in the Adaptor.
> 
> So to clarify, it isn't USB networking.  It's wired Ethernet or Wi-Fi
> networking with one of those network interface being connected to the Pi
> locally over USB.
> 
> USB networking would be USB all the way down.  :-)
> https://en.wikipedia.org/wiki/Ethernet_over_USB

Ralph,

You are guilty of selective quoting.  :-)

When I referred to USB Networking, I was talking about the technique described 
in your link.  I have two Pis in the new Minster installation and they are 
connected together over USB without an Ethernet Adaptor at either end.  Once 
configured at one end, both Pis gain a usb0 interface, which can be treated as 
a network interface.  No WiFi, no Ethernet Adaptor.

As it happens one of the Pis has a WiFi Adaptor to link to the WMT Network 
(which does not support USB networking and would need a very long USB cable if 
it did).

In you second quote, I was simply comparing the (assumed) performance of USB 
Networking and Ethernet in that scenario.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Ralph Corderoy
Hi Terry,

> USB Networking works extremely well.
...
> traffic has still to be carried over USB and then be converted to
> TCP/IP in the Adaptor.   

So to clarify, it isn't USB networking.  It's wired Ethernet or Wi-Fi
networking with one of those network interface being connected to the Pi
locally over USB.

USB networking would be USB all the way down.  :-)
https://en.wikipedia.org/wiki/Ethernet_over_USB

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Bob Dunlop
Hi,

> I notice that it doesn't have WiFi, and I wonder if it could be programmed 
> from the Arduino IDE as 'c' is mentioned. Perhaps that will come. I have been 
> using a Wemos D1 which has some of these features plus Wifi, and programmed 
> in c.

In my professional work this was often the demarcation line.  Need a network
Ethernet or WiFi then use a SoC and linux or at least a multitasking OS.
Need lowest power and no network, use an MPU and bareback code.

Now for hobby use that equates to, networking use the Pi Zero W or better,
no networking STM32 blue pill and the like.  The Pico even looks like a blue
pill.

The newer F4 based black pills look comparable to the Pico, single core but
it's Cortex-M4 not M0 with hardware floating point and DSP instructions.
Similar price from usual suppliers.  There's a nice write up here:
https://hackaday.com/2021/01/20/blue-pill-vs-black-pill-transitioning-from-stm32f103-to-stm32f411/#more-454155

I suspect the RPi Pico will soon win out just on popular labeling.


All have IDEs available that allow you to program them in C these days,
although my personal method is Vi + gcc + make.

Oh and it's 'C' not 'c' please.

-- 
Bob Dunlop

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Terry Coles
On Thursday, 21 January 2021 09:55:45 GMT Hamish McIntyre-Bhatty wrote:
> That's true, if USB is fairly functional that perhaps USB NICs could be
> made to work. It will still need a TCP/IP stack though.

Yes agreed, which is why I only said that I would 'seriously consider' this 
device.  :-)

> What would the Pico's be doing in that design? All the hardware-related
> stuff like interfacing with probes?
> 
> I realise this is very much a hypothetical discussion, but still
> interested :). Does the USB Raspberry Pi networking work well for the
> new Minster system?

USB Networking works extremely well.  Once configured it is pretty much 
seamless.  The only change from the system viewpoint is that the Static IP 
Address on the Pi has to be assigned to usb0 instead of eth0.

I should image that throughput would be limited only by the speed of the USB 
hardware and would probably be higher than if an Ethernet Adaptor is used 
because traffic has still to be carried over USB and then be converted to 
TCP/IP 
in the Adaptor.   

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Hamish McIntyre-Bhatty
On 21/01/2021 09:50, Terry Coles wrote:
> On Thursday, 21 January 2021 09:25:02 GMT Hamish McIntyre-Bhatty wrote:
>> This is a very interesting product. That said, I agree with you Terry in
>> that I think it would have been hard to even get Ethernet to work with
>> something like this, let alone talking to a MySQL database - probably
>> unsuitable for the River System, or at least the direction it went in
>> given the hardware we had at the time.
> At the time, there was no thought of networking the devices; this was when I 
> did the lighting controller.  This would have been perfect for that because 
> in 
> the end I was unable to get PWM to work without flickering using Python 
> because 
> the GPIO Library didn't (doesn't?) support the hardware PWM on Pin 18.   I 
> got 
> it working with WiringPi and C, although the C code is hardly rocket science 
> with only around 160 lines of code around a third of which are comments.
>
> The train controllers would have been a perfect choice for this , but I 
> couldn't have used it for any of the four audio players on the site.  I agree 
> with you that we certainly would have struggled to develop the software for 
> the River System in its present form.
>
> From a hardware standpoint we would have been fine for any of the River 
> System 
> devices if USB networking could be made to work.   If I were starting today, 
> I 
> would seriously consider using a Pi Zero at each location to do the grunt 
> work, connected to the Pico's using USB Networking, like I've just done on 
> the 
> new Minster hardware.

That's true, if USB is fairly functional that perhaps USB NICs could be
made to work. It will still need a TCP/IP stack though.

What would the Pico's be doing in that design? All the hardware-related
stuff like interfacing with probes?

I realise this is very much a hypothetical discussion, but still
interested :). Does the USB Raspberry Pi networking work well for the
new Minster system?

Hamish



signature.asc
Description: OpenPGP digital signature
-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Ralph Corderoy
Hi Hamish,

> I must admit I struggle to see the difference between a
> microcontroller and a very low end SoC/SBC, apart from the analogue
> inputs (but AFAIK some SoCs/SBCs include analogue inputs too).

I'd welcome corrections, this is just the impression I'm formed from
programming a few microcontrollers in C and assembler, e.g. swtch().

A microcontroller unit, or MCU, is more than a CPU.  The Z80, 6502,
6509, etc., used in home computers of the 70s and 80s were CPUs; a chip
which read instructions and executed them and accessed the outside
world, including any memory other than its register file, over address
and data pins.

These days, a microcontroller will have on-board static RAM, and perhaps
flash memory too for holding the code to run.  If the flash isn't within
the microcontroller's package then there will be support for external
flash.  General purpose binary I/O pins will be available for reading or
writing.  Simple ‘serial’ interfaces, like SPI, I²C, and CAN bus, will
be available.  An analogue-to-digital converter or two might be
available to sample an analogue signal on an input pin.

The CPU at the centre of the microcontroller still often lacks a
floating-point unit so it can only do integer arithmetic, though
fixed-point arithmetic is often good enough.  And it probably won't have
any memory protection unit either so all RAM is accessed at the same
privilege level.  Which isn't to say the CPU doesn't have different
privilege levels when executing instructions, just that it can't be told
a range of bytes are currently inaccessible to cause a fault on an
invalid access.

ARM's Cortex-M range, like the Pico's Cortex-M0+, are microcontrollers,
according to ARM, which is why they're ‘M’ in contrast to the Cortex-A
range which are for applications.

An SoC which isn't a microcontroller would have double-precision
floating-point and memory management in the CPU.  Plus more complex
peripherals like a GPU, SATA interfaces, etc.

USB is a bit borderline, I think.  Hardware-wise on the wire, it's quite
simple, but the software stack to support it can be complex and so out
of place on an MCU which may have limited flash to store all the code
and RAM as low as hundreds of bytes.

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Terry Coles
On Thursday, 21 January 2021 09:25:02 GMT Hamish McIntyre-Bhatty wrote:
> This is a very interesting product. That said, I agree with you Terry in
> that I think it would have been hard to even get Ethernet to work with
> something like this, let alone talking to a MySQL database - probably
> unsuitable for the River System, or at least the direction it went in
> given the hardware we had at the time.

At the time, there was no thought of networking the devices; this was when I 
did the lighting controller.  This would have been perfect for that because in 
the end I was unable to get PWM to work without flickering using Python because 
the GPIO Library didn't (doesn't?) support the hardware PWM on Pin 18.   I got 
it working with WiringPi and C, although the C code is hardly rocket science 
with only around 160 lines of code around a third of which are comments.

The train controllers would have been a perfect choice for this , but I 
couldn't have used it for any of the four audio players on the site.  I agree 
with you that we certainly would have struggled to develop the software for 
the River System in its present form.

From a hardware standpoint we would have been fine for any of the River System 
devices if USB networking could be made to work.   If I were starting today, I 
would seriously consider using a Pi Zero at each location to do the grunt 
work, connected to the Pico's using USB Networking, like I've just done on the 
new Minster hardware.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Hamish McIntyre-Bhatty
On 21/01/2021 08:11, Terry Coles wrote:
> On Thursday, 21 January 2021 07:59:12 GMT PeterMerchant wrote:
>> I notice that it doesn't have WiFi, and I wonder if it could be programmed
>> from the Arduino IDE as 'c' is mentioned. Perhaps that will come. I have
> Do you not compile the C code before uploading it to an Arduino or similar?  
> I've never used an Arduino but have always assumed that the compiler was in 
> the IDE not the device.
>
>> been using a Wemos D1 which has some of these features plus Wifi, and
>> programmed in c.
> That's an interesting device too, albeit a lot less capable than this latest 
> offering.
>
> The microPython is the attractive thing.  When i was evaluating the options 
> at 
> WMT in 2016, I plumped for the RPi Zero because it was half the price of the 
> cheapest Arduino, but more importantly it supported Python.
>
> Since the WMT is largely maintained by volunteers, I didn't want to use a 
> language that might be hard to use for novices.  Since Python was going up 
> the 
> popularity charts even then, and is quite powerful, I felt it was the right 
> choice.  I still do. 

This is a very interesting product. That said, I agree with you Terry in
that I think it would have been hard to even get Ethernet to work with
something like this, let alone talking to a MySQL database - probably
unsuitable for the River System, or at least the direction it went in
given the hardware we had at the time.

I must admit I struggle to see the difference between a microcontroller
and a very low end SoC/SBC, apart from the analogue inputs (but AFAIK
some SoCs/SBCs include analogue inputs too).

Hamish



signature.asc
Description: OpenPGP digital signature
-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Terry Coles
On Thursday, 21 January 2021 07:59:12 GMT PeterMerchant wrote:
> I notice that it doesn't have WiFi, and I wonder if it could be programmed
> from the Arduino IDE as 'c' is mentioned. Perhaps that will come. I have

Do you not compile the C code before uploading it to an Arduino or similar?  
I've never used an Arduino but have always assumed that the compiler was in 
the IDE not the device.

> been using a Wemos D1 which has some of these features plus Wifi, and
> programmed in c.

That's an interesting device too, albeit a lot less capable than this latest 
offering.

The microPython is the attractive thing.  When i was evaluating the options at 
WMT in 2016, I plumped for the RPi Zero because it was half the price of the 
cheapest Arduino, but more importantly it supported Python.

Since the WMT is largely maintained by volunteers, I didn't want to use a 
language that might be hard to use for novices.  Since Python was going up the 
popularity charts even then, and is quite powerful, I felt it was the right 
choice.  I still do. 

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-21 Thread Ralph Corderoy
Hi Peter,

> and I wonder if it could be programmed from the Arduino IDE as 'c' is
> mentioned.

Arduino Nano RP2040 Connect

Arduino joins the RP2040 family with one of its most popular
formats: the Arduino Nano.  The Arduino Nano RP2040 Connect combines
the power of RP2040 with high-quality MEMS sensors (a 9-axis IMU and
microphone), a highly efficient power section, a powerful
WiFi/Bluetooth module, and the ECC608 crypto chip, enabling anybody
to create secure IoT applications with this new microcontroller.
The Arduino Nano RP2040 Connect will be available for pre-order in
the next few weeks.

(The RP2040 is the new SoC the Raspberry Pi Foundation have designed for
the Pico.)

> I have been using a Wemos D1 which has some of these features plus
> Wifi, and programmed in c.

That's based on the ESP32, a very popular chip for an embedded processor
coupled with Wi-Fi.

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-20 Thread PeterMerchant

On 21/01/2021 07:51, Ralph Corderoy wrote:

Hi Terry,


https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/

New RP2040 SoC which they designed.

- Dual-core 133MHz Arm Cortex-M0+.
- 264 KiB on-chip RAM.
- Support for up to 16MB of off-chip Flash memory on dedicated QSPI bus.
- Interpolator and integer divider peripherals.
- DMA controller.
- 30 × GPIO, four of which can be used as analogue inputs.
-  2 × UARTs.
-  2 × SPI controllers.
-  2 × I2C controllers.
- 16 × PWM channels.
-  1 × USB 1.1 controller and PHY, with host and device support.
-  8 × Raspberry Pi Programmable I/O (PIO) state machines.
- USB mass-storage boot mode with UF2 support, for drag-and-drop
   programming.


I notice that it doesn't have WiFi, and I wonder if it could be programmed from 
the Arduino IDE as 'c' is mentioned. Perhaps that will come. I have been using 
a Wemos D1 which has some of these features plus Wifi, and programmed in c.

Peter


--
 Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Raspberry Pi Pico

2021-01-20 Thread Ralph Corderoy
Hi Terry,

> https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/

New RP2040 SoC which they designed.

- Dual-core 133MHz Arm Cortex-M0+.
- 264 KiB on-chip RAM.
- Support for up to 16MB of off-chip Flash memory on dedicated QSPI bus.
- Interpolator and integer divider peripherals.
- DMA controller.
- 30 × GPIO, four of which can be used as analogue inputs.
-  2 × UARTs.
-  2 × SPI controllers.
-  2 × I2C controllers.
- 16 × PWM channels.
-  1 × USB 1.1 controller and PHY, with host and device support.
-  8 × Raspberry Pi Programmable I/O (PIO) state machines.
- USB mass-storage boot mode with UF2 support, for drag-and-drop
  programming.

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


[Dorset] Raspberry Pi Pico

2021-01-20 Thread Terry Coles
This is interesting: 
https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/

It's selling for £3.60 in the UK and comes with analogue inputs and multiple 
PWM outputs, so is ideal for the sort of physical computing that we've been 
doing at Wimborne Model Town.

Having said that, it is a micro-controller rather that a micro-computer and 
comes with a much slower clock and less memory, so it won't run the RPi OS.  
It can be programmed with micrpython or C/C++.

At present, we certainly couldn't use these to replace the hardware at WMT 
without a significant software re-write.  However, the hardware costs would 
have been roughly halved in may cases had it been available three to four 
years ago.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk