Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:53 01 May 2025 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 V5.07.00b0 - beta firmware

     Page 5 of 13    
Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 01:02pm 23 Jul 2021
Copy link to clipboard 
Print this post

Cheers, Tom. :)


@matherp

"OPTION AUTORUN now allows a number between 1 and 10 or OFF"

Fairy nuff, but other platforms use OPTION AUTORUN ON|OFF. I (apparently wrongly) assumed that ON was still one of the options. :)
Edited 2021-07-23 23:12 by Mixtel90
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9992
Posted: 01:08pm 23 Jul 2021
Copy link to clipboard 
Print this post

For the manual

GP20 can also be used for SPI0RX
SPInCSN pins are not relevant to the PicoMite and should be omitted from the diagram
SETPIN b,SPInTR should be SETPIN b,SPInTX
BITBANG/BITBANG HUMID is a command not a function
PIO INIT MACHINE appears twice
OPTION AUTORUN n specifies which flash slot to run on power-up or reset
MATH M_INVERSE command and MATH(DETERMINANT function are not currently in any other port: all other MATH stuff is exactly as per CMM2
READ command can now take arrays e.g. a() and will read to fill the array. For multi-dimensional arrays the leftmost index is the fastest moving
BLIT LOAD [#]n, "filename" [,xstart] [,ystart] [,xlen] [,ylen]
This loads into blit buffer n the image from filename. The image must be a 24-bit bmp.
The optional parameters specify the start position in the image to load from and the width and height to load.

Also, the manual should reference your PIO compiler. This is very important code and subject to your agreement should be distributed with the PicoMite firmware when officially launched
Edited 2021-07-23 23:11 by matherp
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1120
Posted: 04:33pm 23 Jul 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  "OPTION AUTORUN now allows a number between 1 and 10 or OFF"

Fairy nuff, but other platforms use OPTION AUTORUN ON|OFF. I (apparently wrongly) assumed that ON was still one of the options. :)

Maybe in this particular instance, "ON" should have the value "1"?
Then code ported from other 'mites needs less rework, although it must be saved in slot 1.
Visit Vegipete's *Mite Library for cool programs.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4811
Posted: 07:54pm 23 Jul 2021
Copy link to clipboard 
Print this post

First test with ADC command.

I looked at Peters example code, and have created this program

' test ADC burst read
' connect ADC input to PWM output using RC filter to create triangle-ish wave
' PWM = 50Hz
' ADC takes 1024 samples, running at 50kHz

pwm_freq=50
samples=MM.HRes-1' 1023
adc_freq=pwm_freq*samples
gain=MM.VRes/3.3

'reserve memory
Dim array!(samples)

'open PWM(GP18) and ADC(GP26)
SetPin GP18,pwm1A
SetPin GP26,ain
ADC open adc_freq, 1, ready_int

'start PWM
PWM 1,pwm_freq,50   ' 50% = square wave
Pause 100

'start ADC
ADC start array!()

Do :Loop

End

Sub ready_int
 ADC close
 CLS
 For i=0 To samples-1
   'Print Str$(array!(i),2,2),
   Line i,gain*array!(i),i+1,gain*array!(i+1),1,RGB(yellow)
 Next i
 Print "ready"
 End
End Sub


When I run this program it draws a square wave (with rounded edges if an RC filter is added, otherwise a nice square wave) on the LCD screen.

However, if I run the program several times after eachother, I get at PANIC error message. Not sure why, I do a ADC close in the interrupt, and an END (should close down the DMA's.



PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9992
Posted: 09:20pm 23 Jul 2021
Copy link to clipboard 
Print this post

  Quote  However, if I run the program several times after eachother, I get at PANIC error message.


Thanks for the report - will fix in next beta
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 207
Posted: 12:06am 24 Jul 2021
Copy link to clipboard 
Print this post

@Mixtel90 For the manual 00b1.rtf

  Quote  PicoMite TINAM corrections & additions suggestions

1.  Heading: "Loading MMBasic for the first time"
   Para: 5
   Typo "terminal"
2.  ditto
   Para: 7
   "...as the UPDATE FIRMWARE command provided by MMBASIC can be used."
3.  Heading: "Program Storage"
   Para: "When SD card is connected..."
   Add missing command - RUN "filename" etc
4.  Heading: "Clearing the console screen"
   Line: 4
   Typo "position"
5.  Appendix 1 - Displays
   All:
   ALL displays reference "OPTION LCDPANEL ILI9341"...
   Suggest moving the ILI9341 block of text to the top of the display text.
   Perhaps even a note alluding to the fact that other displays reference this one
   for one or more configuration parameters?

Great job, thanks
led
Miss you George
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1958
Posted: 02:50am 24 Jul 2021
Copy link to clipboard 
Print this post

On the PiPico pinout why are there multiple SPI0 and SPI1 RX and TX pins. Which ones do I use to wire up an ILI9341 display.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6210
Posted: 04:24am 24 Jul 2021
Copy link to clipboard 
Print this post

  palcal said  On the PiPico pinout why are there multiple SPI0 and SPI1 RX and TX pins. Which ones do I use to wire up an ILI9341 display.


It is up to you.
The pico allows you to move the various functions around so you can 'fit' different board layouts. They just have to be compatible pins. Pin allowable functions are in the datasheet.

I have kept mine simple. All the fixed connections are grouped together on pins 10 to 20 to fit my veroboard layout.

So my configuration requires:

OPTION SYSTEM SPI 14,15,16
OPTION SDCARD 17
OPTION LCDPANEL ILI9341,L,10,11,12
OPTION TOUCH 19,20
GUI CALIBRATE 0, 250, 504, 925, 747


Jim
VK7JH
MMedit
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1958
Posted: 06:51am 24 Jul 2021
Copy link to clipboard 
Print this post

OK got it. I'm designing a PCB to take the place of the 170 Backpack. I made one that used the E28 but now I want to use the PicoMite.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 07:43am 24 Jul 2021
Copy link to clipboard 
Print this post

Beat you to it, palcal. ;)  "LCD+Pico combo" thread.

I trust that your design will be double sided from the word go though. Mine was originally a DIY design.
Edited 2021-07-24 17:46 by Mixtel90
Mick

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

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1958
Posted: 07:58am 24 Jul 2021
Copy link to clipboard 
Print this post

Yes double sided, I use DipTrace and get them made by PCB GoGo.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
jaybek
Newbie

Joined: 25/05/2020
Location: Greenland
Posts: 18
Posted: 12:27pm 24 Jul 2021
Copy link to clipboard 
Print this post

I presume this 3.2" display will work too, as it's got all the same specs as the 2.8" ILI9341, except it's bigger.

https://www.aliexpress.com/item/33040270372.html

Has anyone tried it?
#MeTo ZX81
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 02:12pm 24 Jul 2021
Copy link to clipboard 
Print this post

I think it would work fine on mine, but the fixing holes don't line up. I assume the same will apply to palcal's board unless he designs it round the 3.2" display.

Mine was very much designed round what I happen to have, and the fact that it will fit in a standard plastic box which I'd already cut out for the original backpack assembly - I'd no intention of buying another display. It almost broke my heart having to buy another RTC module because my existing one is far too bulky. lol
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 07:12pm 24 Jul 2021
Copy link to clipboard 
Print this post

Update to the doc for the PicoMite. I think I've caught all the comments so far, plus made a couple of other slight changes.
PicoMite Beta docs 00b6.zip
.
.
Mick

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

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 04:38am 25 Jul 2021
Copy link to clipboard 
Print this post

  Volhout said  
P.S. what is agains simply adding the SERVO command ? Do we exceed 256 commands ?

I would like to know too...
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 05:30am 25 Jul 2021
Copy link to clipboard 
Print this post

This is how I understand it, Cyber:

We can have 128 commands and 128 functions. Currently LIST COMMANDS is showing 129 (I'm not sure why - I suspect that UPDATE FIRMWARE may not count as it can't appear in a program).

Those restrictions were decided when MMBasic was written, are fundamental to how it works, and can't be changed without major work. They weren't restrictions at the time, but quite a bit has been added since. So, at the moment, a separate SERVO command can't be added because there's simply no room for it in the command table - another command would have to be dropped to make room for it. The very best that could probably be done (if there's space) might be BITBANG SERVO, but there really isn't a need for it as servos can be handled using PWM in MMBasic. You can always write

SUB SERVO(servo_number, angle)
...
END SUB

if you want something that reads nicely in a program. It just needs a little thought to sort out how to handle the sevo number / PWM channel association. Select Case springs to mind. You can have 8 servos, one for each PWM channel. You could make <angle> a percentage, 0-180 or -90 to +90 depending on what you want.

The restrictions are on "root" commands so what matherp has done in some cases is to "multiplex" commands so that they can do various functions. So, for example, MATH only takes up one slot in the table but gives 26(?) commands on the PicoMite. Changing HUMID to BITBANG HUMID freed up another slot.

EDIT: You can have up to 16 servos - I forgot about the A-B bit. lol
Edited 2021-07-25 18:36 by Mixtel90
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7458
Posted: 09:12am 25 Jul 2021
Copy link to clipboard 
Print this post

@matherp

Hardware question...
Do DOUT pins have a pullup resistor switched on? I've seen 50uA or so of leakage from pins where the program has been terminated with ctrl-C rather than the pins either set to zero or Setpin off. (i.e. a "dirty" shutdown). In both those cases the output disappears as expected. I've not tested this using an led from 3v3 via a resistor.
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3298
Posted: 05:02pm 25 Jul 2021
Copy link to clipboard 
Print this post

PicoMite PCB with 2x20 expansion PCB + modules



This is the same 2x20 board as shown previously for the F4 and CMM2, with a few wired modifications to fit the PicoMite PCB (mainly caused by fewer ADCs than on the F4 and CMM2, and some issues with PWM, and a desire not to take up 6-8 pins for an SPI LCD).

Here's the pin usage:
I used all of the Picomite pins, but had to reuse two of them to provide signals to all pins of the 2x20 connector. It was probably not a wise choice for flexibility, but I used pico pin 34 for both connector pins 12 and 13, and pin 11 for connector pins 15 and 16.

I wanted to retain a display for the module/device options, and use the rotary encoder to make choices. I used a 128x64 I2C SSD1306, with the option names reduced to 6 characters for the first column of 5, 5 characters for the second, and 6 for the third.
> option list
OPTION SYSTEM I2C GP10,GP11
OPTION LCDPANEL SSD1306I2C, LANDSCAPE
OPTION RTC AUTO ENABLED
OPTION GUI CONTROLS 59
OPTION MEMORY 60160, 100608

The second biggest change in the code was to "atomize" the performance of the module, to make it more like a state machine handling multiple modules simultaneously. I used SETTICK to extablish a 100ms minor tick, and 500ms for a major tick. The LEDs flash every 500ms, and the servo and PWMing changes occur every 100ms.

Here's what the menu looks like. Turning the rotary encoder causes the focus to change. The in-focus menu item will flash. If it has been selected by clicking the rotary encoder button, it will flash highlighted--black on white; if not selected, white on black.



Pic with MCP23017 flashing lights, 3-color LED cycling through 8 states, red LED blinking on and off, and LED attached to the SPI1 port blinking:



Here's a youtube video which shows:
1) menu selection by rotary encoder shown on SSD1306 I2C LCD
2) 3-color LED
3) LED flashing
4) Buzzer
5) MCP23017 flashing 16 LEDs
6) Servo slewing from full clockwise to full counter-clockwise and back
7) PWMing of 5V LED using MOSFET module
8) Dimming/brightening of 5V LED using MOSFET module using potentiometer
9) ultrasonic distance measuring module using COM0
10) flashing of LEDs attached to SPI1 MISO, MOSI, CLK, and CS

Picomite on Youtube

Code: sensors.zip

Picomite PCB gerbers: picomite_mcp2.4_2021-07-25.zip

2x20 Expansion PCB gerbers: 2x20_breakout_V3_2021-07-25.zip

EagleCad files: Picomite PCBs.zip

PicoMite on FruitOfTheShed
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1958
Posted: 10:32pm 25 Jul 2021
Copy link to clipboard 
Print this post

My humble Backpack offering, still needs a lot of checking.



"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 207
Posted: 11:48pm 25 Jul 2021
Copy link to clipboard 
Print this post

I don't wish to offend ANYONE but...
This thread is for PicoMite beta firmware.
There are some great people making some great PCBs for the PicoMite, but I believe they should all be in a "new" and different thread, I don't know, maybe called "PicoMite Hardware"?  Panky & zeitfest created their own threads, and good on them!
No offence but, can we keep threads on topic?
Just a thought
led
Miss you George
 
     Page 5 of 13    
Print this page
© JAQ Software 2025