#circuitpython-dev
1 messages ยท Page 262 of 1
OK, this is actually a manifestation of a bug in atmel-samd/tick.c, plus the bug in clear_temp_status(). It's supposed to do a filesystem flush once a second, but it's failing to do that. So the nrf port is actually doing the right thing, but in the process of checking whether to flush the filesystem, it's changing the status neopixel color without checking whether someone else is using neopixel.
The filesystem flushing should probably not fiddle with the status color unless it actuall...
Fixes #2114.
clear_temp_status()now checks whether status NeoPixel or DotStar is in use.- in
atmel_samd/tick.c,SysTickHandler()ws not callingfilesystem_tick()
There is very similar code in the different versions of ports/*/tick.c which should be factored out eventually into common code. That's part of why the second bug above existed. Since we should rewrite the timing code anyway for #696 (sleep and wakeup), I don't think it's worth refactoring right now.
Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907
The code below attempts to update the text of a displayio Label on a 2-color EPD FeatherWing, but only the first iteration is displayed. Text does not update after the first iteration on the 2-color EPD. It goes through its flashing motions, but the same text appears again in every loop. print() output shows the code is progressing through its loops with the 2-color EPD.
Similar...
Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907
The code below attempts to implement the Sprite Sheet example from:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/sprite-sheet
...by adapting it to the timing requirements of EPD displays (e.g., time.sleep(display.time_to_refresh))
The first iteration through t...
I'm curious, how are the priorities gonna be with stm port coming in, is samd still flagship or will we slowly move to stm? https://www.instagram.com/p/B2NfdL4H_E6/?igshid=5kwa8ogetqn8
๐
@onyx hinge you have written that sometimes your computer (linux) locks up?!
i have a eventually similar / related problem sometimes here:
- ItsyBitsy M4 Express (about newest UF2 bootloader)
- Kubuntu 19.04 64bit
- Laptop: Dell Latitude E6510 (~9Years Old..)
i currently mostly upload Arduino firmwares - this with the Bootloader and the UF2 drive thing.
sometimes my computer locks up - in a way i only can do a hard shutdown...
i think it has to do with the usb hardware/software and the multiple & fast enumerations....
and till now i did not had patience to investigate more time into this...
When I build the current master on my Mac , I see these "find: illegal option -- t" errors.
The errors do not appear to impact the build, but I don't see where they are coming from.
I don't see them for any other board.
Build stm32f411ve_discovery for en_US took 33.03s and succeeded
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
find: illegal option -- t
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]...
I suspect it's due to this line in Makefile
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')
plus the fact that FROZEN_MPY_DIR is probably empty or unset.
Linux "find" treats find -type f as find . -type f (i.e., it searches starting at the current directory) while bsd-derived find seems to require at least one path to be specified.
I suggest to protect the use if FROZEN_MPY_DIR with ifneq ($(FROZEN_MPY_DIR),) as in stm32/Makefile as a pos...
any deep reason why "thing plus" (samd51) isn't CP-supported? https://www.sparkfun.com/products/14713 no qspi, I guess, which might make it feel limited.
hm, the schematic says it has "4Mb flash" (SPI connected). I wonder if that's 4Mb = 512kB, or 4MB.
I'm guessing 4Mb (512kB), but since the part number isn't given and I can't read it on the board pictures, I suppose the next step would be to download the EAGLE files and see if the part is defined there. There is a zip file in the github, but I don't know if it contains a BOM or not.
yeah no part number is visible on the schematic. I didn't bother trying to download the eagle file
"You have an order status of Exception. Don't worry! This order just requires a quick review by our Customer Service team before it can ship" blah! (sparkfun -- I decided to pick up one of those thing plus boards, plus another $180 of stuff I probably don't need ๐ฐ )
I just had my shipping switched to FedEx on a Digikey order because something (I'm guessing flux remover) required special handling.
@main meteor and @onyx hinge - I just happen to have a Thing Plus on my desk and a microscope within walking distance. The part number on the memory is 25SF041, and it's an Adesto part.
That's a definitive answer, thanks! Sure enough, it's 4Mb = 512kB.
I love it when people "just happen" to have a microscope (and the object of interest) at hand.
thanks @old smelt !
You know... There's really no good "You're welcome" emoticon, is there?
tested on feather_nrf52840 - works now.
also tested on metro_m4_airlift_lite -- works, but it also worked OK before this PR.
tested at REPL with
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixels[0] = (255, 0, 0)
@jerryneedell Thank you. What was hidden on the atmel-samd boards is that they weren't actually flushing the filesystem promptly, so this fix may help to reduce corrupted filesystems, which was the intent of the code that was working in nrf but not atmel-samd.
@old smelt probably because it's not an emotion
@indigo wedge There is no movement toward replacing SAMD. STM Arduino support is not great, and there are still plenty of Arduino users of our boards. Some STM chips have quirks, such as not enough USB endpoints, etc. The more chips we can support, the larger the ecosystem.
Great to hear ๐
Just wanted to make sure cause I have boards in the pipeline that use CP and they are samd
@tulip sleet Question about cap touch on Bluefruit when/if you're around.
@idle owl ok back
@tulip sleet Ok. Does the same CircuitPython "calibration" concept apply to the Bluefruit as the Express, as in on board start-up, it calibrates based on what's connected to the touch pads?
yes, but Nick picked a different threshold calculation method:
self->threshold = raw_reading * 1.05 + 100;
if that seems like its not consistent, then we can change it
For the purposes of this, that isn't relevant. I wanted to make sure the bit in the guide that said to reboot the board if you're getting weird readings was still accurate or if I needed to add a note about the Bluefruit
Good to know, I'll keep that in mind
the old one is just "not touched value" + 100
Huh ok
ok, sounds good
What's the 1.05 do then?
5% added to it for a better buffer?
Or a more "relative" buffer anyway..?
@onyx hinge @old smelt would love to support thing plus! just haven't gotten a pr from anyone to add it
yeah, maybe, I'm not sure how he arrived it, and how much experimentation he did
@tulip sleet you may want to chime in on https://forums.adafruit.com/viewtopic.php?f=60&t=156151
It kind of makes sense because +100 could be minute at higher readings.
Anyway, good to know, I'll keep that in mind in the event we get feedback on it.
I did a lot experimentation to get 100. It used to be a much higher multiplicative threshold. But i saw that the touched/not-touched values were not scaling when the wire got longer
Interesting
I do remember it being terrible for a while.
The backflips I had to do to get the key limes to work on that first project were ridiculous.
yes, it was way too insensitive
They interfered with each other so badly.
I obviously assumed it was something I was doing. Until JP ran into the same thing and we fixed it. ๐
@idle owl , @tulip sleet what I've done in my programming for cap touch and ldr connections is a run a calibration at boot up that reads the pin for 100 to 200ms and save the highest raw value read and then add 100 to the value. This usually works well for calibrating the input threshold.
@sterile bronze do you mean in CircuitPython or using something else? We read the value when the TouchIn object is created, but just once, and then add 100 (for QTouch/FreeTouch on SAMD21)
In CP I usually add it to my program but I have done this for other boards when the pin is assigned. I haven't written any bootloader files for CP.
Is microcontroller.cpu.temp supposed to be in 0.25 degrees C increments?
@idle owl not deliberately, but it might come out that way. I wouldn't write that down
@tulip sleet Hmm ok. Thanks.
it might be due to the granularity of the reading. There was just a formula to apply to the raw values
The boot up time for the CP boards is very fast, which is very nice, so it may not be practical to add it when the pin assignment is done. Most of my previous work has been at the industrial end on dedicated machines.
@tulip sleet Because it's definitely coming out that way on the Bluefruit.
@sterile bronze since we assign pins dynamically, we wouldn't check until the pin is claimed for touchio
My screenshots in the guide imply that it wasn't the case on whatever board I used for the screenshots.
hmm, ok, you could just say the precision is 0.25 deg C. I'll look at the code.
Thank you for the refactor and added comments. Please mark comments as resolved as you address them next time. Thanks!
The guide page is meant to be general to apply to all of the boards. Except it refers to the ATSAMD21. So I'm assuming we wrote it before we had M4s.
I guess I should test it on an M4.
@idle owl hmm ok, data sheet says:
6.28 TEMP โ Temperature sensor
The temperature sensor measures die temperature over the temperature range of the device. Linearity
compensation can be implemented if required by the application.
Listed here are the main features for TEMP:
โข Temperature range is greater than or equal to operating temperature of the device
โข Resolution is 0.25 degrees
The SAMD51 Thing Plus from sparkfun looks like a good candidate for CircuitPython. Add support for this board, or determine why it's not feasible.
https://learn.sparkfun.com/tutorials/samd51-thing-plus-hookup-guide/all
Note that while this isn't called out clearly in feature lists, it features a 4Mb (256KB) SPI flash, verified by jasonp on discord
Hmm
Interesting! Please take a look at the test failure and fix it. Thanks!
so you can say that in the CPB guide. On the SAMD chips, there's a much more complicated formula to compute the value, involving multiple readings and calibration values
We're not really doing separate pages for the CPB, so it'll have to be a note on the general page. And it's the same part on CPX, which I'm testing now.
oh wait
are you using microcontroller.cpu.temperature? That's what I'm talking about
I was thinking thermistor.
Yes that is what I'm talking about.
I conflated the two in my head just now.
So the nRF has 0.25 resolution.
is the important piece of information here. And the ATSAMD do not.
yup. It actually returns an integer which we divide by 4
Hmm ok
I have one of these on order, and hope to knock it out some even next week. If it's been longer than that, someone else should feel free to pick this up.
Same for M4?
but no reason to say that
Right
M0 and M4 are similarly complicated but not the same
But the resolution on the M4 is like the M0?
Trying to figure out what I need to add to this page as notes.
one thing about terminology: we casually say M0 and M4, but those are really ARM architecture designations. The SAMD21 is an M0, the SAMD51 is an M4, and the nRF chips are also M4.
Good call.
so I'd avoid using M0 and M4 to designate classes of boards, use SAMD21 and SAMD51 and nRF52840 instead
looking in SAMD51 datasheet
there's no defined accuracy or precision for the temperature sensors on-chip on SAMD21 and SAMD51
the raw values are taken from ADC readings, and then there's a formula using multiple calibration values to calculate the final value. The SAMD51 datasheet is actually incomplete about how to use the ADC to get the temp: I had to do trial and error to see what worked
Should I chuck in an issue for samd51 thing plus in the u2f bootloader repo too?
er u2f must not be what I mean
uf2
or maybe it already has one
@tulip sleet SAMD51 looks like 21 in terms of 4 decimal places returned for temp. Thanks!
"In addition, this board comes flashed with the same convenient, UF2 bootloader as the RedBoard Turbo." yay
@idle owl do you mean you see slight variations in the 4th digit? printing 4 digits is just the size of the floats.
and the accuracy is much worse than that
No, I guess I didn't compare the two, I simply checked the resolution.
We explain in the guide it's not accurate or precise.
But that it's close
hiya @santaimpersonator please try this out and submit a PR so we can generate builds automagically
Opening new issue to narrow focus of #1933. See that issue for original details.
run_background_tasks() calls a number of routines that need to run in the background. Some of these do extensive checking to see if there's anything to do. The overhead of these routines could be reduced to save a substantial amount of time (like another factor of 2).
run_background_tasks() is called in after the completion of every jump opcode and every return in vm.c. So an improvement here would sp...
@onyx hinge we thought you might be a good choice for working on #2142 above; added to Basecamp
Could we start by saying that if there hasn't been a 1ms tick, we won't even check whether any background task needs to be done?
Any advice on how to benchmark this and measure concrete speed-up? pystone benchmark is one I've used in the past when estimating how much nRF lto increased speed.
@tannewt thought that 1ms ticks might produce frame rates that were somewhat off for higher-frame rate display refreshes, so it'd be good to discuss that with him.
In #1933, I just measured a very simple loop to get what the maximum raw speedup was. I think that might be sufficient here: we're not targeting a particular speed, but just looking to minimize the background overhead.
I saw some signs that j-link can do detailed instruction level coverage reporting, which would be useful in answering just how many cycles background tasks slurp up when they are called. I will have to see whether I can get that to work.
@onyx hinge I think you can just set the USB background on a 1ms intervl and comment out most or all of the other background tasks, and then put them back one at a time. I think that will still lead to a functioning CPy, and you'll be able to measure each one, and how improvement to each task's overhead contribute
as I mentioned in #1933, I was able to get CPy 3.x to run with no background tasks for a little while, and so got an upper bound on improvements
[adafruit/circuitpython-org] Pull request review submitted: #273 Drop 3\.x library, add 5\.x library
Looks great! Thanks for updating this!
Is STEMMA QT intended only for sensor boards/small devices? The documentation kind of leans that direction. The QT connector is nice and compact + QWIIC compatible which is dandy.
It looks like the new Feather STM32F405 uses the QT connector. So, apparently that's cool? Just verifying...
yep will have a stemma QT
its back compatible with qwiic - only diff is it will work with 5V or 3V
QT is for..cutie ๐ smaller connector! great for lil breakouts
Great, thanks!
We have something of a requirement for QWIIC, but like the STEMMA a lot. QT solves the problem.
yep works just fine with 3V logic
more sensors coming soon
lemme know if you have any requests
Will do!
@pastel panther Is MSA301 not in the bundle for a reason?
Likely I forgot?
That's fair. Wasn't sure if it was WIP or something.
Looks like the only important one missing from the bundle.
ah poop, gimmie a minute
No rush, simply ran the check to verify.
ya, It'll just take a sec and then I won't have t remember again
Right on
speaking of stm: https://www.st.com/en/microcontrollers-microprocessors/stm32l552zc.html
Cortexยฎ-M33 @ 110 MHz, 512 Kbytes of Flash memory and 256 Kbytes of SRAM
- Four I2Cs
- Three SPIs
- Three USARTs, two UARTs and one low-power UART
- Two SAIs
- One SDMMC
- One FDCAN
- USB device FS
- USB Type-C / USB power delivery controller
๐
@pastel panther I requested changes, in case it didn't notify you.
@idle owl Didn't check my email yet. I responded
@idle owl Bitte
@tulip sleet Other than removing the 2.x code and 3.x references, any other changes you'd want to make to this code? It still works great, but I wanted to make sure there weren't improvements to be made. https://learn.adafruit.com/adafruit-circuit-playground-express/playground-sound-meter
Adafruit Learning System
Make faster and easier than ever with MakeCode, code.org CSD, CircuitPython or Arduino!
And since I'm refactoring a lot of the CPX code right now, now's the time to do it if we want to.
@idle owl, no I think it's fine
Right on, thanks
obsessively removes vias from a board design in eagle
๐
@idle owl or other mac users: Do you have any idea how to keep OSX from pooping ._adfruit_foo.mpy files into my lib when I try copying over the bundle?
Or am I strange?
Regarding the ADCs: the reason I had distinct macros is that those are the only ADC combinations possible on STM32 (as far as I've seen across the whole F4 line). I felt it'd be helpful context to call that out, since whole banks of pins tend to be grouped into one of the categories. Do you think individual ADC triggers would still be better?
You're referring to the bit packing in this case, correct? I based this off the format of Dan's code in the nrf port - should we standardize this within nrf as well?
Also, I won't necessarily reduce the references to pin_port and pin_mask, since I still need them for fetching the port address and performing the mask shift. I think acquiring the port address is unavoidable but I could simply perform the mask shift in every reference. Do you think that'd be preferable stylistically?
@slender iron let me know if you could take a quick look at my comments regarding the bit packing, as they'll impact the wrap-up of analogio as well.
@ionic elk I'll look tomorrow. In the ble weeds at the moment
For circuitpython.org are the names of the boards on the downloads page pulled from the circuitpython-org GitHub or are they pulled from CircuitPython itself?
@gilded cradle Do you know? ^^
@idle owl the human readable names are from the -org repo
@slender iron Ok thanks. One of them is wrong. Wasn't sure where to fix it.
Haven't updated any of the boards before, so I'm guessing on what needed to be fixed.
Thanks to @jedgarpark for pointing this out!
@idle owl sounds like scott answered your question already
Yep, sorry to bug you! Scott seemed busy so I figured I'd ask you since you dealt with it a bunch.
Thanks for the merge!
yw
@idle owl, I'm not sure if you saw the circuitpython.org guide I did, but it might help: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
Adafruit Learning System
Want to add your CircuitPython or Blinka board to CircuitPython.org? Here's how.
@gilded cradle Yeah I wasn't sure whether it applied to that name, and if it didn't, figured it wouldn't be in the guide. So I asked instead.
Makes sense ๐
Ok off to assemble a bunk bed. Later!
Have fun
This PR will add the AnalogIO module to STM32. Confirmed functional on the STM32F411, but depends on pending changes to bitpacking style and USB via the general pin remap in #2126. Also looking for style/readability input on the use of the LL libraries vs HAL.
@tulip sleet you around?
@ionic elk hiya if ya give me a bin for '412 ill test it now!
It's a draft! Let's start the testing process in full after Scott gets a chance to review the bit packing stuff tomorrow and I integrate it in there.
hmmm what to do tonight
๐ผ . o O ( Work on something assigned ) ๐น . o O ( Work on something fun )
๐ผ . o O ( Tidy your working area )
hmmmm
so this can be made to "work", except it wouldn't survive from boot.py, contrary to micropython: ```>>> import busio, board
u = busio.UART(board.TX, board.RX)
u.mirror_console = True
@meager fog to work on something fun of course
๐
still count it towards your hours if its circuitpython
since your idea of fun is still, umm, work
I have a project to hook some kind of python-on-hardware board to a Commodore 64 like a good old fashioned serial modem
I will keep that in mind, thanks.
hmm over the uart? you should be able to, we talk to cell modules over AT
did you end up grabbing any nrf feathers?
Yeah, I can talk to it via UART, but what I would LIKE is for the code.py print() to talk to it, for the repl >>> to talk to it, etc.
Yeah, danh alerted me and I think I got an order in on the last one in stock
so as far as concrete learning goes, I now know what the heck it means when it is written: MP_STATE_VM(serial_mirror_obj) = (mp_obj_t)self; -- I still couldn't explain it though.
micropython has a form of repl redirection, but I couldn't get it to work 100%, and it is not at all configured to work with how circuitpython works
I hear scott is motivated to work on this too, because he wants to do a bluetooth keyboard + displayio screen as standalone
@meager fog btw thanks for taking good care of me. I look forward to having fully half my time to spend on CP stuff in November. I know you're busy, but it would be nice to have an actual conversation with you sometime as well.
That is a good plan to have
About a month ago, I opened a bug for displayio that has been added to 5.x.x-Bug Fixes. I presume that if I wanted to hack away at a fix for this, I would need to create an environment where I could do full build of CP, right? I'm not a C programmer, so this could be an interesting exercise.
@old smelt Yeah that would be a first step. What environment are you usually in -- mac, linux, windows?
@onyx hinge yah repl redirection is cool - i think...poke at it for a bit. but if it looks like more than a day's effort lets keep cuttin' out those audio bugs so we have super awesome audio. another thing to check btw is that you can do displayio without audio cutting out (display will be slower of course). as is, audio irq starves
Mac
...generally, though I flexed some old Linux muscles last weekend and put Ubuntu on an old Windows laptop
@old smelt you can totally do it on mac
im on win10 but most others are on macos
A-ha! Thanks for the link.
@meager fog yeah I will check out what I can see on my pyportal with display.
I recall seeing that before, but I couldn't recall where I had seen it.
jep, i am psyched about all the bugs you're finding & closing - epic work there!
@meager fog so far on nRF I approached it by putting in more BACKGROUND calls, which is .. not ideal. Do you see a different route? (and yeah ful repl redirection/duplication looks like much more than one night of a half-handful of hours)
i dont know - it may not be totally solvable without preemptive handling
I will also try to ask scott what he says and check back over what he has written on previous issues I can find.
which is like "man why did i build an rtos in python"
like right now 3 things happen in the bg
usb, audio and display
yeah, only "audio" might now be 3 or 4 different kinds of audio, etc.
I sure have imagined setting up some kind of deadline system
on nRF, unfortunately not. Their "easydma" means that each individual peripheral manages its DMA through unique registers within the periph
they even do double buffering at least two different ways
(PWM is one way, PDM and I2S are similar)
there are interrupts that could be enabled of course, and the EVENT registers are quick to check
also with audio you don't really know how many ms of audio one "chunk" is, it depends on lots of details. I think WaveFile is tuned to try to read about 1 block from flash per call but I'm not 100% sure of that assessment. But 512 bytes can be anywhere from 64ms (8kHz, 8bit mono) to 3ms (44.1kHz, 16bit, stereo)
right
so .. interrupts to set flags, quick checking of event-done registers, having some kind of deadline scheduler in the background stuff, ... I dunno what all to do. but it still all depends on anything long-running cooperating, too
ok well, dont need to do it - just think on it as you do other stuff
if it comes to you in a flash, gr8
if not, it works as is
haha okay
I will also be thinking awful hard while I'm on vacation. Anything I should pick up for my work while I'm in japan for 3 weeks? ๐
enjoy your break!
I am sure I will. It's a new destination for me.
if you have a hankerin' you can always take a pygamer/pybadge or circuit playground bluefruit with ya
they're small
haha haven't been able to find them in stock yet
well I have a cpb
I should take that, and finally learn anything about bluetooth
it's bedtime here! ttyl and thanks again
this is a blast
๐
Nicholas!
I'm trying to get a CP build going on my Mac, and I'm getting the following error out of Make:
GEN build-pyportal/genhdr/mpversion.h
python ../../py/makeversionhdr.py build-pyportal/genhdr/mpversion.h
make: *** No rule to make target `freetouch/adafruit_ptc.c', needed by `build-pyportal/genhdr/qstr.i.last'. Stop.```
?
@old smelt looks like you did not get the "submodules".
checking for a doc link for you...
git submodule update --init --recursive
``` these steps should have done it, but maybe they encountered errors -- documented near the top of https://learn.adafruit.com/building-circuitpython/build-circuitpython under "Fetch the code"
.. run those submodule commands from the top directory of circuitpython, which is different than what that gif included above shows
Darn... I did forget to do that.
Thanks!@
BTW - the guide suggests creating a case-sensitive image for the builds. Any recommendations for size? How big will this thing grow when doing the builds?
It's not huge. I set up a 10GB disk image for building CP, and only 1.2GB are used.
Thanks @main meteor. Still bigger than I was expecting, but gives me some guidance.
IIRC the only reason for the case-sensitive FS was for ESP8266 which is no longer needed. I don't think it is necessary.
oh really?
Ok - that's good news. I'll try without the separate image.
I just didn't want to chase unnecessary issues.
There's some other stuff in there, principally the library bundle, and some bitmap and display code I'm working on. OTOH, it's not up to date, so if CP 5 is larger, it might take up more room.
I just built the curremt master on my Mac in a standard FS
Speaking of CP5... How do I know what I am building, anyway?
the master branch is latest code -- bleeding edge -- you have to select a branch or tag for something else -- then make sure you reload the appropriate submodules!
Success! Thanks @solar whale, @main meteor, and @onyx hinge .
I recommned checking with @tulip sleet regarding the need for the case-sensitive FS in case something has changed.
I don't use my Mac much for building CP -- normally on a Linux box, but I like to keep my options open!
It certainly seems to build OK with out it.
Will do.
Directory grew to ~820MB with this initial build.
Iโm having similar issues with the PCA10059 connected to a Raspberry Pi 3. I copied adafruit_ble and adafruit_bluefruit_connect libs to the PCA10059. They use 75.1K of storage. I then loaded a simple BlueTooth test:
from adafruit_ble.uart_server import UARTServer
from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect.button_packet import ButtonPacket
uart_server = UARTServer()
while True:
# Advertise when not connected.
uart_server.st...
Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907
The code below attempts to implement the Sprite Sheet example from:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/sprite-sheet
...by adapting it to the timing requirements of EPD displays (e.g., time.sleep(display.time_to_refresh))
This code works on the 2-color EPD FeatherWing (switch the True/False on the board flags below).
Can't completely cha...
@tulip sleet is there a reason why the microcontroller pin interface is inconsistent about whether it takes pin information directly, or a pin object? For instance, the claim_pin function takes a pin object, but most others take a packed pin number. Is there a good reason against making them consistent one way or the other? Just kind of a stylistic choice.
I guess I just don't understand why "claim pin" should use an object, but "reset pin" should not.
@ionic elk this impression is halfway baked, so take it with a grain of salt. Some of these I/O objects (like I2C and SPI right now) need to be able to survive reboots of the Python interpreter. That means that their members shouldn't be Python objects, and leads to storing the integer pin identifiers instead. I became aware of this only last night while working on UART console but even if this is not the REASON it sure is important for facilitating this.
If it is, I think there should be a note of that in the file itself.
sure, I can agree with that statement
and I may be way off base with my assessment too
What uses the I2C and SPI raw right after a reset like that?
displayio
it maintains the connection to the display over python reloads
I think this may all stem from scott's displayio work in 5.0
does it also go in and claim those pins pre-emptively?
yeah there is a function called something like never_reset_pin which it passes those pin numbers to
@slender iron can you weigh in on any of this? I'm going 80% on guesses here
That makes sense, generally. I guess my issue is that since this is a port-level interface, not a common_hal one, the interfaces between ports are starting to get very inconsistent.
Scott's currently recommending that we use bitpacked fields, which means all my functions are going to have two parameters, specific to stm32, instead of a single packed int.
claim_pin won't have that problem
I don't know if any of this matters really though.
I did see some of this discussion go by, but I can't say I followed it all. It's entirely possible that scott is wrong (for instance, if his design means you can't really implement reset_pin, it is probably not a design to continue with!) and until you are confident he understands your concern, you should continue to work to help him understand.
(but at the same time, if it becomes clear to you that either choice is going to work out technically, then I would personally accept his preference after making my best case about whatever the topic is..)
afk for some lunch!
Yes either will easily work technically, this is really just a style choice. Thanks for the power cycle info, @onyx hinge
claim pin could take the number as well. reset takes it already so that python objects only need to store the number (1 byte) instead of the pin object pointer (4 bytes). It has nothing to do with the displayio lifetime stuff. pin objects are static and live forever too
@onyx hinge I think the audio playback smoothness might just be a matter of having larger buffers to allow for larger gaps between background calls
The frame rates are currently off already so I wouldn't worry about it. I was getting ahead of myself when I pointed that out.
Yup, referring to the bitpacking. I wouldn't port back changes to nrf now because we may evolve more here.
You are right about pin_port and pin_mask. It's preferable to still have them.
Ah ok! Please add a comment stating that reasoning next to the macros. Makes total sense.
Isn't pin_port = 0 valid? Typically I use a high value to indicate it is invalid.
No need. The compiler can inline it if it wants to.
Is it only 16 pins per port? Seems like returning uint32_t or size_t is a safer bet here.
A power cycle + a with open... OnDiskBitmap construct also seems to kick refresh back on after it's frozen:
with open("/display-ruler.bmp", "rb") as bitmap_file:
g = displayio.Group(max_size=1)
odb = displayio.OnDiskBitmap(bitmap_file)
tg = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter())
g.append(tg)
try:
time.sleep(display.time_to_refresh + 1)
display.show(g)
display.refresh()
print("Ruler ", display.ti...
Whoops I got that mixed up with the ADC. It'd be 0x0F with the bit packing, right?
it's strictly 16 pins per port across all STM32 boards, and it can't go above that anyway with the bit packing.
Please swap the shifts back to pin_mask. Sorry I was confusing about the bitpacking stuff.
Ok, will revert and fix
Does -0g do the same thing as no-inline and no-ipa-sra?
How many ports can an STM have? If it's 16 we'll need a separate bit for validity.
Ok, I hit the audioio/audiocore issue.
@onyx hinge Are you around? I'm guessing not.
@slender iron Is there no audioio in CircuitPython 5.x for CPB?
correct
Related: is there a way from the REPL to list all the available CP modules?
help("modules") iirc
Ok. How do you do AudioOut then?
Ok
Found it. Thanks.
@slender iron Is the audiopwmio specific to the CPB or is it a 5.x change? As in, are all boards switching to that or is it an nRF situation?
np
@idle owl did Scott get you the info you needed?
@onyx hinge Yeah, but I'll want to discuss some more details with you later if you're around.
@idle owl how's 7 or 730 us Central work for you?
In general, I dislike the "fill out a large struct and pass it in style" that HALs typically have because a lot of code is unneeded. However, if the HAL will make it easier to use code across stm families then it might be worth it.
I'm not sure if the low level code is best because it can cause consecutive writes to the same register rather than setting things all at once. Is it possible to write to a register directly via a struct? Does the LL API abstract us across families still?
@onyx hinge 7CT should work.
Feel free to ping me but I think I'll be home
Right on, will do.
@onyx hinge 7:30CT might work better or possibly 7:45. I'll ping you later to confirm.
Okay
@tidal kiln p0ng
p1ng
@tidal kiln whatcha hackin on
misc. doing a general house cleaning sweep.
basecamp / gh / forums / etc.
got something specific?
@tannewt The LL libraries do abstract us completely across families, as does the HAL. I'd personally recommend we use one or the other, since writing to the registers directly will almost certainly cost portability, some of which could be pretty deep magic.
In terms of comparison, if you don't like the extra "chaffe" of the HAL I'd say the LLs are about as efficient as we're going to get - I don't think I've even reduced that section down as much as I can yet, I'm still reading through th...
@tidal kiln lemme think - well, dya wanna try that recorder project with the cplay ble?
its faster, maybe works now?
sure. can at least try it and see what happens.
HAL is tine with me for now if you think it's best. We can always optimize later.
Can the Meowbit be added to have CircuitPython support?
https://www.kittenbot.cc/collections/frontpage/products/meowbit-codable-console-for-microsoft-makecode-arcade
Looks like it is an STM32F401. We're currently targeting the F411, F412 and F405 but may be able to support the F401 in the longer term.
Are there any actual differences between the 4.x and 5.x bundles at this time?
The F401 is very similar to the F411. It may be trivially simple to add. However, since I don't have a viable dev board for it on hand, I think this is probably best scheduled after we have modules like displayio up and running.
there is no difference between the VERSIONS.TXT files so I guess not.
@solar whale No, it's to continue the way we have been to alleviate confusion as to which bundle to use.
@idle owl OK -- thanks -- I get confused easily ๐
diff reported that the .mpy files may differ, but I assume that's just build differences?
I saw that too, I suspect is is just some stuff in the binary that contains build details.
I tried doing some binary compares of .mpy files and just get more confused ....
I'll look into it more another time -- I'd like understand the differences, but it's not critical now .
@ladyada this should now be ready to test on a F412, had some usb issues.
Getting a lot of Failed to download action 'https://api.github.com/repos/actions/setup-python/tarball/v1'. Error Response status code does not indicate success: 401 (Unauthorized). on the checks, any ideas?
hm looks like I'll need to read that guide about running the linter locally ๐
yay local pylint
yeah. as long as you remember before giving travis a workout ๐
@onyx hinge In a meeting, so I can't test sound until we're done. I'll take a look at your PR in a bit here.
Hi All - I did a local build of CP this morning, and I got a successful working UF2 which was pretty encouraging. It looks like it's CP 4, though:
Adafruit CircuitPython 4.0.1-5-g63b253c33 on 2019-09-11; Adafruit PyPortal with samd51j20
What do I need to do to build CP5?
Was I missing a switch?
@old smelt any chance you simply transferred the wrong .uf2 file?
Donโt think so. Iโll double check though.
what does git describe --tags from anywhere inside your circuitpython source say?
okay, well, that at least makes sense then!
are you at all experienced with git at this point?
Some yes.
@old smelt what does your git log show?
It seems like you have run a command to switch to the "4.x branch". This is the "git checkout" command, for example. Perhaps the guide suggested to do it without explaining what the purpose was.
since getting the source, did make any changes? If not, you can easily move to the branch for 5.x, which is called "master": git checkout master
git log kicks a bunch of output. Anything specific you want to see?
But a lot of commit dates in May
@onyx hinge , no changes yet. Just running a pipe cleaner right now.
Mac terminal does mysterious things with command history, so I can't reconstruct my build commands very easily. Kind of annoying...
OK, well, recommend doing git checkout master and then git describe --tags. Then, it should say something more like 5.0.0-alpha.2-55-g89fed709a
git remote -v | grep origin says ?
Ah -ha! I think I may have figured it out. I orginally fetched my fork on GitHub which would have been CP4
@old smelt okay, that could def. explain it
Ugh... Sigh.
it might be easiest to start with a fresh clone from https://github.com/adafruit/circuitpython if that is not a problem
(though eventually, to create a pull request, you do need git to know about both adafruit's circuitpython and yours as different "remotes")
Sounds good. I'll start with cloning the adafruit repo. Learning...
@old smelt You can add a remote that is the adafruit repo, and then fetch/merge that, and then push it to your repo to update.
yes, git gives you a lot of choices of how to manage things. you could sure git remote add adafruit https://github.com/adafruit/circuitpython, git fetch adafruit, git checkout -b my-new-branch adafruit/master^{} for instance
@old smelt Let me know if it doesn't work for some reason and I can try to walk you through it in more detail. Or Jeff can beat me to it! ๐
which would let you start on a branch called my-new-branch, beginning where adafruit's master branch is
(please please please don't ask what ^{} means, just roll with it ๐ฌ )
Ha! Okay...
Thanks for all the help.
Gotta go drive some cameras for a while. I'll try this out later tonight.
see you later!
since you're interested in contributing a bug fix we are interested in helping you with the boring steps of getting git to work for you
@onyx hinge What did you test the simpleio update with?
With the simple demo code I'm getting ValueError: A2 in use
Resetting the board didn't fix it.
@idle owl I tested on Metro M4 and CPB. I used board.SPEAKER on CPB and board.A0 on M4
Hmm.
give me two minutes and I'll be back at my desk to check again. Are you on 4.1? I was on 5/master.
I'm on a CPB running 5.x
Tried it with board.SPEAKER and it says AUDIO in use.
Was attempting to use a piezo on A2 first
code.py output:
Traceback (most recent call last):
File "code.py", line 8, in <module>
File "/lib/simpleio.py", line 97, in tone
File "/lib/simpleio.py", line 49, in _AudioOut
ValueError: A2 in use```
No other code imported?
import time
import board
import simpleio
while True:
for f in (262, 294, 330, 349, 392, 440, 494, 523):
# For the M0 boards:
simpleio.tone(board.A2, f, 0.25) # on for 1/4 second
# For the M4 boards:
# simpleio.tone(board.A1, f, 0.25) # on for 1/4 second
time.sleep(0.05) # pause between notes
time.sleep(0.5)
PIezo worked on A2 using PWM only.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "kattni.py", line 8, in <module>
File "simpleio.py", line 96, in tone
File "simpleio.py", line 49, in _AudioOut
ValueError: A2 in use
``` OK me too
oh it plays one sound and then breaks. ๐ฆ ๐ฆ I am a bad programmer, it must be a problem in the core PWMAudioOut...?
You're hardly a bad programmer. I'm not sure. Limor requested changes anyway.
Yeah one sound, then fails.
so something isn't deiniting I assume.
yeah I bet I did not test that in core
I will file an issue in core for this. It would be useful if you verify it works on M0/M4 and 4.x right now, though
I will also look for Limor's requested fixes
I'll test it on CPX running 4.x
and yeah I shouldn't say things like "I am a bad programmer", it isn't helping anybody. It's just expressing how I feel in a moment, but it's a habit better off broken.
@onyx hinge Works on CPX running 4.x.
.. I'm going to evaluate a little more before declaring it a bug in core, I didn't reproduce it without using my modified simpleio yet.
but I'll follow up this evening after some more investigation
Ok
thanks for the quick testing! Please don't let me keep you from other stuff you need to do tonight.
@onyx hinge Ok, so Limor wants me to do this try/except thing with importing audiocore as audioio to make the code the same, but in a piece of code that uses AudioOut and WaveFile how do you do that? Because it's two different things, audiopwmio and audiocore.
quick and actually thorough
You're welcome. I'm dealing with similar code at the moment it turns out.
so you need to deal with the move of WaveFile to audiocore? Are you also trying to deal with AudioOut and PWMAudioOut at the same time?
Yes.
So I can't simply import audiocore as audioio and audiopwmio as audioio it doesn't work that way
first before I start giving a lot of advice, let me check on what the review notes on that simpleio PR say
Yeah, let me sketch that. I think it's a valid request/criticism.
this is nice, it gives me a break from locking up my whole computer trying to do clever things with UARTs
from audioio import AudioOut
except ImportError:
try:
from audiopwmio import PWMAudioOut as AudioOut
except ImportError:
pass # not always supported by every board!
try:
import audiocore
except ImportError:
import audioio as audiocore
``` is what I have now. Would that code potentially help with what you are doing?
it is probably better than what I had, I was trying to be too fancy
That was close enough to get me what I needed. Thank you!
oh hmmmm!
This look rightish? ```python
try:
from audioio import AudioOut
except ImportError:
try:
from audiopwmio import PWMAudioOut as AudioOut
except ImportError:
pass # not always supported by every board!
try:
from audiocore import WaveFile
except ImportError:
from audioio import WaveFile```
Yes I think that looks good
you want to just write WaveFile, not audiocore.WaveFile, when you use it
I'm finding all the bugs it seems. ๐
>>>
>>> import pulseio
>>> import board
>>> with pulseio.PWMOut(board.A0): pass
...
>>> with pulseio.PWMOut(board.A0): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: A0 in use
finding bugs is so valuable, thank you! I will file an issue on core
Why did you import audioio first on the first try/except and audiocore first on the second one?
that's a good question!
I wanted to put the "most 5.xish, most mainstream" choice first. So that means audiocore for where to find RawSample/WaveFile pretty clearly
for where to get AudioOut, I think that boards with real DACs (all the M0 and M4 pretty much, right?) are more prevalent, so that's audioio first
I think you could make different arguments, but that is my thought process as I can reconstruct it
Makes sense
With help from @kattni, I chased a simpleio problem to this reproducer:
>>>
>>> import pulseio
>>> import board
>>> with pulseio.PWMOut(board.A0): pass
...
>>> with pulseio.PWMOut(board.A0): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: A0 in use
now what is embarassing is that .. I am almost sure I ran into this and noted it as an issue to file the very first evening I set out to work on nrf52 "officially"
and did I file it? No. The dog ate my google doc
I've had that happen!
yay, fix in core is pretty simple. It's so easy to overlook things
[adafruit/circuitpython] Pull request opened: #2147 nRF: PWMOut: At deinit, make pin available again
Testing performed: Both my minimal reproducer and the simpleio reproducer from @kattni now work on my Particle Xenon. Besides not giving errors, the simpleio reproducer shows a succession of tones on my oscilloscope.
Closes: #2146
This may affect 4.x. If so it is likely to be trivial to make a new request to fix it there. Please let me know if this is desirable.
Progress:
Adafruit CircuitPython 5.0.0-alpha.2-55-g89fed709a on 2019-09-11; Adafruit PyPortal with samd51j20
This is certainly in a "hacky-hack" stage. It
- seems to work on nRF52840
- almost certainly fails to build on every other platform
- takes some liberties with existing HAL APIs and memory allocations
but it does achieve the goal of letting you write in boot.py
import busio, board
busio.UART.make_console(board.TX, board.RX)
to get the regular REPL and program output mirrored both on USB (if attached) and via UART.
The platform build problem is of course surmountable; b...
hum, I wonder if some of my problems with locking up are due to using the "-rt" kernel set. I booted into a "vanilla" debian kernel this last time, and haven't had a crash yet. ugh, I am used to the "-rt" kernel being pretty stable these days.
I think it's just a service error. I restarted it now to see if it'll work.
๐
@onyx hinge What are you using that needs a hard realtime kernel? Seems like a large pain point when -lowlatency / -preemptive should handle a lot of cases.
@cerulean sparrow I am a sometimes developer on LinuxCNC (http://linuxcnc.org) and expect to be doing more of that this fall/winter. It requires either the "-rt" kernel or even an RTAI-patched kernel, though the second option is becoming a more and more distant second choice. Usually being on debian's "-rt" kernel is just fine actually, but I'm hunting for any reason to explain how flaky my development experience has been lately.
Might be time to do some forensics on your lockups/crashes.
@tannewt weird failures with the next CI run ... more rate limits being hit?
##[warning]Failed to download action 'https://api.github.com/repos/actions/setup-python/tarball/v1'. Error Response status code does not indicate success: 401 (Unauthorized).
##[warning]Back off 28.517 seconds before retry.
##[error]Response status code does not indicate success: 401 (Unauthorized).
They're always preceded with kernel GPFs like this one ```Sep 8 12:40:58 soba kernel: [80072.030736] general protection fault: 0000 [#1] PREEMPT SMP NOPTI
Sep 8 12:40:58 soba kernel: [80072.030745] CPU: 1 PID: 16427 Comm: kworker/1:3 Not tainted 4.19.0-5-rt-amd64 #1 Debian 4.19.37-5
Sep 8 12:40:58 soba kernel: [80072.030748] Hardware name: BIOSTAR Group TA970XE/TA970XE, BIOS 4.6.4 02/02/2012
Sep 8 12:40:58 soba kernel: [80072.030762] Workqueue: events acm_softint [cdc_acm]
Sep 8 12:40:58 soba kernel: [80072.030802] RIP: 0010:usb_clear_halt+0x16/0xc0 [usbcore]
Is there a CircuitPython install guide for the Feather M0 Bluefruit? From everything I've read, it should install, but I don't want to brick my Feather.
I wonder if the kernel doesn't like the board re-enumerating its USB port.
The M0s are pleasantly resistant to bricking. This UF2 guide covers (re)installing CircuitPython along with a lot of possibly useful related information https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/uf2-bootloader-details
Thanks.. I got my Feather M0 Bluefruit a while ago when BT wasn't supported in Circuit Python yet. Now that it is, I really want to try it out. The Express doesn't seem to have any real differences from the Bluefruit, aside from some pin assignments and, of course, the BTLE module. Still a little scary. If anyone else has tried this, I'd really like to hear how it went.
One thing does stand out.. The Express is described as having a ATSAMD21G18 ARM Cortex M0+, where the Bluefruit just says "M0", no plus.
But I can't find any info that says what differences there are, or aren't.
I think the main other difference is the Express has an additional flash memory chip (that additional storage is quite useful when running CircuitPython).
Wondering if I should just bite the bullet and upgrade to the Huzzah32 (ESP32 Feather)
Depends on what you want to do with it. The Huzzah offers WiFi but I don't think it supports Bluetooth. I think the M0 offers more in the way of I/O.
The Huzzah32 might not, the Huzzah32 Feather does. Didn't know they were different until I just looked. But it still doesn't have official CircuitPython support.
@topaz schooner Circuitpython will not support the BLE on the Feather M0 Bluefruit -- It is essentailly a Feather M0 Basic.
CP BLE support is only for the nrf52840 chipset at this time
as to express -- as noted, that implies there an external flash for the CP filesystem. The Feather M0 Bluefruit does not have one. It has a very small File system. on the internal Flash.
That clears it up.. Thanks. Guess I'm sticking with C
Sorry to bear bad news -- the feather nfrf2840 express is a nice way to go!
I'm having a lot of trouble getting the CI to work on my PRs - it's encountering mostly git issues with tarballs and authentication. I see one of @onyx hinge's builds has failed for the same reasons. Is this just a Github thing we can wait out?
@ladyada this should now be ready to test on a F412, had some usb issues.
Does the Monster M4sk run circuit python? Is there any documentation on how to edit the eyes?
Ok, it doesn't, but I found this: https://learn.adafruit.com/adafruit-monster-m4sk-eyes/customization-basics
@tulip sleet how did you protect the USB pins, and other vital stuff, from the chipwide reset_all_pins() function? I don't see anything that adds them to the never reset array.
When I searched for never_reset_pin_number, all that comes up is some busio and PWM dynamic additions. I was expecting some table in peripherals or port init to protect critical system pins, but I don't see anything. Are there just no GPIO pins shared with oscillator or system purposes in nrf?
@cerulean sparrow Yes it does: https://circuitpython.org/board/monster_m4sk/
Peep dis! Have you always wanted to have another pair of eyes on the back of yourhead? Or outfit your costume with big beautiful orbs? The MONSTER M4SK is li...
note that only one eye is supported from circuitpython
I haven't spent time to verify multiple displays work together ok
@slender iron is there a way for a user to check what pins certain functionality is on? Say if they want I2C, they ask what pins have it, or something like that?
@ionic elk I wrote scripts that attempt to create the object on each pin or pin combination and returns the valid options.
Like this one for I2C which is easily adapted to any other protocol or functionality: https://learn.adafruit.com/circuitpython-essentials/circuitpython-i2c#wheres-my-i2c-15-17
If that's what you're asking.
@idle owl interesting. On the STM32, we won't have peripheral information per pin, since STM32 peripherals are extremely specific. But I wonder if I could tie into this somehow
That way folks who install it have a file to edit. Bonus points if there is a very small bit of useful code. (Maybe just print("Hello world!")? It could be the translation too.)
Also interesting. Did not know that about the STM, though I know nothing about them, so it's all new info for me.
sure it's good to know how it's done now
Ideally I'd like to have some option available to the user to either declare where every peripheral is mapped, or search for the pins of a specific one
Right on, so sort of the opposite of the script.
Yes, and it'll have to be built that way all the way down to the port level
This is stretching beyond my knowledge, but something like dir() for peripheral pins from the REPL?
I'll check that out, the python stuff is kind of out of my depth
so I'm not sure how this is exposed higher up
That's what makes having a team so great ๐ Someone else can know the things you don't.
Right
I'm definitely referring to higher up.
dir() gives you everything something can do.... so it works on modules to show what you can call, but also works on, for example, board to tell you all available pins. Which is what made me think about the potential to have dir(i2c) or something and have it show you the available options... not exactly what it's meant to do, but something like it might be what you're getting at.
Hi folks! I was working my way through the Welcome to CircuitPython tutorial and was told to go to GitHub and look for an issue with the "good first issue" tag. I saw this one, and as it happens I'd added a couple of mcp23s08s to a parts order a while back as a "might be useful some day, since I'm paying for shipping anyway" thing.
So it's working now, blinkies blinking even as I type. I need to work through another tutorial to learn how to post/submit/request/etc my contribution and I sti...
Yeah kinda. So, for instance, on the stm32 F411, I2C3 has exactly 2 pins: SDA on PC9, and SCL on PC8. So I'd like the user to either be able to punch in some "Peripherals" command and see a list that includes "I2C3: SCL-PC8, SDA-PC9" as a row, or punch in "I2C3" and see "Pins: SCL-PC8, SDA-PC9"
would that fit with the dir() command or would it be better suited elsewhere?
That one I'm not sure on. I feel like you could create a peripherals thing and call dir() on it, but I'm not sure that's what it's really meant to do. Scott would know better.
@ionic elk the goal is for user's not to know anything about I2C3 and just know i2c can be done on PC9 and PC8
which is what @idle owl 's scripts can tell you
The I2C3 label can certainly be left out, but the issue is that if they try to use I2C1's SDA and I2C3's SCL, it will fail
how would they try to use it?
I'm not sure I understand
want to voice or video chat?
๐
I'm not convinced this is a good idea. I assume you are not intending for it to have a "while True" loop in it. That would be even worse. But my concern is that now it gets executed everything the board reboots unless it is deleted. Just bothered me ;-) I guess I think the users should have some understanding of what is going on. this seems like a bit too much handholding to me. Just my opinion.
What do you mean by "But my concern is that now it gets executed everything the board reboots unless it is deleted." ?
The reason to do it is that we teach people to "plug it in and edit code.py" which works for boards that ship with CircuitPython and a demo but doesn't when they install CircuitPython themselves.
I guess I have never been a big fan of using code.py in general. I only use it for finished projects. I much prefer to edit my files off line and copy them to the file system then execute from the REPL. I realize that is not the "official" workflow.
Would you mind merging in master and pushing the merge commit here? The re-run is hitting this error: https://github.com/actions/checkout/issues/23
Merging in everything and pushing should trigger a new run. Thanks!
The max voltage returned on any of the pins on the Circuit Playground Bluefruit is 3.01 when connected to the 3.3V and ground pads using a potentiometer. It should be returning 3.29 when maxed out as the 3.3V pin does.
Apparently there is an analog reference that must be set, that is currently hitting a max of 3.0V vs the 3.6V it should be.
I'll investigate this. Thanks for the suggestion @jepler
@slender iron is there a way to receive notifications on github whenever an issue has a certain tag? It'd be convenient for tracking stm32 issues
not sure, I get emails for all of them and filter them into a folder
No, idea. I filed an issue about it: https://github.com/actions/setup-python/issues/21 Ping there if you see it again.
I tried to re-run the checks but it might need a newer merge to test due to https://github.com/actions/checkout/issues/23
An empty code.py seems like a good idea, but example code is going to take extra flash space, can we afford that?
I wonder if it would be possible to extend the uf2 bootloader to support SPI flash, then we could have the initial filesystem contents in the uf2 file without taking extra flash space.
BTW @meager fog, on this week ask and eng somebody asked about RISCV boards on adafruit. This chip has the requirements you mentioned. We mentioned it breifly in #risc-v.
Same ram an an M0, and has USB full speed which @slender iron wants.
http://dl.sipeed.com/LONGAN/Nano/DOC/GD32VF103_Datasheet_Rev1.0.pdf
Sipeed is actually making STM32 compatible board with this chip on the cheap.
https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF103CBT6-Development-Board-p-4205.html
This PR introduces a structure for handling stm32 peripherals, which are more inflexible than the other ports. Peripherals are created as separate objects based on chip family in the peripherals directory. Common-hal modules then check to see if pins match any of the existing peripherals.
Looking for feedback on structure. Current model uses direct pin references as a double-checking measure when implementing peripherals, but an alternative numerical storage system is commented.
@timvgso Awesome! Thanks for your help! please let us know if you have any questions about the PR process.
@slender iron - have a minute to talk about the make_opaque()/make_transparent() issue?
@old smelt may have some time tonight
Ok. Just a quick question...
Your comment in the issue thread said that make_transparent()/opaque() needs to include a self-refresh.
Is that as simple as adding self->needs_refresh = true;
ya, I believe so
Ok. Tried that, and I'm seeing the same results
That answers my question. Thanks. I'll poke around a bit. Trying to understand how all of this stitches together.
k, thanks!
๐
sorry if this is not the right place to ask this but how can i get into using circuitpython on the game boy ?
@timber mango you would need a special cartridge that @slender iron has developed
is it possible to purchase these preassembled ? i do not have much hardware or electronics experience
I don't know, you might need to wait for him to wake up
this is very much work in progress still
by the way, I'm on a quantum computing sprint now, and now we are using CricuitPython to write a quantum game
there is a quantum computing library for it: https://github.com/quantumjim/aether
thats amazing !
Got hands on a uBlox NINA B3 evalkit, and tried to install CircuitPython on it. So I followed the tutorial on how to install it on the nRF devboard. Worked like a charm to get the UF bootloader up and running. (nrfjprog link is dead BTW).
Only thing, I just had only a 128MB quad SPI flash at hand. Is this a problem? Since I only once for a short time a REPL, and it never showed up as a CircuitPython USB drive.
@meager fog sorry I missed your question yesterday.
Let me know if you still need anything answered
let me get you a new binary too.
New binary with reset fix
firmware.bin.zip
My SD Card had the same error from issue #245 so I downloaded the fixed version that was made, that they said was merged in but it looks like it wasn't because downloading the script from that thread fixed the problem.
@timber mango The SAMD51 only supports 16MB QSPI. the nina is an nRF52840 right?
@timber mango The GameBoy cart isn't currently available. I'm not sure when it will be. I've been tweaking the software still because it has some major bugs still (like hangs and improper writes)
Would you mind making it against 4.1.x first and then we'll merge everything from there?
@slender iron jep it is... Note to self, next time order a bunch of different parts ๐
I tested it again, and now i got a stable REPL. Just no flash drive, seems i need to get me less flash.
@AdinAck please post a picture of your SD card. Many of them are just a little different and need to be fixed separately.
Actually, I'm going to merge now because I'm going to release Alpha.3
d9c8460 py/obj.c: This can be long-running, run backgro... - jepler
676f7aa os_listdir: This can be long-running, run backg... - jepler
932ac09 stream_readall: This can be long-running, run b... - jepler
70daf00 In py/, must guard uses of RUN_BACKGROUND_TASKS - jepler
523025c Merge remote-tracking branch 'origin/master' in... - jepler
Itโs exactly the same as the ones in the fix (Samsung EVO 32Gb). I solved
the error by downloading the โadafruit_sdcard.pyโ from
https://github.com/adafruit/Adafruit_CircuitPython_SD
and placing adafruit_sdcard.py next to code.py and importing it, instead of
adafruit_sdcard.mpy from the lib folder. Wouldnโt this mean the fixed code
is not in the latest library release? If that doesnโt make sense let me
know and Iโll send you a picture of the sd card.
Thanks!
On Fri, Sep 13, 2019 at 9:29 AM ...
I'm having an issue with mu where if I write a second time after a program has finished executing, it freezes, and the disk image for circuitpython stops being available until the board is reset.
Is this more likely to be an issue with my code, or with mu?
I'd prefer it if there were two additional functions on supervisor .add_serial_in() and .add_serial_out() that way we can separate the two things. A keyboard for example would only be serial_in. We probably also want a forever kwarg that keeps the object alive past the vm. Folks may want to redirect temporarily too.
Instead of needing a separate hook, you can probably reuse the stream api stuff.
Also, we may want to formalize a way to "save" certain heap state at the end of a vm t...
[adafruit/circuitpython] Pull request opened: #2153 nRF: PWMOut: At deinit, make pin available again
Re-roll the fix for #2146 so that it can be merged into 4.1.x.
Do you have to connect the pins to the peripheral using an internal mux? You'll probably need to track which alternate function each pin is on.
If it's arbitrary then why add it?
Wait to map the i2c index to a pointer until after you know they match. That way you only need to do it once. Furthermore, use a table to do the mapping instead of a switch. If you need to validate the index, then do it before the pointer mapping.
Ah, ok. Yup, that may mean we've not released it. I'll do that now. Thanks!
Ok, released as 3.2.4. Will be in tomorrow's bundle. Thanks!
[adafruit/circuitpython] New tag created: 5\.0\.0\-alpha\.3
Automated website update for release 5.0.0-alpha.3 by Blinka.
New boards:
- pewpew_m4
- stm32f411ve_discovery
- stm32f412zg_discovery
@ionic elk is that with an stm board? try with a known good build of circuitpython to verify mu is working. that sounds like what happens when the board crashes
I think it's a write crash, yeah
It's more destructive with Mu than other editors, so I've switched over to sublime
hmmmmmmmm actually what appears to be the case is the board soft reboots after 30 seconds of runtime, and then can't be written to again without crashing...
It's arbitrary from an ST Datasheet perspective. Each alt index is simply additional pairs of pins that can be activated for the same peripheral. There tend to be 0-2 extra pin sets like this.
That's a good point. I'll add it.
Currently experiencing a sort of timed soft-reboot after 30 seconds on the first save to the F412. Also occurs on the peripherals branch and possibly on earlier branches. Only happens once.
@ionic elk sounds like it's time for a debugger
I've been in there but I can't get a trace on what's causing the reset
is it a full reset or just a reload?
what is the backtrace once it's broken?
good places to break are reset_into_safe_mode and HardFault_Handler
A set of two simple boards with SAMD21E18 and 4MB of flash. They have the same HW and only differ in USB connector.
@slender iron "soft reboot". Might be host computer related, though. I'm having some trouble replicating it consistently.
Analogio adds USB pin protection
But I should look into whether it might be messing up some other system essential feature through a pin.
I remembered an important reason to stick to all LL, by the way. The HAL relies on a file called hal_msp which contains a bunch of pin definitions which we'd much rather have flexible control over. LL avoids it completely.
I'm looking into how micropython handles it at the moment.
๐
@slender iron bringing up this "samd51 thing plus", what do I do about usb pid/vid ?
use the same as arduino or uf2 and we can bug sparkfun about it
okay, will do that for now.
I want to talk about the UART console stuff but that's a longer conversation than I want to get into now.
but that's "long term if ever stuff" to me, I'm not worried
@jepler @ladyada I'll try to get to this on Monday/Tuesday. If not, I'll be on vacation for the next few weeks and will start on it when I get back. I have added this to my "to do" list (*just an FYI so it doesn't seem like I am neglecting this). Thanks!
suddenly everyone is interested in this board I guess
I'm not sure which part limor is suggesting santaimpersonator work on -- and whether they are on discord? -- but I think I have a good start locally, but not tested/built yet. I started on the pin definitions last night but didn't get through before it was time to hit the sack.
@onyx hinge - out of curiosity, does it require a J-Link to port to a new board initially? I have this vague memory of something like that from when I was looking at putting CP on a Particle Argon.
@slender iron @ionic elk QUESTION!
@onyx hinge id like to prod sparkfun into submitting PRs for their boards
its going to be hard for us to test/verify their BSP's without said hardware - and they're shipping with circuitpython so they def made the BSP at some point ๐
@old smelt if it doesn't ship with UF2 bootloader then yes it seems so
@meager fog OK, better if I deassign that issue from myself then and let santaimpersonator take the lead?
@onyx hinge yah sure, i dont think we can assign them cause they're not in the libraries group but thats ok
๐ I'll go do that
@santaimpersonator I will let you take the lead on this, thank you!
ooh looks like I can assign it
@onyx hinge - got it. Thanks.
I took a crack at adding "self->needs_refresh = true;" to both common_hal_displayio_palette_make_opaque() and common_hal_displayio_palette_make_transparent() in Palette.c. Did not change the behavior I am seeing.
Any suggestions? Interested in continuing to chase this, but open to some guidance.
@slender iron okay thanks for the update ! keep up the great work ๐
cant wait to get my hands on one, i have so many cool ideas that weren't possible with assembly
Again the build issue :/
##[error]fatal: reference is not a tree: 454e971a4d6fda69fc0045d8deb7dc9cae08a960
Well, it's Beer:30 here in WI, and I have a bit before Friday Football. Anyone around who has some deep displayio core knowledge that could help me out?
i know a little
Cool!
I'm trying to chase down this make_transparent/opaque issue, but I don't really understand when/where a display refresh is executed.
I've tried adding the code that I thought would trigger a refresh for the display, but it doesn't seem to do it.
It's this issue: https://github.com/adafruit/circuitpython/issues/2076
So, essentially, the calls to _pallet.make_transparent() in roundrect.py aren't really doing anything.
The original configuration of a shape (transparent/opaque) seems to be "sticky". And can't be changed after initialization.
i dont know that kind of detail
if you have an issue, please hold until someone can answer it
i dont know the core displayio stuff ๐
@slender iron I see how to use version checks for audioio vs audiocore. Do you have a preference as to how audioio vs audiopwmio is handled? Doing it by os.uname().sysname == 'nrf52' doesn't really appeal to me. What would you like me to do?
board.AudioOut did occur to me...
but that's a bigger change and would require touching all boards
@onyx hinge maybe try/except is ok for audio vs audiopwmio
it'll be cleaner with the version check for core/audioio
OK, I tried to do that in my latest update on that PR.
@arturo182 This is a bug that will hopefully be fixed in the near future. Until then, a workaround is to merge in master and push the merge commit to the PR. That will trigger a new build
@onyx hinge k, great!
I also realized, I don't know any case where nRF would go through the audiopwmio path successfully
@jpecor thanks for taking a crack at it! Is the edited version available in a branch somewhere? I'd be curious to see what you did. The next place to look is here: https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/TileGrid.c#L550 That is how palette state gets propagated up into TileGrid and then Group.
OH I see how they fit the qwik connector on the thing plus -- it's actually bigger than the standard feather form factor
๐ถ standards are great ๐ต
@tannewt - I don't have it committed anywhere yet. I confess that I'm in a bit over my head with remote repos and how to create a branch remotely. So, I'm a bit hesitant there.
I just set needs_refresh = true in both make_opaque() and make_transparent():
void common_hal_displayio_palette_make_opaque(displayio_palette_t* self, uint32_t palette_index) {
self->colors[palette_index].transparent = false;
self->needs_refresh = true;
}
void common_hal_displayio_palet...
Seems that worked, checked out and building now.
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
-236 bytes free in flash out of 253440 bytes ( 247.5 kb ).
24916 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
Too little flash!!!```
I don't get it, I use the same `SAMD21E18A` like gemma_m0, trinket_m0 and many other, why is ...
returns to the living. the flu sucks...especially when you have to keep adulting... ๐
argh I thought I was going to debug some stuff on pyportal this weekend, but to my horror the swd header is not fitted
do I need to connect 3.3v to the j-link for it to function?
yes -- at least in my experience...
I connect SWDIO, SWDCLK, GND, 3.3V and RST
3.3V goes to Vref on the JLink
right
that confirms what I thought/read, thanks
too bad there aren't labeled test points for 3.3v and gnd
on which board?
Ah --- I see -- on pyportal -- they are on the pads for the SWD connector -- you could access them there
Connecting to target...Connected to target
Waiting for GDB connection...
``` looks like we may be on the road
huh not the problem I expected to start out debugging -- with my master-ish-branch firmware loaded, pyportal hardfaults at startup in common_hal_pulseio_pwmout_construct setting up the display early early on
I just put alpha-3 on a Pyportal -- so far its OK
hmm that's exactly where I am as well ```jepler@soba:~/src/circuitpython$ git describe --tags
5.0.0-alpha.3
hm, when I load the firmware from inside gdb with danh's jload it messes up. when I do it via PORTALBOOT, the same binary is fine
smh
fine in that it gets started to circuitpython; I have an incompatibility in my python files or something, ``` File "adafruit_pyportal.py", line 438, in set_background
AttributeError: 'Display' object has no attribute 'refresh_soon'
do you have latest adafruit_pyportal.py -- I am not seeing that
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.3 on 2019-09-14; Adafruit PyPortal with samd51j20
>>>
origin https://github.com/adafruit/Adafruit_CircuitPython_PyPortal (fetch)
origin https://github.com/adafruit/Adafruit_CircuitPython_PyPortal (push)
origin/master:adafruit_pyportal.py: board.DISPLAY.refresh_soon()
origin/master:adafruit_pyportal.py: board.DISPLAY.refresh_soon()
``` huh despite pulling I still see the use of those functions in adafruit_pyportal.py
refresh_soon and wait_for_frame
I think there are may places that need update -- I fixed Slideshow a few weeks ago, but more to be done
what a surprise, I think this todo is why audio stutters while updating the display on pyportal ... ``` // TODO(tannewt): Make refresh displays faster so we don't starve other
// background tasks.
usb_background();
pyportal_simpletest.py fails due to wait_for_frame as well....
this does fix the audio stuttering right up in my reproducer, but clearly it'll never fly: ``` // TODO(tannewt): Make refresh displays faster so we don't starve other
// background tasks.
+
- #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO
- audio_dma_background();
- #endif
usb_background();
(reproducer loops a wave file while continuously printing to the console)
Hi all, the weekly community meeting is Monday at 11am Pacific / 2pm Eastern here on Discord in the CircuitPython voice channel. All are encouraged to attend. The notes doc for the meeting is here: https://docs.google.com/document/d/1rWT7iyx39KK_qpDKbT_SnyGplmTR-gaNi_zGQCvT43E/edit?usp=sharing <@&356864093652516868>
This will make it easier to rerun CI builds for releases.
@ionic elk Could be either, but I would personally suspect code first. Or you found a lovely bug ๐
I've managed things like that with code before is the reason for considering that first.
@slender iron you said you're tweaking the software a lot for the game boy cart. does that mean the hardware is mostly final? could i manage to put the board together myself and then flash any updates to the software?
@timber mango I believe the hardware is final but since there are bugs I'm not 100% sure I won't need to rev hardware.
Ya, if you assemble one yourself then you could help with the software. ๐
time to teach myself electronics ๐
are you near seattle? I could loan you one
I have been doodling a C64 "cartridge port" <-> fpga <-> feather setup. tinyfpga bx has enough signals, so it could read/write any memory via DMA, or drive instructions onto the bus like a ROM. feather could send it instruction lists via SPI or something. I haven't quite figured out how much stuff @slender iron 's board does without needing an FPGA in the mix.
also I'm not sure whether DMA can drive I/O devices. Sure might be some interesting demo effects you could accomplish if you could update VIC registers every cycle.
@timber mango I'm hesitant to send them permanently because I only have three to show people
@onyx hinge my board acts like memory and simply returns instructions when the host fetches them
it never controls the memory bus directly
it tells the cpu what to do
understandable @slender iron
@slender iron that's what I thought I understood.
what are the two ports on the left of the board ?
midi in and out
@slender iron so I'm also making some doodles about background/idle tasks. Basically, an "earliest deadline first" scheduler, still cooperative, will now let you re-enter other tasks, but never re-enter the same task. It also requires coming up with (largely imaginary or at best hand-wavy) deadlines for all background tasks, and turns them from a block of code into a structure..
@slender iron thoughts before I get too far into implementing it?
@split zodiac totally ๐
could you technically encode artbitrary data and send it over the midi port?
yup, it's just uart with an optoisolator on the input
@onyx hinge sounds like it might be something switching to an rtos could give us. I've never used one myself though
i did some PS/2 keyboard to serial stuff with assembly but that sounds more fun
@slender iron I have some experience in that area with LinuxCNC, though we NIH'd everything.
in the name of having our own portability layer of course
of course ๐
i really want to make a little operating system for the game boy using this
do you think it would be possible @slender iron ?
@slender iron are there rtos-like parts of micropython we can integrate instead?
what speed do y'all run the qspi flash at?
@timber mango it depends on what you mean by operating system. the cart basically makes the gameboy buttons, sound and a screen for circuitpython
@onyx hinge not that I know of. I know some folks use micropython from within freertos though (the imx rt PR upstream does)
I can't figure out where the storage module is actually implemented for samd
arduino defaults the qspi to 4MHz but that seems slooooooow
@slender iron just a software operating system with little applications and stuff
@timber mango ya, that should be doable!
put wifi on the board so it can have an internet browser ๐
@exotic pumice for external flash it's done outside the port in supervisor
(not actually real)
yea haha but still cool
there are companies that do the full board print and assembly, right?
yup! they won't be able to test it though so you may need to fix it anyway
yea i can probably give that a go though !
that's okay i think it's worth it
do you think it would be possible to have a 32-bit framebuffer that is quantized and blitted onto the game boys vram each frame?
you'd have to do the math
probably getting ahead of myself but its just so exciting ๐
I doubt you can push that much data each frame
mm you're probably right and only CGB has VRAM DMA ๐ญ
if it's "just" running instructions, then that gives you a quick check on how many pixels you can push...
a long enough sequence of STA instructions, f.e.
but I also don't know what the limits are on the samd side
ye i havent touched gbz80 in a while so ill have to work out the cycles
it still has to copy everything from the ROM into VRAM right @slender iron ?
@slender iron since you have control over all the cartridge i/o, where does the cartridge rom point to ?
oh right it's not a 6502 in gameboy
LD A, IMM and LD [HL+],A are each 2 cycles, so you can do about 1MHz / 4 of them per second or 8kB per 30fps frame ?
sorry was waking up
25920 cycles which is more than a whole v-blank
@onyx hinge yea that gave me a good idea
just to double buffer and run at 30fps
Thanks @siddacious! The tutorial is very good so far for the Git side of it, and for coping with Travis as well. I'm feeling more overwhelmed by docs and examples for the new code to be honest, Sphinx, Readthedocs, .rst, .yml, etc. I'm sure the process is itself all documented somewhere but it feels like a big lift for a first-timer. One step at a time I suppose...
@timber mango there isn't a ROM to speak of because the samd dynamically returns data (ignoring the address almost all of the time)
Pins for D2, D3 connectors and cap touch pad nose were incorrect. According to the schematic they are PB08 and PB09 for D2 and D3, and PB08 for the nose. Updated pins.c to reflect accurate pins. Also removed the line disabling touchio in mpconfigboard.mk.
Tested with altered firmware build, thanks to @jepler for the quick test build. Tested capacitive touch using touchio with the nose pad. Tested NeoPixel strips on both D2 and D3. All work successfully.
I also carefully eyeballed the schematic. I don't have a m4sk so I couldn't do any testing except that it built.
I have a grand central, and have successfully set up importing singular .py scripts from the sd card and am trying to get numpy working, but it is not working. The current error is:
AttributeError: 'module' object has no attribute 'array'
Which basically means it has not imported numpy properly XD.
Numpy is a series of folders instead of a single .py which I suspect is the issue. I was wondering if there is a way to make this work.
Thanks!
well, returning to the M4 dac stuff for an hour, I can reproduce the "stairstep DAC when increasing" behavior under Arduino by setting CCTRL above 0. This is the "current control" and is supposed to control the rise and fall rate of the DAC output, I think.
What arduino configures and what CP configures, neither quite match the datasheet .. argh!
CCTRL = 0 is to be used with clock <= 1.2MHz, but Arduino uses 12MHz.
@timber mango technically the cpu thinks it's reading and address but we ignore it. We've issued the code itself so we already know what to return and can ignore the address except to detect the vsync interrupt
and yes, if I copy those settings -- including the GCLK settings -- the rise/fall match Arduino
I wonder what uses GCLK 4? I can't find it via grep.
@slender iron thats so neat ๐
I'm quitting for the night, but somebody's got to explain me why ports/atmel-samd/peripherals is a submodule and I'll read back tomorrow. (one element of the current best DAC fix I've got is in that submodule, which tricked me)
@onyx hinge it's a submodule so that it can be revved/used separately from CircuitPython
I experienced the same thing. The latest version of CP that I could get working with this was 4.0.2. It seems to break after the speedups.
I've had about enough of samd51's DAC.
this is playing the looping sample [0, 57600]
both peaks should be the same
if I go down a bit, say to 56000, they are stable
if I go higher, say to 64000, they are "stable but not what was requested"
solution: when playing audio out, scale everything to (56000/65536) of full scale ๐ข
takes a break
@onyx hinge that seems maddening. thinking back a couple weeks, i wanted to blame the open-mode DFLL as the source. but iirc, Arduino uses it too. at this point, i'd only be throwing darts at the WSJ stock listing...
Automated Libraries update for 15-Sep-19
@raven canopy Does Arduino actually use the DACs for Audio? I looked around for a library and didn't find it.
proceeds to throw a dart
@onyx hinge have you played around with the DACx.REFRESH register at all?
hehe. concurrent thoughts.
๐ค hmm...well, I assumed it did. i can take a gander.
I got to the point where directly setting the DATA register in CP gives results that look like Arduino doing AnalogWrite, full scale 0 to 65535
but AnalogOut and AudioOut on CP are pretty different, and AudioOut is still giving weirdness
I actually DID get AudioOut to give the same waveform as Arduino doing AnalogWrite, except that it did it without respecting the actual sample rate
Ouch.
haha. "Excuse me silicon-collective, but that doesn't seem correct."
checks whether samd51 might be violating the code of conduct
@onyx hinge are you using Tone or analogWrite on arduino?
@radiant wind AnalogWrite
pinMode(A0, OUTPUT);
analogWriteResolution(16);
}
void loop() {
analogWrite(A0, 0);
analogWrite(A0, 65535);
}
k. looks like it uses the DAC to me... https://github.com/adafruit/ArduinoCore-samd/blob/master/cores/arduino/wiring_analog.c#L418
I agree, but it is not using DMA to send a sample, it's just sending one value after another
true. it has that "luxury".
why must the SAMD sheets contradict itself.. ๐
DACx.REFRESH Feature Description:
tREFRESH = REFRESH ร tOSCULP32K
DACx.REFRESH Register Description:
tREFRESH = REFRESH ร 30ฮผs
and, it looks like we're already using the lowest REFRESH anyway.
0 = no refresh
1 = reserved
asf4_config is set to 2.
32768Hz is about 30.5us so I'll forgive that much
here is the characteristics at 85C chart. does the drift, plus the RuntimeCal using DFLL (which also drifts), cause any concern? serious question; i have little experience outside the ~2 years i've been here.
I don't think I've heated anything to 85C while running my tests
so on top of all my other fixes, rescaling the samples so they are in the range 1000 .. 65000 instead of 0 .. 65535 would fix the last waveform problem
taking some away at the high end and some at the low end gives more total range for some reason
.. I need somebody to look at this and say "yeah that's crazy but let's go ahead and do the workaround" (or "not do the workaround", I don't care...)
I am closing this in favor of a new PR to be issued shortly.
[adafruit/circuitpython] Pull request opened: #2158 AnalogOut / AudioOut: Copy settings from Arduino
Make changes in asf4_conf even though I think in these cases the "peripherals" submodule is running the show.
Arduino clocks the DAC at 12MHz but uses the CCTRL setting for clocking < 1.2MHz (100kSPS).
A fresh clock (6) is allocated for the new 12MHz clock. This matches the Arduino value, though not the GCLK index.
Modify other settings to more closely resemble Arduino.
In AudioOut, actually clock the waveform data from the timer we set up for this purpose.
This gives good wav...
The waveforms you can get when using DMA are really bizarre. Here, the sample data alternates between 0 and some critical number around 57000. Every even "high" sample is flawless, but then the odd "high" samples are just all over the place. Go lower, and all the "high" samples are equal. Go higher, and the odd "high" samples are all wrong, but they tend to settle at about the same wrong value. This is real hard to explain!
. We also use the unix port for testing, but it does not try to emulate CircuitPython for regular use.
We don't purge other ports because i makes merging from upstream more difficult.
BTW, support for esp8266 was dropped as of 4.x.
and stm32f4 (in progress, and not the same as MicroPython's stm32)
That answers many many questions. Thanks!
@hierophect feel free to pick up a https://www.adafruit.com/product/4324 on your travels :)
import time
import board
from analogio import AnalogIn
analogs = []
for pin in (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5):
analogs.append(AnalogIn(pin))
def get_voltage(pin):
return (pin.value * 3.3) / 65536
while True:
print("(", end='')
for a in analogs:
print("%0.1f,\t" % get_voltage(a), end='')
print(")")
time.sleep(0.1)```
trying the firmware.bin you posted, only board.A1 works, a...
Iโll check that out tomorrow morning, thanks for the heads up. I was using
the direct PIN numbers for the Analog channels so maybe something is messed
up in the aliases.
On Sun, Sep 15, 2019 at 7:36 PM ladyada notifications@github.com wrote:
import time
import board
from analogio import AnalogInanalogs = []
for pin in (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5):
analogs.append(AnalogIn(pin))def get_voltage(pin):
return (pin.value * 3.3) / 655...
kk also digitalio stopped toggling output pins, like it doesnt complain or anything but when i run my LED blinky demo no LEDs light up
@onyx hinge you should be able to merge now
anyone want to replicate this? https://forums.adafruit.com/viewtopic.php?f=60&t=156235
Where is alt_index used?
@AdinAck Did you modify sys.path to include the folder on the sd card?
As @ladyada says it's highly likely that numpy will take too much memory and/or require native modules we don't support.
Yes the sys.path included the SD card. I have given up on using numpy. Thanks for the help though~
Adin Ackerman
From: Scott Shawcroft
Sent: Sunday, September 15, 2019 8:51 PM
To: adafruit/circuitpython
Cc: AdinAck; Mention
Subject: Re: [adafruit/circuitpython] How to import large complicated pythonscripts from sd card? (#2157)
@AdinAck Did you modify sys.path to include the folder on the sd card?
As @ladyada says it's highly likely that numpy will take too much memory and/or require nativ...
@slender iron how much memory is there on the circuitpython cart for program, gfx, etc?
@meager fog the stm32 port is so cool! f4 and f7 in the works or just f4? (very excited)
@marble hornet Just the F4 for now, there's a lot to do even within the STM32 families! Scott's mentioned interest in the F7 and NXP's new chips after that.
@tannewt should be good now
@timber mango I think it's 256k ram total because it's the SAMD51x20 iirc
Good afternoon all you wonderful folks โ Iโll be lurking on the call today :)
oh shewt I forgot it's monday. will be listening only
Lurking today
Text only today. Wrapping up the final two tracks on the album today.
Yes
nice name
we have an album, i should prolly post up that we have one more often - https://www.adafruit.com/product/1688
A black box arrivesย in the mail. ย It's a Cupcade, from Adafruit and you've been anxiously waiting for it. ย You rush to your workbench, switch on your soldering iron, ...
Great album, @river quest . I play it often.
๐