PYBOARD V1.0 Loading CircuitPython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hello

I have a PYboard 1.0. Trying to load CircuitPython on it. It came with Micropython naturally.

I have tried several ways as its not a easy drop into the virtual drive unlike newer devices.

I have tried the DFUseDemo. It only likes DFU format files. I have tried converting the CP Bin file. (Using the DFU file manager.)
No luck. Tried dfu-util to flash but I could not get it to build.
Then I tried STM Cube Programmer. It takes the bin file nicely. It seems to know to start at 0x8000000 etc. Checksum OK.
Erases, verifies. All good. After reboot, board is bricked. No COM port. No REPL. No FS. I made a hex backup of the existing Micropython load and was able to put that back. Un-bricked.

Maybe the V1.0 is not supported?
Using Windows 10. CircuitPython 6.2.0 Bin file. I have successfully built ESP chips and others to CP.

Thanks
Dave

User avatar
mikeysklar
 
Posts: 13823
Joined: Mon Aug 01, 2016 8:10 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by mikeysklar »

I think you might of hit on it. I'm not seeing signs of support for the PyBoards 1.0 on our site only v1.1. Did you purchase this board from us? I was under the impression we started selling with the v1.1.

https://www.adafruit.com/product/2390
https://circuitpython.org/board/pyboard_v11/

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hi.

Yes. Purchased from Adafruit. (ORDER #708249-1611206920 February 14, 2015 )
Oh well. I guess its too old to put too much effort into. I understand that.

I am testing the Teensy 4.1. (as I need a fast board for a project.)
And I see that CircuitPython won't do PWM on it. (Arduino IDE, C, C++ work fine with PWM.)

Darn it. Maybe I will send a note to Scott about it. He seems to have so much to do already.

Thanks for your response.
Dave

User avatar
mikeysklar
 
Posts: 13823
Joined: Mon Aug 01, 2016 8:10 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by mikeysklar »

Actually I thought there was basic PWM support for the Teensy as of April of this year. Please let me know if I am incorrect. I know it took forever. Was it PWMout you were intested in?

https://github.com/adafruit/circuitpython/pull/4530

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hi.

I don't think that is for the Teensy 4.1. Searching the net. Someone sold a board on Tindie.

I just tried that example and on pin 13. I get

Code: Select all

main.py output:
Traceback (most recent call last):
File "main.py", line 8, in <module>
ValueError: Invalid pin
On pin 9 I get:

Code: Select all

main.py output:
pwm: 0x403e0000, sum 2, chan 0, mux 2
Code stopped by auto-reload.
soft reboot
Line 8:

Code: Select all

p = pwmio.PWMOut(board.D13, frequency=1_000_000, variable_frequency=True)
p.duty_cycle = 32868

Thanks for checking.
Dave

User avatar
mikeysklar
 
Posts: 13823
Joined: Mon Aug 01, 2016 8:10 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by mikeysklar »

@Dave,

The Teensy 4.1 appears to be using a mix of FlexPWM and QuadTimers. Your example being tested on D13 would fall in the quadtimer realm which is unsupported. I'm under the impression that the FlexPWM pins should work at this point with basic PWM functionality.
5E938CB9-E529-48DC-9B1A-57BBDD7884D3.jpeg
5E938CB9-E529-48DC-9B1A-57BBDD7884D3.jpeg (507.76 KiB) Viewed 357 times
https://forum.pjrc.com/threads/62007-Te ... 13-Invalid

https://www.pjrc.com/teensy/td_pulse.html

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hello.

The pin 13 was in the example you sent me. I tried a few other pins (0 to 9) and I can't get an LED to dim.
Tried many frequencies and duty cycles. Maybe my code is faulty.

Some of the links you sent are for other Teensy boards. And with Arduino. PWM works with Arduino. (C, C++)

Please send me a test script in CircuitPython and I will run it on a few pins on my Teensy 4.1.

Thanks
Dave

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by tannewt »

Dave,
Please post your full code. It should work on pins that don't produce an error. Pin 9 looks like it worked but then a file write triggered a reload.
~Scott

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hi Scott.

I can't find the code I used. But I tested lots of pins as I see there are different types. (FlexPWM, QuadTimer)
I kept getting errors. Although the script was running. Text output after starting was "pwm: 0x403e0000, sum 2, chan 0, mux 2."
I could see no frequency on the pin under test. This microcontroller is very capable. PWM works great in C, C++.

Send me some code and I will try it. I am just flashing LED's. Not anything high frequency.

I watch your DeepDive every week and see that you have a long list of things to do.

Thanks
Dave

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Found some code I tried.

Code: Select all

import pwmio
import board
import time

#First test
for freq in range(1000, 1000000, 1000 ):
    p = pwmio.PWMOut(board.D0, frequency=freq, variable_frequency=True)
    p.duty_cycle = 0
    time.sleep(.01)
    print("freq=:",freq)
    
# Second test
for duty in range(50, 32000, 500):
    p = pwmio.PWMOut(board.D0, frequency=5000, variable_frequency=False)
    p.duty_cycle = duty
    time.sleep(.01)
    print("duty=:",duty)


User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by tannewt »

Thanks! Let's try something simpler:

Code: Select all

import pwmio
import board
import time

p = pwmio.PWMOut(board.D0, frequency=5000, variable_frequency=True, duty_cycle=2**15)
time.sleep(120)
This should do a 5khz square wave with 50% duty cycle.

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hi Scott
Tried. No output.
Tried 1024 to 65536 increments of 4096 for duty cycle.
Tried different frequencies too.
Tried different pins. Pins 0-9,22,23,24,25,28,29,33 the REPL puts out that diagnostic data. (pwm: 0x403dc000, sum 1, chan 2, mux 4)
Other pins the REPL puts out (Traceback (most recent call last): File "main.py", line 6, in <module> ValueError: Invalid pin)
So CP likes the FlexPWM pins. And not the QuadTimer pins.

Dave

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Scott

Here is the Arduino IDE program that I used to test PWM with.

Dave

Code: Select all

/* 
   PWM Teensy 4.1 tests
   Tests work on all PWM pins
*/

const int Thepin = 19;      // set the the pin to test with

void setup()
{                
  pinMode(Thepin, OUTPUT);  // set the pin output
  analogWriteFrequency(Thepin, 15000); // Teensy 4.1 pin 19 to 15 kHz
}

void loop()                     
{
    analogWrite(Thepin, 250);   // Pin and intensity 
    delay(2000);
    analogWrite(Thepin, 20);
    delay(2000);
}

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by tannewt »

Please file an issue: https://github.com/adafruit/circuitpyth ... new/choose

It should be working but apparently was broken.

User avatar
daveshome
 
Posts: 11
Joined: Wed Jun 05, 2013 6:55 pm

Re: PYBOARD V1.0 Loading CircuitPython

Post by daveshome »

Hi Scott
Ok. Posted a bug report. (#4841)
Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”