#circuitpython-dev
1 messages Β· Page 231 of 1
hmm. i think as4_conf is still used for the clocks. π€·
(gdb) svd/x OSCCTRL DFLLCTRLA
Fields in OSCCTRL DFLLCTRLA:
ENABLE: 0x1 DFLL Enable
RUNSTDBY: 0x0 Run in Standby
ONDEMAND: 0x1 On Demand Control
4.0.0alpha5
... i ... cannot explain. hehe
@marble hornet we could add support that enables it
I kinda want to rework the in/out stuff for 4.1
don't want to add more to 4.0
no rush of course, just putting it out there
No luck there. Is there any other reason that CircuitPython would work perfectly over serial but not show the USB Drive?
as an offer
I want to make my own circuitpython board.
My idea is to make a board like the ItsyBitsy M4 with ATSAMD51G19A 48-pin,
BUT with a crystal (like the Feather M4).
Q1: I think I have to make my own board variant under circuitpython/ports/atmel-samd/boards/ , right ?
(is it enough to state "#define BOARD_HAS_CRYSTAL 1" / where can I define what kind of crystal ?)
Q2: Do I have to make my own variant of the UF2-Bootloader binary then as well ?
(or does the bootloader only vary regarding the processor version [internal flashsize / RAM size] ?)
If it's not able to talk the SPI flash chip, then there'll be no CIRCUITPY. So I think there is still debugging to do there. You'll probably need to set some breakpoints and single step to see if it's working. And you can add print statements (since the serial is working).
@timber mango There's a standard crystal at a a standard frequency. You can just copy the Feather stuff to your own board.
The UF2 bootloaders vary based on chip and pins used for status indication (e.g., NeoPixel or DotStar or just an LED, and on what pins). And they ID the chip based on a USB Vendor ID/Product ID (VID/PID) which is different for each board.
@tulip sleet thanks Dan,
- so it is not possible to use a different crystal than the "standard" 32.768 kHz crystal, right ?
- and the UF2 bootloaders "doesn't care" if there is a crystal or not ? -> so you think I could use the stock ItsyBitsy M4 UF2-bootloader-binary then ?
@timber mango The chip supports using a 32kHz crystal and/or a 0.4-30MHz crystal (on different pins). However, we don't provide any clock initialization support using other than the 32kHz crystal.
The UF2 bootloader now always is crystalless, so as long as your status RGB LED is set up the same way, it should work. If this is just for you, then you could use the same bootloader, but if you are distributing these, you should figure out your own USB PID/VID.
@tulip sleet OK thanks for clarification, so the statement "#define CRYSTALLESS 1" within uf2-samdx1/boards/itsybitsy_m4/board_config.h is not needed (or has no effect anymore) ?
it's also in inc/uf2.h, so everything is crystalless.
I see now ....
@solar whale thanks for the quick fix on TinyLoRa
I just tested it and did a release (didn't have my TTN router set up at home yet, just moved).
@prime flower no problem -- glad I was able to find it quickly.
@timber mango I have a itsybitsy knockoff that I designed with a crystal if you have any q's. I'd love to see what you come up with (also happy to share what I have)
I tried powering through the DC jack just in case I was balancing on the power limit, but it didn't help.
Pinging the board works just fine.
I think I'll just drop this for now. I was hoping for an easy way of getting network on this board so I could start porting the network modules in the CPython standard library. It will have to wait.
How do you enable the driver when building? AFAICT it's not enabled on any boards.
I still have the above mentioned problem.
Additionally I have this:
Test script:
import serial
import sys
import time
port = sys.argv[1]
print('port:', port)
version = sys.argv[2]
cmd = b'__import__("os").uname()\r\n'
print('cmd:', repr(cmd))
print()
CHAR_CTRL_A = b'\x01'
CHAR_CTRL_B = b'\x02'
CHAR_CTRL_C = b'\x03'
CHAR_CTRL_D = b'\x04'
with serial.Serial(port, baudrate=115200) as ser:
# Reset REPL
ser.write(CHAR_CTRL_C)
ser.write(CHAR...
Add ability to playback audio through a PWM output. That will allow us to playback audio on pins that don't have a DAC. An RC filter can be added to smooth it out.
<@&356864093652516868> Weekly meeting in about 30 minutes. Everyone is welcome! Here is the notes doc, feel free to type up your hug reports and status updates before the meeting π https://docs.google.com/document/d/1lN3bcPqdNaL3vFCIUMcrCrJkbvyWuIBnvWpR1TqVOOU/edit?usp=sharing
@ruby atlas when you have a chance: https://forums.adafruit.com/viewtopic.php?f=60&t=147460
In some SPI slaves, a read from a register is achieved by writing to it. I've been using the busio.SPI.write_readinto() function described at
https://circuitpython.readthedocs.io/en/2.x/shared-bindings/busio/SPI.html
In order to read the contents of a register, I need to send the 8 bit register address + read bit (all included in the first 8 bits) and an additional dummy byte. The contents of the register get clocked out during the dummy byte write.
Although I specify 2 byte write ...
Hey, I'm joining but I'll be lurking today π
Same. lurking. and hacking.
I gotta split but I'll leave some notes
π
Could you specify the board you are using and the version of CircuitPython?
(I'm not here, shhhhhhh)
@pastel panther https://tenor.com/view/hiding-gif-8862897
Generic group hug to the CP community.
you're fine @marble hornet
π noted π
:thumb: @prime flower
should we make it purple?
I agree
π
π
great!
Like Mace Windu's lightsaber!
And my hair π
Sorry I'm late. $day_job...
welcome! no worries
Yay! PCBs! @idle owl
only a few things π
@gilded cradle yep. sry. lost momentum due to power outage. will take a look again today.
Thanks @tidal kiln
whoo I love microcenter
neat!
assuming i don't lose power again, more π¨ coming down right now
Last Week:
-
circuitpython-build-tools:
- Added
font5x8.binto library bundles foradafruit_framebuf.
- Added
-
adabot:
- Just remained confused at how temperamental Travis is being. crons have now passed, but it doesn't appear to be related to any changes to adabot. π€·
-
FrequencyIn:
- Added user configurable
capture_periodattribute. Has 1ms - 500ms range for now; will decide minimum and maximum after more testing. - Removed EIC latency adjustment, and simplified the math. Hoping this allows me to approach adjustment from a fresh perspective. Getting about 10% fluctuation in readings from a min/max perspective. This is mostly the variation in the capture period, not EIC latency, since the period can be up to 900us beyond the set capture period. Note: I finally did the math on EIC latency; even with a 48MHz clock (GCLK_EIC), latency per event is in the nanosecond range.
- Added user configurable
This Week:
-
FrequencyIn
- Adding event counter overflow handling. Increases possible max frequency capability, so that
131,070(65,535*2) events are possible. This will aid longer capture_periods.
- Adding event counter overflow handling. Increases possible max frequency capability, so that
-
adabot:
- Work on newline issue for Google Docs transcription
Sorry it was so long...
impressive!
Thank you
do it!
Great progress!
looks really good!
Last Week:
Wanna make your own temperature network? Like - your very own network? Build one using LoRa/Adafruit IO and LoRaWAN/TheThingsNetworkhttps://learn.adafruit.com/multi-device-lora-temperature-network/overview
Adafruit IO Monthly newsletter was released with a few CircuitPython projects: https://io.adafruit.com/blog/notebook/2019/02/08/adafruit-io-monthly-february-2019/
This Week
ADT7410 CircuitPython Guide
New Crickit CircuitPython Guide, Adafruit IO integration (of course!)
Event Plug: come on down to the NYC Firmware Meetup to hang out and talk CircuitPython. Iβll have hardware and Iβll be doing a quick talk about the circuitpython community, circuitpython, and contributing to the project. Itβll be fun (I hope!) https://www.meetup.com/NY-Firmware-Meetup/
Welcome to the Adafruit IOT Monthly for the cold month of February (anyone out there making an internet-enabled hot-cocoa machine?). This newsletter (in blog...
Thank youβΊοΈ
BTW, there's LOTS of Adafruit stuff at Microcenter. Aisles 27 & 28 especialy at my store have large sections of Adafruit tech.
π
nice!
me me!
Ooh
Thanks!
Thanks
π
Thanks all!
π
Thanks all
Love working and pythoning with all of you
π
You did great Katni!
There was an official Snowmaggedon a few years ago, so it's a proper noun...
@wraith tiger which store was it?
Paterson, NJ. It's the only store in NJ.
okay
Here's Daniel Lanois' song Ice where he uses the hacked autoharp: https://open.spotify.com/track/3sPmjgKNIWDXqYt5e0yved?si=8RhyaEdURT6zQoP5V5m79w
ya, its handy
Enjoyed being back with y'all today, but most go out and clear the walks. The Adafruit and DigiKey orders must come through!
I go to st david store
@tidal kiln https://www.adafruit.com/product/3143
The 2x4 fit the Saleae
@tidal kiln combine with these https://www.adafruit.com/product/3141
er
the female/male version
@idle owl gotcha. pololu is a good source for those also (more options), for future ref.
@tidal kiln Yeah, I did a bunch of searching initially but getting from Adafruit is so easy.... π
These wire/housing combos are one of the most useful things I've added to my parts supply.
Thanks for letting me drop in -- always enjoyable to hear how things are progressing
I've been kind of technolusting over the Bitscope Micro we sell at the store.
@slender iron Looks amazing
Of course, I'd love a "real" scope, but can't justify spending $300 on one.
@umbral dagger got a crimp tool? pretty easy to use for when you want to be more custom.
I find the saleae way more useful than my scope
I don't these days
@wraith tiger I can't say personally as I don't own one, but I've heard people really praise the Analog Discovery 2.
but I do digital more than analog
@tidal kiln Back in the day I was all ribbon cable and IDC connectors.
I have a digital discovery and prefer the saleae software
The saleae software is pretty solid, I'll give you that.
A crimper + ends + ribbon to make custom length cables and harnesses would be the next logical step.
Yeah, but the Digilent and Saleaeare both to pricey for me at this point.
With employee discount I can get the bitscope for just under $100.
Oh yeah, the salinityaeeeae has gone through price increases every 2-3 years. It's about doubled since when I bought mine. Same exact product too.
[i can't never spell saleae correctly either, so might as well do it wrong with style.]
"It is a d a m n poor mind that can think of only one way to spell a word."
@modern wing I believe they've also deepened their discounts as well though there is still a net increase
Also: sale-ayyyyyyyyy
finger guns
Hey @slender iron - your weather stinks π
@tough flax nothing I can do about it
And later that week, you share it with the east coast....
I'm using CircuitPython 3.1.2 (the latest stable release) on the Metro M0 express. Also seeing spotty behavior with certain data writes (e.g 0x55) and read back.. The chip AMIS-30532 has been extensively used with other microcontrollers...
Here's my CircuitPython code if it helps
source code for metro m0 express
import busio
import board
import digitalio
import supervisor
baudrate = 100000
the following is for SPI communications
cs = digitalio.DigitalInOut(board.A2) # cs should be wired to this pin
cs.direction = digitalio.Direction.OUTPUT
cs.value = True # chip select default state is HIGH
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
def BytesToIntsList(writeDataBytes):
# writeDat...
Can someone tell me if the lib for the adsfruit MMA8451 with work with the MMA8452 accelerometer breakout
@wallarug What do you mean by works perfectly? Are you doing file system manipulations from the REPL? They usually fail as well as the mass storage.
@modest atlas probably not as is, could be lot's of parts that are hardwired for 14bit vs 12bit, ex:
https://github.com/adafruit/Adafruit_CircuitPython_MMA8451/blob/master/adafruit_mma8451.py#L196
@slender iron I found a bug in register related to our update. The bit_mask was still set to (1 << 8) which didn't allow for manipulating bits 8+. This is my fix: if self.bit_mask >= (1 << (register_width * 8)): raise ValueError()It works, but I'm not sure it's correct.
Allows for more than 2 byte registers. My original fix was change 8 to 16.
@idle owl can you link to the context?
I didn't push it anywhere. I'll upload the file here.
Otherwise when I tried to change a bit range in the 8-15 range, it threw a ValueError.
is there an rss feed for the podcast?
so I can use it outside spotify
nvm, found it in pocketcasts π
It's enabled by default for some of the "express" boards but not the grand central for whatever reason.
Easiest way is to edit ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk and add the lines:
MICROPY_PY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
@marble hornet Yep - for read the docs?
yes
CharLCD is a good library to look at for reference on how to make the docstrings (since it's had so many eyes on it)
^ as an example
Hi @tannewt ,
When I say "working perfectly" it is probably an overstatement.
I can connect to CircuitPython using Putty (on WIndows) over the Serial COM port and make the LED on the board flash. File manipulations fail. I tried running the filesystem_erase and it said "incorrect pins".
REPL does not work since it relays on the USB drive appearing.
I am doing some more testing today to see if this chip can work or not.
@idle owl I don't think you want to multiply the shift
Ok then what should I set it to? 8 fails.
well its making a bitmask to apply to the particular byte the value is in
@marble hornet also...here are the nitty gritty docs on Sphinx. this exact link is to the rST primer, but the entirety lives there. http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
so it makes sense that its between 0 and 7 because its on a byte
Except you told me to make it know I'm in the high byte, I have to use 8-15 when using RWBits
for lowest_bit yes
right
internally that info is split into byte and bitmask
and lowest_bit
I think lowest_bit needs to become byte local (0-7) rather than for all of the bytes
this is related to lowest_bit // 8 for byte
ok.
because you want lowest bit to be the remaining bits
so lowest_bit_in_byte = lowest_bit % 8
I don't remember what I did to make it fail before. It failed on that line so that's why I though it was related to that line
then what do I do with lowest_bit_in_byte
I think it should be used to compute bit_mask and saved as lowest_bit
otherwise the math in get and set is wrong
I don't know how to do that.
I also don't understand how it will know I'm working in the high byte at that point either. but I'm not entirely understanding the change, so that's not surprising.
self.byte knows which byte get and set are in
ok
so init needs to set lowest_bit and bit_mask so it works on the single byte we care about
Although I specify 2 byte write and read buffers, CircuitPython sometimes returns only one byte.
I'm not sure what you mean by this. You create the read buffer, and it's 2 bytes long, based on what you said. Do you mean the read buffer is only one byte long when you return it, or do you mean there's only one byte of meaningful data in it? That would be true because the register address gets transmitted during the first byte time.
Do you have some sample output or something like that we...
I think you could just do
cs.value = False
spi.write(<1 byte buffer of register address>)
spi.readinto(<1 byte buffer of register data>)
cs.value = True
spi.readinto() writes out zeros as it's reading in, which is the same thing you're doing by using write_readinto(), based on the diagram above.
There are SPI devices that let you pipeline the next command as the data requested in the previous command is coming back. That's why we added write_readinto().
Hello @dhalbert
I think the main problem lies with the bytearray function in CircuitPython or my misunderstanding of it.
Suppose I want to write the hex value '55' (0x55) to a register (0x03). While writing these bytes we end up generating a list of integers [03, 85] where the first integer is the register address and the second is the integer equivalent of '0x55' = 85.
When we read back, the bytearray function represents the '0x55' as 'Latin capital letter U' per the following link
...
@dhalbert
Its the print(read_result) statement in the CircuitPython code.
Consider
a = bytearray([85, 85])
print(a) # this outputs bytearray(b'UU')
a = bytearray([170, 170])
print(a) # this outputs bytearray(b'\xaa\xaa')
I'm wondering if there is an option in the print statement that will do the correct conversion
So the problem is that print(read_result) is printing the wrong thing, is that correct?
I think what you want to do something like print(hex(read_result[1])[2:])
That will retrieve the second byte of the bytearray that read_result returns, convert it to hex (like '0x55') and then remove the '0x' (using [2:]).
I think you may know this already, but subscripting a bytearray returns an integer, not a single byte bytestring. This is unlike strings: if you subscript a string, y...
Printing a bytearray sometimes prints characters and sometimes prints escaped hex values (if there's no equivalent printing character). That's confusing, I agree.
@dhalbert
You have hit the nail on the head!
Yes, print(read_result) is printing the wrong thing - actually I'm misusing it.
Since I want my code to work with burst reads I need to generalize it for multiple bytes. I'll work on this a bit more but at least we know it was my mistake :-)
Thanks for being there for me!
Anand
@meager fog yes working great -- I have been able to do posts to AIO and run monitor cheerlights for several hours.
Ok, sounds like the issue is the flash chip initialization. One of the first steps is to make sure your chip's id is being recognized here: https://github.com/adafruit/circuitpython/blob/master/supervisor/shared/external_flash/external_flash.c#L194
I use a debugger to read the values that we're read and to make them match.
A logic analyzer can be helpful too to see how far the flash code gets.
thank you @raven canopy and @prime flower
This is an implementation of #1046 , with a couple of things missing:
- I was having trouble with the weak references to common_hal_rtc_get_time and common_hal_rtc_set_time which I've got a workaround for but not really an explanation for
- There's no calibration for this RTC. It could be calibrated by scaling the RTC counter values slightly but there's no facility for tuning the RTC clock itself.
i have some general questions:
does the bootloader and cp use the same usb stack?
okay, just one for now
Hey @tannewt ,
Thank you for your helpful insight.
Please excuse my inexperience here: If the flash is mounted to the board and attached to the M0 chip, how can I read those JEDEC values? Is there a way that I can get the code you linked (which I believe is run on the M0) to output some information somewhere without needing any special equipment? -- I'm thinking quick and dirty print statements or something onto the M0 console.
At the moment I only really have access to the ser...
@marble hornet from a quick look, i think the bootloader is still using the ASF4 USB stack (minimal w/ MSC only).
thnx
I have been unable to get -flto to work on the nRF build, which is really strange (see https://github.com/adafruit/circuitpython/issues/1396). I'm not sure if that might be related to the weak references issue, but possibly.
I usually use gdb. You should be able to use it if you can burn bootloaders over SWD. There are general instructions here: https://learn.adafruit.com/debugging-the-samd21-with-gdb
I'm very puzzled about the whole thing. I'm not, at this point, sure if it is a flaw in my understanding of __attribute__((weak)) or something genuinely weird going on, maybe in combination with inheriting the __attribute__((noreturn)) from the raise?
I got as far as working out that if I removed the weak declarations, OR changed the error messages raised by the weak declarations to be different, then the problem goes away. 8a88a6f uses this workaround so at least I could make some ...
(oh, and because I changed that error message it's upset the translations, which is what Travis is complaining about. I'm seeking a better way)
Hi @tannewt ,
I found a way. It's not clean but confirms values in a similar way to that code you linked to.
Line ~256, main.c
print_safe_mode_message(safe_mode);
serial_write("\n");
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload."));
/// @wallarug added this very dodgy hack
serial_write("\n");
serial_write_compressed(translate("** Checking SPI Flash Device. **"));
serial_wri...
@pastel panther yes, I would love to see more of your "itsybitsy -knockoff", do you have a link or github-repo ?
@tannewt Oh okay no worries. I'll get this finished off ASAP.
what is that?
* on current master [c47c495](https://github.com/adafruit/circuitpython/commit/c47c495acaaf1815140571808606c920b23d25b2) * Featherwing on top of the Feather, RST is not connected * powered from my laptop USB - has not been a problem with the same device when using ArduinoOn the REPL:
Adafruit CircuitPython 4.0.0-alpha.3-28-gc47c495ac on 2018-11-28; Adafruit Feather M4 Express with samd51j19 >>> import board >>> import bus...
Guys, a couple of quick questions:
a. Why can't Raspbian detect a Circuitpython board with CP4 when connected to one of the USB ports (like it does on Mac and Windows)?. Do I need to install a special package?. (I'm feeding the board from two different USB parts since the RPI doesn't seem to provide enough juice to the board).
b. What's currently the cheapest WiFi capable CircuitPython board/option?
I think the $17 Feather Huzzah is the cheapest WiFi capable one.
a) not sure -- it shuuld work b) there are no WiFi boards currently supported for CP 4
@main meteor but the huzzah is not compatible with CP, right? (only Micropython)
Isn't the Particle Argon supported by CP4 and it has Wifi?
Huzzah 8266 is supported up to CP3.x, but it's not USB capable so you have to use ampy for programming/file xfer. For future support, to include the Argon, you have to use the new ESP UART/SPI library.
@gusty topaz RPi should be fine driving a board unless it has tons of other stuff drawing power. It's only a few tens of mA. I just plugged a Grand Central into an RPi and connected via /dev/ttyACM0
Argon build does not include wifi support
we have dropped ESP8266 as of 4.0.0
@tulip sleet does the RPi auto-mount the MSC though? I think that is the question...
yes it does, just fine
@gusty topaz what RPi board and what version of Raspbian are you running?
show uname -a and cat /etc/issue
Latest lisp-on-circuitpython results: lispy> (load-device "si7021") Loaded ./devices/si7021.py No file: ./devices/si7021.scm lispy> (define sensor (make-si7021 (i2c (board "SCL") (board "SDA")))) lispy> (si7021-temperature sensor) 25.4586 lispy>
@gilded cradle the Argon runs CP in the nrf52840 portion -- it does not use the ESP32 chip -- it can be used as a coprocessor wit the ESP32ATControl library
The adapter code (devices/si7021.py): ```import adafruit_si7021
def make_si7021(i2c_bus):
return adafruit_si7021.SI7021(i2c_bus)
def si7021_relative_humidity(device):
return device.relative_humidity
def si7021_temperature(device):
return device.temperature
global_env.storage.update({
'make-si7021':make_si7021,
'si7021-relative-humidity':si7021_relative_humidity,
'si7021-temperature':si7021_temperature
})
Ok, that's what I thought, but it IS still wifi capable, correct?
@gusty topaz I see a binary release for CircuitPython here https://github.com/adafruit/circuitpython/releases/tag/3.1.2
@raven canopy FYI -- the ESP32SPI will not work on the argon π¦ only the UART --
@gilded cradle yes, but not in the CP code. You have to laod a special image to the ESP32 and then send "AT" commands to the ESP32 via the UART. The CP does not have anything to do with the WiFI access.
Thanks @solar whale . I'll have to get some of the particle boards at some point so I can be more familiar with their capabilities.
they are fun to use -- both with CP and the Particle mesh software
but for Wifi access -- now I would recommend an ESP32Huzzah with a feather (m4 or nrf52840) and the ESP32SPI interface.
or wait for the new board to come out
Ok, I have both of those. I wasn't sure how to get the special image onto the ESP32huzzah though
I can send you instructions in a little while -- the SPI stuff is very new and there is no guide ...yet
but basically you use esptool to upload it via USB -- just like you would load micropython to it.
If you don't mind waiting until this evening, I can write up some instructions.
@gilded cradle the LoRa boards are also fun - weird at first - but fun
Thanks @prime flower . I'll take a look at those when I get a chance, but am pretty immersed in the featherwings at the moment.
there's a featherwing LoRa radio π
Oh boy. I guess I'll have to take a look at that. π
Yeah, there's like 4 of them
Are you in the US?
You'll want one with the RFM95 (LoRA/LoRAWAN compatible) with a 900mhz radio (915mhz tx/rx)
Ok, do you need at least 2 in order to test them?
You would need two or a Radio Bonnet (https://www.adafruit.com/product/4074) and one for LoRa/LoRAWAN
Ah yeah, ok. Well I added them to my wishlist.
tbh, I'd wait until the radio bonnet is back in stock. It's the quickest/cheapest way (currently) to get started w/LoRaWAN
@solar whale what new board?
That's probably what I'll do, hence adding it to the wishlist. π
@tulip sleet I'm using a Raspberry Pi 3 Mod. B and Raspbian Jessie.
@gusty topaz My understanding is the there is a board with the integrated esp32 in the works -- thats all I know
@gusty topaz I'd suggest you upgrade to the latest, stretch
stretch has been out for almost two years
@solar whale ohh. you are right!, I think @meager fog mentioned it in one of the videos, but I think it'll have the "Metro" form factor. I prefer the Feather form.
also the USB thing is suspicious. Maybe the DC supply you're using for the Rpi is inadequate. Try a beefier AC adapter first
@tulip sleet I know, I know... the thing is that I have a bunch of scripts (Python 3) in it and everytime I update it, it breaks something.
how are you powering it?
2.5A power supply is recommended, especially if you have USB devices and are using HDMI
and wifi
@tulip sleet computer USB.... but it's not just the board. It's a tripler with a GPS featherwing, PArticle Xenon, Oled display, SD card breakout ... so yeah, it may be related to current consumption. The wierd thing is that I powered the tripler from two USB ports (2nd one coming from a different computer.. just power, no data).
No HDMI, the RPI has a WiFi dongle connected only.
@solar whale are you referring to this guide? to use CP + WiFi Coprocessor? https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32/overview
Wht are the odds of getting CP supported on the new Pyboard-D? It looks pretty sweet.
@idle owl Wheln tCP 4.0 is released don't forget to update the main board gu ide to include the fact that USB-midi is available
@gusty topaz that is for the UART "AT" interface to the EPS8266 or ESP32 -- there is a new library to support a much more robust SPI interface https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
only for the EPS32
@gusty topaz that's probably OK from the USB ports, BUT the overall power supply must be good too. If you're just powering the RPi from a host computer USB port, that's probably not good enough.
the RPi will draw way more power than what's on your tripler
@umbral dagger completely different chip (STM), which we don't have a port for, so it would be a big job
a 1A phone charger probably is not enough
@tulip sleet Mostly a peripheral issue?
I thought as much.
@umbral dagger heyyy happy tuesday. i have some time now - wanna figure out what projects to schedule for rest of feb?
@meager fog Sure. What do you have in mind? I have the RPLIDAR in progress, and a pyportal should show up later today.
@meager fog More cheatsheet stuff?
@solar whale π€ Interesting.... sounds great, but I think I will go with the Huzzah+Micropython for the WiFi option. I already have that board and MP is good enough for what I will do with it (sucks not having USB support, though). Would love to see a WiFi + CP ready board in feather form.
There's plenty of directions we can push that in
@gilded cradle were you interested in the "AT" interface is the guide above or the new ESP32SPI interface -- or both?
@umbral dagger i think the RPLIDAR really needs a graphical display to show it off, and we don't quite have that yet
Oh I tried with the guide, but it appears to be oriented more towards the esp8266.
we used the ESP8266 at first but it fell over too much, ESP32 is really needed
Ok, that's what I was trying to use
yeah its a very :/ chip
@solar whale (Side note: the GPS logger w/CP 4, Particle Xenon, OLED, GPS Featherwing and SD CArd breakout is working beautifully. Running some tests and so far so good. Will be uplading a write up to my blog soon).
I, also, had trouble with the esp8266 AT interface. I have that project deferred until the esp32 breakout is available.
@umbral dagger how about you try the raspi 3d scanner w/crickit
@gilded cradle the guide does not have the instructions for loading the AT firmware to an ESP32 via esptool/USB - that is easy -- I'll get it to you.
there's no additional hardware or libraries you need that we don't have ready
Thanks @solar whale
@umbral dagger and there's existing software to do the scanning - you're just swappin' out the code that rotates a platform
Crickit isn't even needed. 1 digital output to turn the motor on/off should suffice, based on my current understanding.
hmm getting 503's from adafruit learn system ..
nah you need to step thru the rotation slowly?
you can't just turn the motor on/off - it has to sync with the software taking pix
I thought the oboard controller did that.
sry - whats oboard?
It spits back a series of readings, one for each rotational increment
im super confused π can you point me to it?
You just tell it to start scanning, then sit back and consume the readings
yah but how do you know where the readings relate to the rotation?
either way you still have to power the DC motor
but i think a stepper works way better
Provide downloads for product application notes, development kit, SDK references, firmware, ROS packages of SLAMTEC products including RPLIDAR A1/A2/A3, SLAMWARE, ZEUS, Apollo, SDP, SDP Mini and etc., as well as contact informtaion of technical support.
Sorry .. mybad... I completely glossed over that.
yeah for RPLIDAR you just read from serial - so the driver is just reading values and then parsin' them into a pointcloud
loll
Yes. you are right
very similar!
similar, but sort of inside out
Yes.. I have what I need for that. Need to coordinate with the Bros
We started that but both got distracted, I guess.
np π
we haven't had any raspi crickit projects so i think it would be good to have one or two
to get people some examples of how it can be used
@umbral dagger for RPLIDAR you could try running the circuitpy library on raspi to display it
@meager fog -- I just realized that the AT coprocessor guide has out-of-date instructions for loading the AT firware to an ESP32 Huzzah-- the file to load is not linkked. Would you like me to update it -- Ok to just provide the "big" file for single file load.
that might be a good way to test it - probably the most likely ussecas
@solar whale oof - that guide needs a serious scrubbin' now that ESPSPI is released
do you want them in the same guide?
@solar whale long term yeah -
do you want to try restructuring the guide? cause basically there's 2 use cases now
Particle ESP32 w/AT and Other with ESP32 SPI
anything else i dont mind documenting but its very π€·
maybe we can put the ESP8266 stuff in one page and say "this is incredibly flakey and not suggested"
so drop the AT Firmware for the Huzzah32
agreed!
the difference is significant - i can download 250KB files in 4 seconds with SPI
OK -- I'll try to work on it some - probalbly tomorrow.
ok thanks - i delayed doing any edits till ESPSPI was out - which is is as of...noon today
@umbral dagger ok so ya got this lispy thing going, do you want to finsih that first?
@meager fog any plans to release a CP board w/ WiFi in Feather form?
dragon, not immediately but hopefully if we can find a module thats a resaonsble size
first up is a metro, lotsa space π
@solar whale if i can bug ya to review my changes to https://github.com/adafruit/Adafruit_CircuitPython_Touchscreen/pull/2
i'd like to get that bundled and off my plate π½
@meager fog That's pretty much ready to wrap up. Some crickit support would be nice to add first. But I've proven out a modular way to support i@c device drivers, reusing the CP libraries.
@meager fog I have some working example using "setings.py" for post to AIO and cheerlisghts -- do you want me to put in a PR with them to the ESP32SPI repo or do have some other examples.
@umbral dagger (love i it)
i think i2c is good enough to publish
crickit, depending on how the ram of the feather M4 is... I've been workign on a Grand Central
we dont have tons of spi devices
OK, cool.
@meager fog I did review -- do you want me to merge?
@umbral dagger wanna put that down for publishing... on thursday? or what day works best?
@solar whale oh yayy thanks
done
OK... I have to spend a day or two later this week on HackSpace. I'm at the point with lispy that I can switch focus to writing it up.
The device support was the last big hurdle, and that just fell into place this morning
word - ok how about... friday? we can adjust, but good to have some rough idea
any day ya like
So.. end of tomorrow, or sometime Thursday to submit the guide?
Certainly by Friday.
ok lets say friday so no stressin'
No stressin'... ha
Actually, the HS article will be pretty straightforward this month... mostly theory & intro stuff. No project work. (Intro to integrated circuits).
nice - those articles are amazing
That's a great one. I like the lisp/jedi strip, too.
π
ok after that - RPLIDAR on raspi?
but driver in 'circuitpython'?
i think we'd actually be using pyserial, but still good to have it be circuitpy compatible (e.g. pure python and memory concious)
and then it can be run on microcontroller once we have a way to plot the data
Sounds good
you can probably heavily borrow from https://github.com/SkoltechRobotics/rplidar
and give em credit
nice
yeah you just want to pass in the Uart object instead of a string
and maybe remove the logger code
ok wanna put down a prelim date of....22nd?
& can adjust?
That should work
ok then you can check out the 3d scanner stuff after - ill put down prelim march 1st - all adjustable if you need more time π
Awesome
self driving car should be easier to do with all those done first - cause you'll have the pieces
Question: do you know of a nice readline type library in python that'll run on CP? The LISPY REPL input is uber barebones (just reads a string of characters from stdin... no editing)
oi
well in circuitpy we dont have the ability to read a char at a time
unless you're using it over a UART not USB
It also doesn't echo spo I had to find a terminal app that I could set local edit on (ended up using minicom)
Like... even backspace would be nice to have π
I think I'll add the ability to have it check for code.scm and autoload that on startup.
I wonder if GNU readline could be compiled into the runtime... That's what I usually use for such things
This changes a number of things in displayio:
- Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with
a font it is available as board.TERMINAL_FONT. Fixes #1172 - Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191
- Add width and height properties to Bitmap.
- Add insert and [] access to Group. Fixes #1518
- Add index param to pop on Group.
- Terminal no longer takes unicode characte...
@sommersoft Let's move forward with moving this to the Bundle repo. Thanks!
omg @slender iron this is awesome !
Righto! Just need RTD subproject for the Bundle...
@meager fog With the stuff @slender iron is working on ...
what is @marble hornet ?
@slender iron YOU ARE ! π
π
Oops call Geordi La Forge! transporter malfunction. Looks like the pattern data was forwarded to the wrong spaceshipπ€π€«π. #CircuitPython #adafruit #beta https://t.co/BIJpN2A670
tg got the pyportal in the main
nice!
on a snowy day, its lovely π
agreed! i'm glad i brought an industrial case along for my electronics, i slipped on ice on my way home but the pyp is okay! and is SO COOL, SEEING THE TERMINAL IS AWESOME !
pun intended
haha, glad you like it!
and more wam
Someone put an LCARS on one of these, yeah?
yeah phil t did
and where was that example code again? (i can't remember)
looking...
The fellow with the tricorder on S&T might have something as well
what's that?
He was saying someone on show and tell had a tricorder. I think his name was TNG-Trekkie or something
you are talking to him
I know, I was joking around
π
is this what i 'should' be using for text https://github.com/adafruit/Adafruit_CircuitPython_Display_Text?
Haha
wasn;t a joke
That was a reference to the fact that it was you I was referencing without knowing it
who? π
I've been using Pycom LoPy boards for some wearable project prototypes. I like the embedded Micropython and want to use the same on the feather Huzzah32 from Adafruit. Unless I've missed something that board isn't yet one listed on the GitHub repository.
Is there anyone planning to adapt CircuitPython for the Huzzah32 with the ESP32 micro?
Need to document :param int scale here.
How about "%q must be >= 1" ?
Does this raise a Python exception if it fails?
Lispy on the Fetaher looks good: ```Adafruit CircuitPython 4.0.0-beta.2 on 2019-02-05; Adafruit Feather M4 Express with samd51j19
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Lisp loaded, free mem: 124800
Lispy version 2.0 for CircuitPython
lispy>
That should be plenty of space.
Probably a little trickier on the more space-constrained Feathers.
It's just a matter of not having as much space for the lisp code/data. The Grand Central leaves almost 200K, the Feather about 125K. I haven't done any analysis yet of how it uses space.
125K feels like it should be plenty for a lot of things.
Lispy, itself, is fairly small.
@slender iron Monday is a US holiday, should we move the weekly to Tuesday?
yup, probably
<@&356864093652516868> Due to next Monday being a US holiday, the CircuitPython Weekly for next week will be on Tuesday 19 February 2019. Still 11am Pacific/2pm Eastern.
Oh... it's sort of a holiday here, too.
@slender iron the issue I mentioned eralier with D9 in use has been resolved -- you pr_1535 does not cause any problems.
great @solar whale
Thanks for the update on the meeting time
@slender iron my original example still works to bring up the REPL in my TFT ```import board
import displayio
import time
s = board.SPI()
displayio.release_displays()
display_bus = displayio.FourWire(s, command=board.D10, chip_select=board.D9)
init_sequence = (b"\x01\x80\x78"# Software reset then delay 0x78 (120ms)
b"\xEF\x03\x03\x80\x02"
b"\xCF\x03\x00\xC1\x30"
b"\xED\x04\x64\x03\x12\x81"
b"\xE8\x03\x85\x00\x78"
b"\xCB\x05\x39\x2C\x00\x34\x02"
b"\xF7\x01\x20"
b"\xEA\x02\x00\x00"
b"\xc0\x01\x23" # Power control VRH[5:0]
b"\xc1\x01\x10" # Power control SAP[2:0];BT[3:0]
b"\xc5\x02\x3e\x28" # VCM control
b"\xc7\x01\x86" # VCM control2
b"\x36\x01\x30" # Memory Access Control
b"\x37\x01\x00" # Vertical scroll zero
b"\x3a\x01\x55" # COLMOD: Pixel Format Set
b"\xb1\x02\x00\x18" # Frame Rate Control (In Normal Mode/Full Colors)
b"\xb6\x03\x08\x82\x27" # Display Function Control
b"\xF2\x01\x00" # 3Gamma Function Disable
b"\x26\x01\x01" # Gamma curve selected
b"\xe0\x0f\x0F\x31\x2B\x0C\x0E\x08\x4E\xF1\x37\x07\x10\x03\x0E\x09\x00" # Set Gamma
b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma
b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms)
b"\x29\x80\x78"# Display on then delay 0x78 (120ms)
)
display = displayio.Display(display_bus, init_sequence, width=320, height=240)
but I thought there was a way to now do it with out providing the init_script. Do you have an example? Alos any other examples handy would be great -- I need to make some changes to my display_text tests.
@gilded cradle given the earlier conversation -- do you just want to jump into the ESP32SPI -- I can provide you with the load file and some instructions. If you still want to try the AT firmwate on the ESP32 I can give you that as well. Whatever you prefer.
I think I'll give the ESP32SPI a try
OK -- here is the .bin file to load -- instructions follow
ESP32SPI file
flash it with /usr/local/bin/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0 NINA_W102.bin
you may have to make some OS dependent changes for you esptool and port
I have a mac, so that should work...
what board are you going to usi it with -- I'll geve you the pin connections
I could either use a Huzzah32 feather or I have the DevKitC, though I'd prefer to use the wing
err feather
ok -- I have both as well -- what board are you connecting it to
Well, let's go with the M4 Metro since I don't think that one's in use at the moment
if there is a board with display built in can i find the width and height from board.DISPLAY or do i need to know it?
perfect -- just what i have metro_m4 to huzzah32 -- give a few minutes to get the pins.
Oops, my first attempt to build CP failed. It may be because I'm using a too-recent version of gcc.
In my experience @marble hornet , you generally need to know it, but I could be wrong.
@main meteor, yeah gcc8 has problems
so a user will need to input it if using a lib?
@main meteor I use ```gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q3-update)
@main meteor are you running 8 and if so do you want my makefile?
Yeah, I'm running 8. Maybe I should just grab 7.
@marble hornet , usually only when initializing a library
but if I recall correctly the q3 is a lie -- it was q2
@main meteor, ok, yeah, I seem to have lost the makefile in a git reset
Unless it's designed for a specific screen size
I think
I am interested in that Makefile, but I'm guessing it disables problematic warnings like error=stringop-truncation
yup
tinyusb runs into some issues with gcc8. I fixed some of those temporarily to get it to build. I was just trying to see if the build was noticeably smaller (it was smaller, but only by a little bit).
hey dan, I accidentally pinged you in a gitter channel you're not even in, so if you get a notification just ignore it
just telling someone I followed your advice to run the dfll in open loop
Ok @solar whale , I got the file flashed onto the Huzzah32 successfully
I've gone as far as to not touch the dfll part of oscctrl and my problem persists
just typing up the pinouts
Okay, I was able to build it successfully with gcc 7, thanks!
@gilded cradle I use these pins ```ESP32 METRO_M4
RST D5
GND GND
USB +5
33/A9 D10
14/A6 MOSI
SDA/23 MISO
SCK/5 D9
MOSI/18 SCK
Ok, I'll give it a try and let you know if I have any difficulty.
OK here are the pins used in the example
ESP_BUSY = D10
ESP_RESET = D5 ```
as well as MISO/MOSI/SCK
Thanks
good luck -- once you get the simpletest to run -- I have better examples
Ok
I'm really starting to wonder if I have hardware/calibration issue. Can someone try loading this on their metro m4 and measure d13 for me?
I know dan already did but that was an older version
that had the incorrect dfllmul
this is the one that doesn't touch dfll
@slender iron FYI -- I get this on a feather_m4_express ?? ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.2-30-gb4306314a on 2019-02-12; Adafruit Feather M4 Express with samd51j19
import displaytest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "displaytest.py", line 19, in <module>
AttributeError: 'module' object has no attribute 'A9'
That uname example is working now, turned out I had a 14 days old checkout.
I still have this problem: https://github.com/adafruit/circuitpython/issues/1342#issuecomment-441475189
there is no A9 in dir(board)
I guess I could just write some C that does gclk_io to test the hardware
@solar whale you'll need to switch the pins around
that example is for a breadboarded grand central
ah -- OK -- no problem -- just wanted to make sure I had not missed something....
the fourwire from your original example should still work
just pass it into the library
ok - thanks -- I should hve seen what was going on -- sorry to bother you
np
arduino has the same problem!
holy cow
let me double check it actually uploaded
ok I lied
I don't think it does anything. Seems like it should fail. Removed.
@solar whale, I keep getting ESP32 timed out on SPI select and have triple checked the wiring according to what you gave me.
hmm -- I had that at one point as well -- but rechecking the wiring fixed it ... make sure you jumpers are all good - I has some the just were not working.
Is there supposed to be something connected to D9?
Oh, wait, I think I need to change that from D9 to D6
yes CS -- to SCK/5 -- sorry
Ok, that fixed it
wait
and it worked
ok -- trying to see what I had wrong above
You had me set ESC_CS to D9, but wire it to D6
just D6 -> D9
Yeah, thanks. You said you had other examples
yes -- but I have to go for a few hours -- sorry -- I'll try to get thme posted later this evening. -- do you have a neopixel string on the metro -- good for one of the examples
Not currently, but I could wire one up
its a nice touch. sorry to hold you up.
It's ok. Sounds good about posting them later.
OK -- will do.
Thanks again
glad to help -- and glad to have another person testing it!
π
has anyone tried the set_boundary with the mirror off?
i'm hazing izzues
i can;t get x_end of any width shape past 31
so it seems to work but doesn't render correctly?
yeah, i can;t set end_x to anything great that the height of the shape. i get a ValueError: x value out of bounds
hrm that sounds like a bug π
agweed shall i?
yup, bug
you can fix and pr π
oh found another bug
@meager fog the pyportal just when hay wire. i can't save to it
this causes a boot loop:
for i in range(10s):
print('trying this height', )
try:
shp = Shape(100,i)
for j in range(1,i):
print(j)
shp.set_boundary(j,0,100-j)
except Exception as e:
sys.print_exception(e)
time.sleep(1)
can i wipe the flash somehow? i can;t get to the terminal
@dhalbert Please take another look!
Oops, needed to refresh. /me waits again for Travis
@marble hornet does the status LED go yellow for a bit?
yes
if you click reset when it is then it'll go into safe mode
and not run your bad code
can you give me an example? or number of ms? (to get an idea)
i;m trying different amounts of delay
but it is not working
like getting into BIOS on PC startup? (closest analogy i can think of)
too fast and you'll stay in the bootloader
too slow and circuitpython will start in regular mode
now whenever i hit reset-it goes right to boot loader mode
i have
have you power cycled?
yes
let me try the stock firmware that come on it
the arduino.uf2
nope
isn;t there a safe-mode uf2? or was the decision changed out for this?
ya, broken for me here too
i think i have an idea
i'm gonna compile w/out displayio and then chagne the main.py
if it works ill post the uf2
i wonder if it is;t the displayio
building clean, taking a while
#define CIRCUITPY_DISPLAYIO (0) correct?
just commenting it out didn;t work
ya
kk
reclean building
worked
but won;t show up over usb
does one come first?
`Jonahs-MacBook-Pro:circuitpython jonahym$ ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port /dev/tty.MALS
/dev/tty.BoseQuietComfort35-SPPD /dev/tty.SOC
Jonahs-MacBook-Pro:circuitpython jonahym$
` not here either
Β―_(γ)_/Β―
i;m trying something else 1mo
plz
seperatly does arduino have support for it yet?
Β―_(γ)_/Β―
kk
@meager fog Glad you like the articles. High praise form you.
I am having a similar issue were code works in the REPL but if the
same code is placed in code.py, the MSD and serial are inaccessible
after reset. Using Feather M4 Express and Ethernet FeatherWing with
CircuitPython 4.0.0 Beta 2
Oh, really interesting. Perhaps the Ethernet board takes a little while
before it's ready to communicate. I'll check it out.
@slender iron pr 1536 ok by you?
@tulip sleet yup!
@marble hornet I'm trying to fix safe mode
nice!
yes
i have a secret program that will move main/code.py to a backup
if you ever need it
its in arduinoese
k one min
thank you
So is there a guide to MemoryError issues? Iβm driving 70 neopixels and only have 250 lines of code. Iβm hitting memory errors immediately if i add new code
@wild pasture what board and what version of CircuitPython, and what other libraries are you using besides neopixel?
@meager fog what resistance is the screen for the portal?
@wild pasture this might be useful: https://learn.adafruit.com/circuitpython-essentials/circuitpython-expectations#frequently-asked-questions-19-8
@tulip sleet CPX board, all im importing is time, board, neopixel, random and digitalio. Sorry, i should have mentioned. Iβve searched here and otherwise and didnt see a how-to on memory profiling/issues or code writing tips
what version of CircuitPython?
@tulip sleet i tried the latest stable 3 and the very recent beta 4. I did see that page but was hoping for more tips/how to profile etc. Or even a guide βif you need more than X code, dont even bother, jump straight to c codeβ
did you try 3.1.2, as opposed to 3.1.0? (just making sure)
@tulip sleet yeah, just checked my downloads folder and it was 3.1.2
try brightness=1.0 on the neopixels. Brightness other than 1.0 doubles the neopixel memory. But for 70 neopixels, that's not a huge amount. You could post you code in a gist or upload it here (use the + sign to the left), and we can take a look
I love this little guy btw! I just need to be able to write more code! Background is CS major, ex MS engineer. I did try makecode too but i consistently had crashes with the code it produced
it's very fun!
250 lines is actually getting big. Are you getting the memory error in import or when running?
@tulip sleet yeah i did finally see the brightness tip which helped my initial memory limits. That was buried.
@tulip sleet remember when I thought I fixed my clocks but later still had issues? Well, if I set the GCLK divider to 4 on a SRC of DFLL, I get 12MHz, but if I set it to 1 I get 6MHz
are you sure the bitmask is right?
maybe check the actual bits
not very much
ok, I think I found a bug in startup.c
you mean do i work on our board support pkgs?
pls do file an issue. the samd51 code is pretty new
kk
@meager fog I'd love to use that Arduino sauce, just ran into an issue
oh, someone else found it https://github.com/adafruit/ArduinoCore-samd/issues/88
@marble hornet u need a uf2 right?
yes
you dont have aruino?
ok hold on
okay π
@tulip sleet svd/x reports the division factor of 1
@gilded cradle posting example to set neopixels string based on "cheerlights" website
cheerlights example
settings example
these use the settings.py file to hold "secrets" like passwords/ keys -- for this you only need you ssid and password. it does not use the aio items. Check the pin assignments and number of neopixels.
Do you have an Adafruit IO accout that you can post to? I have an example for that if you want it.
@exotic pumice did you look at the whole register in svd just to make sure it corresponds with the datasheet?
I'm looking at the code autogenerated from the svd now and it looks strange
@tulip sleet, I know you don't read Rust but anyways,
impl<'a> _DIVW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
const MASK: u16 = 65535;
const OFFSET: u8 = 16;
//self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
The commented out line looked strange to me so I commented it out, but it didn't make a difference
neat way of doing it
Thanks @solar whale. I don't think I have an adafruit IO account or at least I've never used it if I do. Let me check...oh I guess I do have one.
otherwise it's the same I think
the C version is
#define GCLK_GENCTRL_DIV(value) (GCLK_GENCTRL_DIV_Msk & ((value) << GCLK_GENCTRL_DIV_Pos))
where mask is 0xffff and pos is 16
@exotic pumice whats the DFLL multiplier value?
0
@gilded cradle np -- I am revising the demo -- will post it after I check it out -- try the cheerlights.
in this and another program, it just crashes after going through a try except
import TG_Display_Emulator as disp, board, time
disp.DISPLAY = board.DISPLAY
disp.WIDTH = 320
disp.HEIGHT = 240
for i in range(255):
try:
disp.rect(i,i,i,i,disp.color(255-i, i//2 * 128, i))
except:
pass
crashes the pyportal
need:
https://github.com/TG-Techie/TG_CircuitPython_Display_Emulator
Ok, I'll try it out.
@exotic pumice in our code is DFLL MUL 1 or 0?
The datasheet says it's a multiplier, and doesn't say what 0 does.
those are for close-loop mode, so they may not do antyhing
ok
I'll double check that it's still 0 but last time you checked
yeah, 4.0.0alpha5
Fields in OSCCTRL DFLLMUL:
MUL: 0x0000 DFLL Multiply Factor
FSTEP: 0x00 Fine Maximum Step
CSTEP: 0x00 Coarse Maximum Step
@exotic pumice the two lines in the rust above. the &= clears the bitfield, and the |= sets it. you need both
you and out an inverse of the mask to clear the bits, and then you or in the bits you want
because the DFLL is in open loop mode, I think all the DFLLMUL values don't matter - it' just trying to output 48 MHz. So you're feeding that into a GCLK, and then dividing?
yeah
are you setting DFFLVAL.COARSE and .FINE? THose are the factory calibration values, so don't change them
I commented out everything that touches the dfll
well, you have to enable it, etc.
actually you don't
DFLLCTRLA.ENABLE ?
DFLL is auto-enabled on 51.
ok
yep, it's on according to svd/x, but I didn't set it
fn set_gclk_divider_and_source(
&mut self,
gclk: ClockGenId,
divider: u16,
src: ClockSource,
improve_duty_cycle: bool,
) {
self.gclk.genctrl[gclk.bits() as usize].write(|w| unsafe {
w.src().bits(src.bits());
w.div().bits(divider);
w.idc().bit(improve_duty_cycle);
w.genen().set_bit();
w.oe().set_bit()
});
self.wait_for_sync();
}
which gclk are u using?
@gilded cradle oops found a cut/paste error in the previous version - if you create a feed named "test" and put your aio username and key in settings.py the script will post an incrementing counter to it.
what does w get bound to in the rust code above? It looks like a smalltalk lambda variable
I don't really know how all that works but the .write() is a closure that takes w and then you do all your write operations on w, it's just like, bitwise or'ing all the stuff
Hey @solar whale , I actually have to get going for a bit. Something came up. I'll give it a try as soon as I'm able to get back online. Thanks
@solar whale can you give me some help with that touch screen lib? i'm not getting good readings
plz
@gilded cradle no rush
@marble hornet I'll try -- what are you getting
@marble hornet are you just using the "simpletest"
@exotic pumice how does configure_glck_divider_and_source() call set_gclk_divider_and_source() ?
it's just a wrapper that returns the output frequency
yes (the text from it exactly)
pub fn configure_gclk_divider_and_source(
&mut self,
gclk: ClockGenId,
divider: u16,
src: ClockSource,
improve_duty_cycle: bool,
) -> Option<GClock> {
let idx = gclk.bits() as usize;
if self.gclks[idx].0 != 0 {
return None;
}
self.state
.set_gclk_divider_and_source(gclk, divider, src, improve_duty_cycle);
let freq: Hertz = match src {
XOSC32K | OSCULP32K => OSC32K_FREQ,
GCLKGEN1 => self.gclks[1],
DFLL => OSC48M_FREQ,
DPLL0 => 120.mhz().into(),
XOSC0 | XOSC1 | GCLKIN | DPLL1 => unimplemented!(),
target_device::gclk::genctrl::SRCR::_Reserved(_) => panic!()
};
self.gclks[idx] = Hertz(freq.0 / divider as u32);
Some(GClock { gclk, freq })
}
}
i'm getting only around 320 abd 197
no matter where you touch?
but no more no less
pretty much yeah every now and then it drop
s
than goe back to that vlaue
@exotic pumice how are you measuring the output freq? I thought you were using something that was only good to 24 MHz?
yeah that's correct
but i know the hardware is right ! because the arduino example shipped with the pyp works
so a divider of one will be unmeasurable by your test equipment
and quite well
you'll probably get weird aliasing results
yeah, I got different weird results in C though
how did you calibrate ur screen?
and a dimmer led
@marble hornet i didn't -- try just getting raw vaules ```import board
import adafruit_touchscreen
These pins are used as both analog and digital! XR and YU must be analog
and digital capable. XL and YD just need to be digital
ts = adafruit_touchscreen.Touchscreen(board.A1, board.A2,
board.A3, board.A4)
while True:
p = ts.touch_point
if p:
print(p)
well... that might be due to something else like some skew setting or something that changes the waveform shape. If you can test the dividers with values you can meausre, and they seem reasoanble, then I think it's the measuring
I'll try a divider of 2
yah try 2,3,4,5,6,7,8 and see if you get results you expect
etc. I know better test equipment is expensive, but maybe it can be borrowed at least for this
trying
divider of 2 gives 3 MHz lol
so on the pyp there are: 'TOUCH_XL', 'TOUCH_XR', 'TOUCH_YD', 'TOUCH_YU'
put them in in that order
@exotic pumice that's still at the limit of your equipment 48/2
I see thin in the middle of my screen ```(31712, 35055, 40447)
(31671, 35031, 40735)
(31639, 35039, 40895)
(31639, 35047, 40927)
(31575, 35063, 41023)
(31567, 34999, 41247)
(31527, 35055, 41407)
(31535, 35055, 41567)
(31511, 35079, 41599)
board.TOUCH_YD, board.TOUCH_YU,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))
while True:
p = ts.touch_point
if p:
time.sleep(.5)
print(p)```
at a corner ```(10855, 11623, 30783)
(10887, 11655, 30175)
(10951, 11711, 29343)
(10992, 11743, 27647)
take out the calibration/size
i'll turn off the things you have turned off
yeah the other values look decent
I could not read te numbers -- do they vary
ok, well, that's a little maddening
@exotic pumice yah so the 24MHz limit is just messing with your conception of the output. what kind of device is that
Smarter Shopping, Better Living! Aliexpress.com
mine vary from 10000 to 50000 across the screen
no
yeah, since that's sampling that will really mess with higher frequencies.
little to none
it was such a stable 6 though lol
The Nyquist reate for 24Mhz sampling is 12MHz, the highest frequency you can accurately measure
this is not anything like a 24Mhz analog scope, which will roll off at higher freqs
@marble hornet hmm -- no idea --- sounds likea hardware issue -- I don't have any information on that board
@exotic pumice you might want to feed the GCLK2 output into another GCLK and divide it down further for easier measuring
then monitor that GCLK and do the mental multiplication
welp, I guess that wraps it up then, onto the next thing, figuring out why my 200ms delay was coming out as 92ms
okay thank you. ood tho that it works well in arduino but not cp
good to know -- then it makes less sense -
did you try using your finger instead of the stylus
hmmm idk ill try switcing them around it's only 4! -1 combinations π
π
i'll look at the schem
also need to know they are correct in pins.c
as @meager fog pointed out -- you will get results as long as they are paired correcly.
hah! take that enable-protected register! i win.
don't mind me. just fighting with proper deinit function π
@solar whale the pin defs are wrong
trying now to fix now
i think
i'm not sure
recompiling
@solar whale you were right
are you getting good results now?
@jerryneedell suggested the pins could be wrong when I told him I was getting reading that didn't change, having corrected the pinout to match the schematic I was given it now works!
used:
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
board.TOUCH_YD, board.TOUCH_YU,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))
while True:
...
yay
alright. tomorrow, double back and re-test M0. then...merge the endless commits that have passed since i last updated this branch. jinx warning: FrequencyIn might be done this week. π΅
- Support both UARTE's on nRF52840.
- Reset UART drivers on restart.
- Use a table for baud rate selection.
- Make sure temp buffer doesn't move.
Slow because I'm taking a normal display via displayio but it runs. I might flip the jumper tommorow to spi
Very nice! Congratulations!
thanks
i;ll need ot branch adn do a diplayio version or switch the portal to spi ** for tommorow
night all
Good Night!
is it normal for dpll0 to only get up to 104MHz instead of 120?
@river quest @meager fog @slender iron please see the vidπ. 6 before this one
Unfortunately, the usb cable that came with my Tenma 72-10405 DMM doesn't seem to be compatible with Linux. I'll have to do some more research on that. But I got a serial to USB adapter (using the PL23030 chipset) off Amazon and am able to use it with the serial (DB9) cable.
I found a unix/linux/macos prgram called QtDMM and after a bit of poking around was able to find some manual settings that worked with my meter.
Probing pads on a running micro:bit
Cool! Blogs like Portable Adafruit.com? And WOW. LADYADA really crammed EVERYTHING in there. There isn't a free pin. Excluding swd
it sounds like we all got a lot done today, pats on the back all 'round
g'night
@TG-Techie you have an old firmware, use this for now
self.ts = adafruit_touchscreen.Touchscreen(microcontroller.pin.PB01, microcontroller.pin.PB08,
microcontroller.pin.PA06, microcontroller.pin.PB00,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))
I think I PRed such, should I have asked first? thank you!
On Tue, Feb 12, 2019 at 11:03 PM ladyada notifications@github.com wrote:
@TG-Techie https://github.com/TG-Techie you have an old firmware, use
this for now
self.ts = adafruit_touchscreen.Touchscreen(microcontroller.pin.PB01,
microcontroller.pin.PB08,
microcontroller.pin.PA06, microcontroller.pin.PB00,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))β
You are receiving this because you were ment...
all good - im just letting u know how to fix asap :)
π
On Tue, Feb 12, 2019 at 11:08 PM ladyada notifications@github.com wrote:
all good - im just letting u know how to fix asap :)
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/1540#issuecomment-463049688,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AldwjKJQ8cIcRIq6sAjuy0v9roWJU6nbks5vM4-5gaJpZM4a4hH1
.
Best of luck tonight, sleep well too
On Tue, Feb 12, 2019 at 11:08 PM TG-Techie tgtechie01@gmail.com wrote:
π
On Tue, Feb 12, 2019 at 11:08 PM ladyada notifications@github.com wrote:
all good - im just letting u know how to fix asap :)
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/1540#issuecomment-463049688,
or mute the thread
<https://github.com/notif...
@exotic pumice note that te DPLL divisor calc is +1:
or if it's the DFLL, surprised it's off by so much, maybe the calibration values are off?
I have seen a lot of jitter in the DFLL on a scope, but the avg was still about 48 MHz
hmm
dunno why they'd be off if you're not setting them
should I try to fix them?
no, I wouldn't change them. Do you have only one sample chip?
hmm, don't know what to say, just maybe double-check that nothing is messing with the factory values on setup
but you said not
there's some calibration stuff in our code but I turned it off
dunno, the samd21 code has some calibration stuff I never looked into, I just turned it off for 51
looks like it's just reading it
yeah
actually, setting it here, https://github.com/atsamd-rs/atsamd/blob/d453ca895b84e5db209129ea9e2d467814465d34/hal/src/clock.rs#L440
but just the same value it read back or some errata value
why is fine 0x1ff? Need to look at that.
that's for '21 idk
not my problem lol
Fields in OSCCTRL DFLLVAL:
FINE: 0x80 Fine Value
COARSE: 0x23 Coarse Value
DIFF: 0x0000 Multiplication Ratio Difference
so it's automatic
not exactly sure what this implies. I think we have USB CRM turned on
yours was afaik
i dunno. I'm fading but maybe I'll measure our DFLL freq some time
ok
good night and good luck
turning it on had no effect for me
good night
oh I missed the mode bit
yeh, still 888.9
lol
that's cool
anywho, 4.0.0beta2 has usbcrm off
(gdb) svd/x OSCCTRL DFLLCTRLB
Fields in OSCCTRL DFLLCTRLB:
MODE: 0x0 Operating Mode Selection
STABLE: 0x0 Stable DFLL Frequency
LLAW: 0x0 Lose Lock After Wake
USBCRM: 0x0 USB Clock Recovery Mode
CCDIS: 0x0 Chill Cycle Disable
QLDIS: 0x0 Quick Lock Disable
BPLCKC: 0x0 Bypass Coarse Lock
WAITLOCK: 0x0 Wait Lock
Interesting, I get the proper 1MHz if I run my atmel studio project
so there must be something messing with it
is it the on demand bit messing me up?
nope
fixed!
I'm waiting for addition hardware to come in. Should be a couple days\
@solar basin don't worry about it I just fixed sercoms!
the samd51 pr should be pretty much ready to go in a bit
anyone at adafruit every thought about also seeing if erlang ? It was created by Ericsson and made to work with multi cores.
incomplete sentences... thinking to fast and never listened to by english teacher to check twice. Check to see if erlang would work on todays multicore chips.. It will cork but what about space requirements.
@noble mango microcontrollers are typically single core
I did not have any luck changing the settings of the flash chip to get the CIRCUITPY drive to show up.
I tried a number of different configurations based on the datasheet, however, none worked.
#define ST26VF016B {\
.total_size = (1 << 21), /* 2 MiB */ \
.start_up_time_us = 300, \
.manufacturer_id = 0xbf, \
.memory_type = 0x26, \
.capacity = 0x41, \
.max_clock_speed_mhz = 104, \
.quad_enable_bit_mask = 0x00, \
.has_sector_protection = false, ...
@exotic pumice great! so tell us what was wrong when you're around again
I'm trying to get it working with spi I switched the mode jumper to 3v3
and tried the TFT_RS to SCK jumper in both positions but no luck. Any
special sauce I'm missing in my attempt?
On Tue, Feb 12, 2019 at 11:09 PM TG-Techie tgtechie01@gmail.com wrote:
Best of luck tonight, sleep well too
On Tue, Feb 12, 2019 at 11:08 PM TG-Techie tgtechie01@gmail.com wrote:
π
On Tue, Feb 12, 2019 at 11:08 PM ladyada notifications@github.com
wrote:all good - im just letti...
I'm trying to get the pyportal working with spi I switched the mode jumper to 3v3 and tried the TFT_RS to SCK jumper in both positions but no luck. Any special sauce I'm missing in my attempt?
using:
With these rules, it will still be somewhat tricky to debug a data-logging app or similar when USB is connected. You'd still need something in boot.py to enable/disable writing until you got it all debugged.
When your code isn't running and the computer ejects the drive it will reload your code with the ability for CircuitPython to write to the file system. The host will not see the drive until the user code stops. At that point the drive will mount on the computer as writable again.
...
@ATMakersBill Hi BIll, closing this for now. If this is still mysterious, let us know.
could it write to internal flash then move to the spiflash when next unmounted or reset?
and it wiped itself a few times today
On Wed, Feb 13, 2019 at 8:15 AM TG-Techie tgtechie01@gmail.com wrote:
I'm trying to get it working with spi I switched the mode jumper to 3v3
and tried the TFT_RS to SCK jumper in both positions but no luck. Any
special sauce I'm missing in my attempt?On Tue, Feb 12, 2019 at 11:09 PM TG-Techie tgtechie01@gmail.com wrote:
Best of luck tonight, sleep well too
On Tue, Feb 12, 2019 at 11:08 PM TG-Techie tgtechie01@gmail.com wrot...
As of 1a6ad20. The CTRLA and CTRLB register values are not completely set up properly, probably.
Check https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/asf4_conf/samd21/hpl_sercom_config.h and https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/asf4_conf/samd51/hpl_sercom_config.h for other field values.
https://github.com/adafruit/ArduinoCore-samd/blob/master/cores/arduino/SERCOM.cpp might be helpful also.
I will work on this now since it's still early Pacific time.
@gilded cradle have you tried chaning the cheerlight setting? just send a tweet to #cheerlights blue or any color you want see https://cheerlights.com/cheerlights-api/
I didn't, but saw others change it
Thanks for testing the examples -- glad it is working for you.
You're welcome. It was fun.
the esp32spi is so much more reliable than the AT (UART) -- far fewer errors and retries.
Yeah, I figured, which is why I wanted to test that one.
if i show a group then change a group it will change the screen on the next refresh?
Mask and replace bitfields in busio.UART constructor.
Still 192 bytes free in Metro M0 French build.
I tried the same thing using bitfield setting:
sercom->USART.CTRLA.bit.TXPO = tx_pad / 2;
sercom->USART.CTRLA.bit.RXPO = rx_pad;
sercom->USART.CTRLA.bit.FORM = parity == PARITY_NONE ? 0 : 1;
// Enable tx and/or rx based on whether the pins were specified.
// CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that.
...
@tulip sleet, this is the issue that messed me up for 2 months
kind of infuriating
what's the issue? Did you have the wrong GCLK index?
have a look at TC0 and TC1
π€¦