• 0 Votes
    7 Posts
    99 Views
    D
    @robert-hh Thanks for your reply. Yes "P10" is connected to the Gnd by a simple push button. But I had no idea that the system was logging an interrupt every time I went to Gnd. Question: what solution to adopt? - debouncing hardware or software? What is the solution adopted on the expansion board 3.1 for the "S1" button ? Indeed I only use uart reception. it works great, however i will heed your suggestion of external resistance.
  • UART Pins for Pytrack with WiPy3

    WiPy 2&3 uart wipy pytrack pin
    7
    0 Votes
    7 Posts
    530 Views
    E
    @soopieng said in UART Pins for Pytrack with WiPy3: @Erick-Falcon Hi, I am looking for similar solution as well. May I know what do you mean on making a shield on your solution? I am planning to use FiPy on Pytrack, and i need I2C and UART features from FiPy as well. There is a external IO header on Pytrack board, with some GPIO pins and power signal available. Can we configure one pair of the GPIO as UART for my purpose? or the external IO header is used for other application? hi, I new using these devices. I´ve been work with this around three months. when I said "make a shied" I mean make a pcb what allow you to use fipy, pytrack and sensors, without need to solder extra pins on pytrack. I am testing to see how viable and efficient this solution is.
  • 0 Votes
    5 Posts
    1k Views
    A
    Ah ha. I was using the wrong interrupt script. This is the correct working code for an accelerometer interrupt (P13) of machine.deepsleep(): import machine machine.pin_deepsleep_wakeup(['P13'], machine.WAKEUP_ANY_HIGH, False) machine.deepsleep(10*1000) So for pin interrupts there is a callback() function to create interrupts of active and sleep modes but the pin_deepsleep_wakeup() is needed to interrupt deep sleep (is that what you meant by "wake-on-pin" @jcaron?). There is no interrupt handler for pin_deepsleep_wakeup() because the working memory is cleared after deep sleep (as mentioned by @jcaron below). @jcaron I had tested my interrupt handler without sleep and it did work. In my main.py I had the following script to test that it woke from deep sleep and ran main.py. import pycom import utime pycom.heartbeat(False) #turn off LED pycom.rgbled(0xFF0000) #red LED utime.sleep(2) pycom.heartbeat(False) #turn off LED
  • WiPy ADC

    Discussion wipy adc pin
    5
    0 Votes
    5 Posts
    1k Views
    robert-hhR
    @b_rubble Here is a sample script using the ADS7818 with SPI: # Drive the ADS7818 ADC using SPI # Connections: # xxPy | ADS7818 # -----|------- # P10 | CLK # P11 | CONV # P14 | DATA # from machine import SPI, Pin from ubinascii import hexlify spi = SPI(0, SPI.MASTER, baudrate=4000000, polarity=1, phase=1, bits=16) buf = bytearray(2) vref = 2.493 # measured at the ADS7818 while True: # start a conversion and get the result back spi.write_readinto(b"\xe0\x00", buf) # extract the raw ADC value and derive Voltage value = ((buf[0] << 8) | buf[1]) & 0xfff volt = 2.0 * vref * value / 4096 print(hexlify(buf), value, volt) res= input("Next: ") if res == "q": break The conversion and reading back is done within the single spi.write_readinto() call. It is then easy to embed that in a small class. Note: Since the ADS7818 runs at 5V, insert a resistor of 3.3k to 10k into the data line back into the ESP32 to limit the current into the ESD diodes.
  • 0 Votes
    4 Posts
    713 Views
    robert-hhR
    @radec Maybe also a wrong setting/connection of the multimeter. Many of them have separate ports for current and all other signals.
  • 0 Votes
    5 Posts
    1k Views
    A
    @jmarcelino Oh. Yes I was using machine.deepsleep(). Now it works. Thank you for your help.
  • Pin (internal) resistance

    Expansion Board pin resistance voltage dac pull
    4
    0 Votes
    4 Posts
    824 Views
    T
    @jmarcelino It's without ADC (maybe I need to do it with an ADC). It's just a pin defined as input like : pin = Pin('P19', mode = Pin.IN, pull = Pin.PULL_DOWN) pin.value() which gives me a simple 0 or 1 (I guess 1 when the voltage is at least half of the 3v3?). I will check what the ADC version gives me next week (I have no module with me unfortunately this week-end). It might give me the reading I want. Also thanks Robert for your answer, I will have a look into the pin sheets of the module.
  • Using an IO pin interrupt + Alarm

    MicroPython lopy pytrack pin interrupt alarm
    3
    0 Votes
    3 Posts
    2k Views
    K
    @gregcope Wondering if it might be useful to simply start a thread for everything. If I spawn an alarm in one thread, an interrupt in another and so on, I may be able to avoid the issue of blocking. The major issue is that since some of the functions I need to run can take 20 seconds or so, I don't want one to block another from running and have to wait a whole other interval for the respective functions to be run. Especially since there are multiple interrupts and one or two alarms. So would simply running a function that spawns an alarm within a separate thread make it so that the alarm itself is contained in that thread indefinitely?
  • 1 Votes
    1 Posts
    641 Views
    No one has replied
  • from machine import Pin not working in WiPy 2.0

    WiPy 2&3 wipy2.0 pin
    6
    0 Votes
    6 Posts
    2k Views
    robert-hhR
    @seb Thanks for pointing that out.
  • Pysense wake on pin enhancements

    Enhancements pysense wake up pin pir wake on pin
    1
    0 Votes
    1 Posts
    772 Views
    No one has replied
  • pycom.nvs_get...

    LoPy pin lopy
    2
    0 Votes
    2 Posts
    853 Views
    B
    have you tried something like this? power = pycom.nvs_get('POWER') if not power: print(".........
  • 0 Votes
    4 Posts
    2k Views
    L
    @soren simpy use BSS138 to level shifting or bigger model 2N7000
  • High GPIO Pins

    Expansion Board pin gpio sipy
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @bradnz So you want to tell, if the voltage of the LiPo battery is above 2.5 V. That should be done using the ADC, for various reasons. a) The value at which a digital input switches from HIGH to LOW is not well defined and not stable. It is somewhere between 0.75 * Vdd and 0.25 * Vdd b) You have to check the value of the variable charger anyhow, so instead of doing that you could also read an ADC value. If you want to have that done in an interrupt fashion, you can set-up a timer interrup which reads the ADC,
  • 1 Votes
    2 Posts
    2k Views
    L
    @reader-uk said in VLC Radio - IP remote control via Wipy 2.0: Originally I tried keeping this socket open and forced open. This was problematic and found its just as quick and efficient (and correct?) to open the socket, send command then close the socket. If it work then this should not be modified ;-) You can try to leave it open e.g. for 10 minutes and close if no command to send. Something like session timeout. Nice project :)
  • Pin: max sink current

    Getting Started hardware pin open drain sipy power
    4
    0 Votes
    4 Posts
    2k Views
    robert-hhR
    @littlebat It said max current 40 mA in the maximum ratings sections, but I myself did not trust that anyhow. Even if, the output levels then are somewhat off GND/Vcc. So 12 mA sounds much more convenient.
  • External IO Header connections

    Moved Comments & Feedback pytrack pin
    9
    2 Votes
    9 Posts
    3k Views
    G
    @jcaron Ahhhhhhh. Thanks. I have been using this; https://pycom.io/product/pytrack/ "PIN OUT" link
  • 5V Pin or VIN only ?

    Expansion Board expansion board voltage pin
    5
    0 Votes
    5 Posts
    3k Views
    B
    Just tried to power my sensor as you said and it is indeed working, are there any risks of doing so ?