![]() |
Forum Index : Microcontroller and PC projects : Introducing the Pi-cromite: first steps
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
See post second from the bottom on page 6 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
Attached version 5.4.a02 2017-06-12_182528_mmbasic.zip This now (hopefully) has the GUI changes that Geoff has included in 5.4.04 When a text or number box is touched the pen down interrupt subroutine will now be called before the keypad is drawn. This gives the programmer the opportunity to redraw non GUI graphics to accommodate the keypad which is about to appear. When the touch is removed the pen up interrupt will be called after the keypad is removed so that any non GUI graphics can be redrawn. This is a key feature in allowing the mixing of non GUI graphics with GUI controls. The virtual keyboard generated when the user touches a Number Box or a Text Box can be dismissed by the program using the commands GUI NUMBERBOX CANCEL or GUI TEXTRBOX CANCEL. Fixed a bug where the blinking of the GUI LED control could disrupt other graphics operations (like drawing text). |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Peter Thanks for the explanation It's a pity as serial is widley used with sorts of modules. Regards Jman |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Jman, I agree to you. Non working or unreliable serial ports are for lots of applications a "no go" situation. Don't understand why the process mmbasic has problems with it. Why bitbanging, mmbasic could use the standard calls to Linux for communication ?! THX. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
Gosh I never thought of that ![]() Pi 3 and Pi Zero W use the only true UART for bluetooth. There is also a mini-UART (pins 8 and 10) but this is tied to the system CPU clock and as processor load changes the baud rate can change. In addition by default LINUX uses the Pi 3 and Zero W mini-UART as a console so the logon prompt will appear when used. This would then need to be disabled meaning that additional LINUX work is needed on an install. Serial input is pretty reliable as the I/O ports are read by a DMA every microsecond - the issue is with output If you want reliable comms then a clocked protocol (I2C or SPI) is the best solution |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2428 |
i had wondered how you were getting multiple serial ports. might i suggest thinking about abandoning the software serial ports completely, and simply requiring the user to exclusively use USB to serial bridges instead? this provides for an unlimited number of serial ports leveraged off the strengths of having an underlying linux kernel, that is the USB support. it also makes adding additional serial ports much easier, plug-and-play as opposed to having to attach wires to the RPi's pin-header. this may well be a bonus for some non-technical users. cheers, rob :-) |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Robert, that is a very good Idea! And with ser2net we get rs232 over the air😄 Heureka. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
Attached 5.4.a03 2017-06-13_094435_mmbasic.zip This fixes the issue with serial ports. Based on limited testing transmit at up to 115200 now works perfectly. One other change: MM.DEVICE$ now gives the hardware revision code of the Raspberry Pi |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
Thanks for a03 ![]() So how did you tackle the serial 'issue' in the end (just curious). |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
![]() ![]() ![]() ![]() Awesome news thank you so much for all the effort you put into this Regards Jman |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Thank you ! |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Thanks Peter i did some limted testing and success this is with a PI Zero (NOT W) Before After Regards Jman |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
Attached 5.4.a04 2017-06-18_183954_mmbasic.zip This has a new command "BITSTREAM" at the request of RonnS which mimics the bitbanger CFunction on the MM+ ![]() This waveform was created with the program DIM INTEGER BITS[10) SETPIN 40,DOUT PIN(40)=0 FOR i=0 to 10 BITS(i)= i*2 + 10 NEXT i BITSTREAM 40, 11, BITS() The syntax is: BITSTREAM pin_number, number_of_pulses, array_of_pulse_lengths () in microseconds Notes: unlike the bitbanger function the BITSTREAM command will automatically create an end transition to the last pulse. The direction of the first pulse will be determined by the state of the pin when BITSTREAM is called. If it is high then the first pulse will be at zero, if it is low the first pulse will be at 3.3V The arrays can be INTEGER or FLOAT but the pulse length must be specified in microseconds The miniumum pulse length and pulse increment is 1uS There is a known clock issue on the Pi 3 (it is not know if this affects all boards or only some - it certainly affects mine). Timings for the Pi 3 are scaled by 1.128 so pulses may be wrong by up to 0.5uS. The Pi Zero W works perfectly. In addition 5.4.a04 has some tidying up of digital I/O to remove runt pulses when using SETPIN x,DOUT I would like feedback on whether serial output works properly on your PI 3 as this is subject to the same clock issue as described above and I've tuned the timings to work on my Pi 3. |
||||
gumath Newbie ![]() Joined: 25/04/2017 Location: AustriaPosts: 10 |
@matherp Hi Peter, With PI 3, Serial input works Serial output does not work OPEN "/ dev / ttyUSB0" FOR RANDOM AS # 5 'open the serial port Works in both direction, but only 9600 baud Thank you, for your many time Vy 73 de Guenter, OE7GMT |
||||
plasma Guru ![]() Joined: 08/04/2012 Location: GermanyPosts: 437 |
Hi Matherp , will the bitstream code work for the rgb leds such like ws2812b? mfg |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
No: they require sub-microsecond pulses |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Where to find Documentation / Manual for the PI-Cromite? THX DS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10197 |
Everything is on this thread + this and this and this |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2949 |
Should that be an open bracket instead of square bracket Peter? Kind Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
OK, so far no written Documentation in PDF or so... One Forum Member wrote: "OPEN "/ dev / ttyUSB0" FOR RANDOM AS # 5 'open the serial port" Didn't know that Picromite can do things like this. How could i know if not documented, or did i miss it somewhere ?? THX DS |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |