|
Forum Index : Microcontroller and PC projects : Pico Radar
| Author | Message | ||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6410 |
Don't have a cat to test with but small dogs are OK. One issue is with multiple targets. It tends to get the targets mixed up so the dog becomes the cat. For the price, they are a useful gadget to have in the collection. I might put a portable one outside to see if it can track the rabbits. Jim VK7JH MMedit |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
The screen would be completely covered in dots here! |
||||
| v.lenzer Regular Member Joined: 04/05/2024 Location: GermanyPosts: 89 |
Hi Gerald! If I wanted to integrate a menu (touchscreen operation), what would be necessary or useful for an LCD display? It's only about configuring the application before starting it. - Single/Multi target tracking - Enable/suppress zero x-axis values (what exactly is that?) - Exit (for when the radar is installed in a housing and you can operate it without the RP2040 via an app) - Start Best wishes! Joachim |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
Joachim, I think any display supported by MMBasic with SPI and XPT2046 touch controller will do. You could even use a capacitive touch with Ft6336, but the accuracy is not so good and you need a touch-pen as the displays are IMHO generally too small to be touched with fingers directly. But depends on the size of screen objects you are using and the size of the fingers. Resistive displays react on fingernails quite well, capacitve don't. There are no higher speed requirements as the refresh rate is 10/second. So I would prefer SPI because the number of wires needed is lower than with parallel. If possible/affordable, use an IPS panel, not TFT as contrast and bightness are higer and readability in bright environments is better. If you want to store something on SD-card, you can get a display with integrated SD-card. Usually they work For the supported display controllers look at the picomite user manual (the draft for V6.01 is already available but V6.00.03 will do as well). Important is the controller for the LCD and the touch. TFT and IPS make only a difference in the option statement at the configuration (IPS usually needs INVERT). You can chose from a range of physical display sizes and x/y resolutions. On e.g. AliExpress you will find matching displays as well as on Amazon or ebay. Berrybase is an option in Germany as well. It's your choice ... Conrollers I've already used cover ILI9488, ST7796, ST7735, ILI9341 (I even retrofitted it with an IPS panel). Beware of the yellow boards with ILI9341/FT6336 and IPS on ALi if you want to use SD. The SD-Card is completely unusable because of wrong layout of the board. Otherwise the display and touch do work well. ILI9488 controllers have an issue when you want to read out the display into the pico with the touch controller. There are threads on this forum discussing different solutions. But they all need some soldering on the display board. Another option are Pico-ResTouch-LCD-3.5 or Pico-ResTouch-LCD-2.8 from Waveshare. They have the socket for the Pico-board integrated, so you just plug the pico-board in. The down side is that there is no access to the Pico pins via a connector. So you have to solder the serial line to the pico board (sic!). Not really nice looking, but doable if you do not intend to change the pico often. Also has SD-card on board. PRO: the least wiring required of all options. But there are, of course, some points to may take into consideration: If you want to mount the project in a box, you migth also consider the mounting holes of the displays, as they are sometimes not optimal, dependig on the box you intend to use. E.g. the Waveshare displays have only nuts on the backside, the rest (I have) has holes that can take screws from the front side. If you want the SD-card changeable, you need to take into account the position of the SD socket. On the software side the GUI statements are simple to use and work quite well for what you have planned. The complete touch subsystem is there and deliveres interrupts. Note: you cannot use a WebMite then, because MMBasic on WebMites doesn't support GUI. Hope this helps more than I've confused you ... Gerald Edited 2025-12-15 07:22 by ville56 73 de OE1HGA, Gerald |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
Yes, that complicates things a little but isn't a deal breaker. The Advanced GUI Controls can't be used but the standard drawing and text commands along with the basic touch functions can be used to construct a usable user interface. For example a row or column of buttons (Circle or Box) with adjacent text to describe their function can be drawn. Then define the area of the buttons to set variables when touched. For numerical input label the buttons 0 to 9 and "Enter". Multi digit numbers can be assembled by appending the individual digits to a string then converting that to a number. |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
You are right of course. It can be done, if you are willing to take the burden. And how big the burden is may be different for each of us. So I mentioned it just as a point to consider but yes, my phrasing may have been misleading. 73 de OE1HGA, Gerald |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
A primitive example to control the screen backlight. ' rudimentary screen backlight control Sub MM.Startup Dim BL = 11 'initial setting Backlight BL CLS 64 'dark blue SetPin gp23, INTL, TouchInt 'set the T_IRQ, PEN or T_INT pin 'define 2 buttons, top right and bottom right RBox MM.HRES *.8, 1, MM.HRES *.2, MM.VRES *.1, 9, RGB(white), RGB(myrtle) Text MM.HRES*.9,16," Bright ","CM" 'label the top button RBox MM.HRES *.8, MM.VRES *.9, MM.HRES *.2, MM.VRES *.1, 9, RGB(white), RGB(myrtle) Text MM.HRES*.9,MM.VRES-16," Dim ","CM" 'label the bottom button End Sub Do 'your program here Loop Sub TouchInt Do While Touch(x)+1 'continue reading touch until released (then Touch(x)=-1) If Touch(x) > MM.HRES *.8 Then 'read only the right side of the screen If Touch(y) < MM.VRES *.15 Then Inc BL,1 'read the top of the screen, adjust BL up If BL > 99 Then BL=100 If Touch(y) > MM.VRES *.85 Then Inc BL,-1 'read the bottom of the screen, adjust BL down If BL < 2 Then BL=2 Backlight BL Text 10,10,Str$(BL,3) Pause 50 EndIf Loop Print "Backlight ="; BL End Sub End Edited 2025-12-15 10:30 by phil99 |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
somehow that doesn't work for me ... I've set Option touch gp 10,gp9 and in the code setpin mm.info(pinno t_pin), intl, __t_isr where t_pin = "GP9" which gives me [30] SetPin MM.Info(pinno t_pin), intl, __t_isr Error : Pin 12/GP9 is reserved on startup so for some reason it cannot connect the pin interrupt to the pin already assigned in the option touch ... According to the manual it should work that way but it doesn't. 73 de OE1HGA, Gerald |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
That is odd. The only difference I can see is mm.info(pinno t_pin) returns the Pico pin number as an integer and I am using the GP number. This method has worked over many firmware updates so all I can suggest is change that line and see what happens. Edit. It works for me if done like this:- Dim String t_pin = "GP9" SetPin MM.Info(pinno t_pin), INTL, TouchInt Edit 2. Presumably the space between "gp" and "10" is just a typo in your post and not in the options? Option touch gp 10,gp9 Edited 2025-12-15 21:16 by phil99 |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
solved ... had "option gui controls 10" set. This seems to finally lock the touch irq pin. In the list pins it shows up as GP9 12 Boot Reserved : TOUCH IRQ in both cases, so the unlocked state is not really obvious. 73 de OE1HGA, Gerald |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
Ok, I should have said that example was for the WebMite which doesn't have "option gui controls" Edited 2025-12-15 21:25 by phil99 |
||||
| v.lenzer Regular Member Joined: 04/05/2024 Location: GermanyPosts: 89 |
The technical questions have already been answered. My question was more about the menu content. I think the option for single/multiple tracking needs to be included. Is "Enable/suppress zero x-axis values" necessary? And then a "start" option. That should be enough, right? Best wishes! Joachim |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
next version with "poor mans gui (pmg)" routines ... also usable on Webmite. Just try it and have fun. The pmg routines are not really tested in depth and are not fully completed yet (circle) but sufficient for the current job and seem to run ok so far. The gui covers box and rbox and also rudimentary circle. Should be simple to adapt, I hope at least. Radar-V2.0.2.zip !!! Forgot to mention that you have to change the pin for the Touch interrupt in the code to meet your setup. Is currently hiden in line 134, sorry about that. Didn't think .... Edited 2025-12-16 02:44 by ville56 73 de OE1HGA, Gerald |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
Couldn't leave it as it was. Radar-V2.0.3.zip cleaned up ... just moved the touch pin definition to where it belongs, removed some debugging print statements and added some comments. 73 de OE1HGA, Gerald |
||||
| Wolfgang Regular Member Joined: 03/11/2021 Location: GermanyPosts: 74 |
Hello experts, the ordered radar modules have finally arrived. I immediately started my first tests with that HLK-2450 and noticed that the radar- module update rate is not 10Hz/sec = 100ms as described in the manual, but was sent every ~50ms. Is that correct? Wolfgang |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
According to the manual and what I did measure, it's 100 mSec. But your part may be a bit different, it's all chinese... But as long as the processing time is less than the measuring interval it should be ok. Gerald 73 de OE1HGA, Gerald |
||||
| v.lenzer Regular Member Joined: 04/05/2024 Location: GermanyPosts: 89 |
Hi Gerald! I'm currently trying to get version V2.0.3 working. I've calibrated the touchscreen. When I press the menu button (with the included plastic stylus), I get no response. I've left GP9 as the interrupt pin in the program as it is. Something seems to be wrong with that. Trying GP15 didn't help. Do you have any ideas? 'PicoMite MMBasic RP2040 V6.01.00RC25 'OPTION SYSTEM SPI GP6,GP3,GP4 'OPTION COLOURCODE ON 'OPTION CPUSPEED (KHz) 200000 'OPTION LCDPANEL ILI9341, LANDSCAPE,GP7,GP2,GP5 'OPTION GUI CONTROLS 20 'OPTION TOUCH GP14,GP15 'GUI CALIBRATE 0, 172, 180, 895, 655 GP0 1 OFF GP1 2 OFF GP2 4 Boot Reserved : LCD Reset GP3 5 Boot Reserved: SPI SYSTEM MOSI GP4 6 Boot Reserved : SPI SYSTEM MISO GP5 7 Boot Reserved : LCD CS GP6 9 Boot Reserved : SPI SYSTEM CLK GP7 10 boat Reserved: LCD DC GP8 11 OFF GP9 12 INTL GP10 14 OFF GP11 15 OFF GP12 16 OFF GP13 17 OFF GP14 19 Boat Reserved : TOUCH CS GP15 20 Boot Reserved : TOUCH IRQ Edited 2025-12-19 04:56 by v.lenzer Best wishes! Joachim |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
Joachim, you must not specify OPTION GUI CONTROLS. If you do, you will not get an interrupt via a pin interrupt from the touch. And a pin interrupt is exactly what I'm using for the touch. Appearently the interrupt is then trapped by the GUI subsystem and does not reach the normal interrupt handler. I stumbled over exactly the same issue when developing the "poor mans gui" a few days ago. Unfortunately case this is not documented in the manual. Edited 2025-12-19 06:46 by ville56 73 de OE1HGA, Gerald |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2891 |
As a work-around perhaps instead of assigning an ISR pin poll for Touch(x) in the main loop. eg. Do Tested OK in my previous example program. Now it doesn't matter if OPTION GUI CONTROLS is set.'... If Touch(x)+1 Then t_isr '... Loop Sub t_isr '... End Sub Edited 2025-12-19 07:51 by phil99 |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 366 |
touch interrupt is edge triggered, your workaround is level triggered. This may work or not depending on the processing logic and you waste cpu cycles for sure. If "option touch" is specified you will get a pin interrupt on the irq-line if so specified with a setpin mm.info(pinno t_pin), intl, __t_isr where t_pin is the touch irq pin. And yes, I dislike polling and love interrupts. So my pov may be a bit biased ..- Gerald 73 de OE1HGA, Gerald |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |