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 : Introducing the Pi-cromite: first steps
Page 4 of 16 | |||||
Author | Message | ||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
|
||||
atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 711 |
So what? |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9030 |
I think he was just indicating that he got it going on his pi, that's all. Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5867 |
More playing, this time with a USB-TTL converter. There doesn't seem to be a way to change the baud rate yet. My FTDI converter defaulted to 9600 baud. It seems to need the "FOR RANDOM" bit in there so we think its a file. A Linux observation - The text is sent with a <LF> only so if you are waiting for the <CR>, you will be disappointed. So far I have tested with a loopback plug on the serial adapter but there is no reason a micromite couldn't be sitting there. This version on MMBasic doesn't save your code between sessions so remember to do a SAVE before exiting! Jim VK7JH MMedit  MMBasic Help |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Hi, Should this work on a Model B? I can get it to run but it crashes the rPi at the mmbasic command prompt. On a fresh install of Jessie which has pigpio installed already. Anthony. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8516 |
The pin usage of the early Pis were different. The code should work properly on A+, B+, Pi Zero (W), Pi2B, Pi3B but not currently on Model A, B, or B (revision 2). This could probably be fixed but isn't something I will look at until I have more of the normal Micromite style I/O working (I2C, SPI, PWM etc.). |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8516 |
Fairly big upgrade 5.3a2 including more "Micromite" functionality 2017-04-14_184056_mmbasic.zip This now supports hardware SPI using Pi pins 19,21,and 23 with the standard Micromite syntax (SPI OPEN, ? SPI(x), SPI WRITE, SPI READ) In addition it supports the following SPI displays connected to the same pins (+ user selectable CD, CS, RESET) ILI9341 (320x240), ILI9163 (128x128) , ST7735 (128x160), ILI9481 (480x320). Transparent text and BLIT are available for the ILI9341 display. Touch is fully implemented and should also be connected to the SPI H/W pins + user selectable IRQ and CS. The displays and touch are enabled using the standard Micromite syntax (OPTION ...) Options are saved in the file ".options" in the same directory as the mmbasic executable GUI TEST LCDPANEL and GUI TEST TOUCH are both implemented (exit using ctrl-C) All MX470 GUI capability is also implemented and has been tested at a limited level. as before you need to install pigpio on your Pi if not already installed [code]sudo apt-get update sudo apt-get install pigpio python-pigpio python3-pigpio [/code] and execute mmbasic using sudo ./mmbasic Always exit mmbasic using ctrl-z or "quit" to avoid leaving disconnected processes running on the Pi which will interfere with pigpio initialisation |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
|
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 812 |
...is it possible that's our Pi-cromite doesn't work on a older Raspberry-Pi B? (not B+, Pi2 or Pi3) It start's but I can't type something in - ctrl-z also doesn't work! I have some Odroid-W which have the original chipset from the B (but with integrated battery loader and RTC) - they are ideal for battery operation - it would be very nice to have our MMBasic on it... Frank |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3641 |
Peter already posted some examples that are not supported, so yes. (Though when time permits or someone helps then maybe there's nothing too hard to tweak so it would work.) John |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8516 |
More functionality in 5.3a3 2017-04-15_105256_mmbasic.zip This version includes support for SETPIN CIN, PIN, and FIN which are enabled on physical pins 11,13,15, and 16. Syntax is exactly the same as the Micromite. I have also allowed the count to be initialised using the PIN command [code]setpin 11,CIN ? pin(11) : pin(11)=0 [/code] Accuracy is maintained up to something just over 100KHz PWM and SERVO are also implemented. The implementation is slightly different from the Micromite to support the Pi hardware, in some ways better, in some ways worse In both cases you can use any pin for PWM or SERVO and the command sets up one pin at a time - there is no limit on the number of pins used in this way. Frequencies and duty cycles are individually set per pin within the following restrictions: SPECIAL CASE PIN 12 This has true hardware PWM and the frequency can be set anywhere between 1Hz and 25MHz. Duty cycle is expressed as a percentage (like the Micromite). The underlying clock is 250MHz so with a 25MHz output the duty cycle will move in steps of 25/250 = 10%. At 250Hz the duty cycle will move in steps of 0.0001% ALL OTHER PINS These use a PWM based on a 1uS clock and the valid frequencies will be exact divisors of 1,000,000. The maximum frequency is 20KHz where the duty cycle will move in steps of 2%. If a frequency of say 433Hz is input the actual frequency will round to the nearest of: [quote]1,2,4,5,8,10,16,20,25,32,40,50,80,100,125,160,200,250,400,500,625,800,1000,1250,2000,2500,4000,5000,10000,20000[/quote] At 50Hz (the fixed frequency for the SERVO command) the duty cycle will be accurate to 1 in 20000 and over the range of 1-2 milliseconds which are valid for a servo the accuracy is therefore 1 in 1000 Syntax: [code]PWM pin, frequency(Hz), duty-cycle(%) SERVO pin, milliseconds (1-2)[/code] Note the SERVO command is fixed 50Hz frequency and only allows "valid" periods in the range of 1 to 2 milliseconds. Of course you can use the PWM command to generate any non-standard servo output but be aware this can damage a servo. |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
> SPECIAL CASE PIN 12 > This has true hardware PWM > and the frequency can be set > anywhere between 1Hz and 25MHz. Can that pin also do variable baud serial out ? I.E. Midi ? |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8516 |
sorry I don't understand the question or the link to PWM |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3641 |
I don't see the relevance of PWM to MIDI. You could perhaps use a uart/usart (read up to see but I think not) or else bitbang on a gpio. (If doing that, think about timings and consider a driver.) google suggests people have looked at RPi & MIDI already. John |
||||
PicFan Senior Member Joined: 18/03/2014 Location: AustriaPosts: 133 |
Hello matherp! Many Thanks you for your great work, but unfortunately I have a small problem with the new version 15-04-2017. sudo ./mmbasic ./mmbasic: symbol lookup error: ./mmbasic undefined symbol: gpioSetPad Unfortunately I am a Raspberry Pi beginner, but the Version 11-04-2017 works ? Thanks and greetings from Austria Wolfgang |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8516 |
Wolfgang Sounds like you are running a different version of pigpio Try following instructions here to install the same version as me Did you get pigpio using apt-get? if so it looks like the version there is out-of-date |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
> sorry I don't understand the question or the link to PWM > I don't see the relevance of PWM to MIDI. Duh ..... I was thinking of the variable frequencies vs. set ones. Is there a pin that will do midi messages ? ( 8-bit words (commonly called bytes) that are transmitted serially at a rate of 31.25 kbit/s ) |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3641 |
Just use google or the like and read :) Plenty of people have had an interest in RPi and MIDI. John |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
Not with MMBasic . |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3641 |
Step 1: read how to get RPi & MIDI working Step 2: do it from MMBasic (the easy part) John |
||||
Page 4 of 16 |
Print this page |