Go to advanced search

by pic0
Wed Jun 23, 2021 7:23 pm
Forum: SDK
Topic: [SOLVED] Problem filling my array [BUT WHY?]
Replies: 6
Views: 540

Re: [SOLVED] Problem filling my array [BUT WHY?]

Sure?

Starting with count=0 the first assignment will be

Code: Select all

 	buf[0] |= data << 4;  // add top nibble
and the second after incrementing count will be

Code: Select all

	buf[0] = data;   // save bottom nibble
and overwrite the previous one. So in my opinion the if condition needs to be inverted
by pic0
Wed Jun 23, 2021 2:10 pm
Forum: General
Topic: GPIO Interrupts.
Replies: 1
Views: 185

Re: GPIO Interrupts.

I think so. You could prove it by disabling the interrupt for the time while you want to send your data (and clear it before enabling).
by pic0
Sat Jun 19, 2021 7:29 pm
Forum: General
Topic: PIO pins
Replies: 4
Views: 298

Re: PIO pins

Seems I used an older version in my download folder. But also in this one it is available. See page 345. Just search for "remainder are"
by pic0
Sat Jun 19, 2021 10:46 am
Forum: SDK
Topic: Raspberry Pi Pico using C/C++ SDK
Replies: 11
Views: 961

Re: Raspberry Pi Pico using C/C++ SDK

Hi,
hesam_m wrote:
Sat Jun 19, 2021 6:05 am
1) is there any way to see the consumed memory and usage statistic (Flash, SRAM)?
See here.
by pic0
Sat Jun 19, 2021 7:08 am
Forum: General
Topic: PIO pins
Replies: 4
Views: 298

Re: PIO pins

Hi,

On page 337 of the datasheet I found the following sentence:
A 32-bit value is written to Destination: the lower Bit count bits come from the OSR, and the remainder are zeroes.
So in my opinion the datasheet is clear about the behavior.
by pic0
Sun Jun 06, 2021 7:42 am
Forum: General
Topic: Where can I download uf2 file for picoprobe
Replies: 2
Views: 220

Re: Where can I download uf2 file for picoprobe

Click here.
Select the box "About Raspberry Pi Pico".
Scroll down to the utilities, the you find "Debugging using another Raspberry Pi Pico"
by pic0
Fri Jun 04, 2021 1:25 pm
Forum: SDK
Topic: Upcoming release
Replies: 17
Views: 1014

Re: Upcoming release

Thank you, it works like a charme.
by pic0
Fri Jun 04, 2021 10:20 am
Forum: SDK
Topic: Upcoming release
Replies: 17
Views: 1014

Re: Upcoming release

Hi, SDK 1.2.0 was just released. https://github.com/raspberrypi/pico-sdk/releases/tag/1.2.0 I want to add a version check so the build process can clearly state if the SDK version is to old and do not rely on errors/warnings from different function definitions. My approach would be the following, is...
by pic0
Thu Jun 03, 2021 7:49 am
Forum: SDK
Topic: How to determine if a PIO is idle?
Replies: 6
Views: 307

Re: How to determine if a PIO is idle?

If you know that the PIO is idle by waiting on the fifo, you could just check the fifo status.
by pic0
Wed Jun 02, 2021 9:50 pm
Forum: General
Topic: SPI for >16 bits?
Replies: 9
Views: 658

Re: SPI for >16 bits?

But a reasonable alternative can also be implemented in inexpensive hardware I can only repeat myself. The PIO, which is already onboard of the RP2040, should be able to do this. I am altogether new to the Pico, and have a project in mind for which I hope to use it. May I ask for the reasons to pic...
by pic0
Wed Jun 02, 2021 6:18 pm
Forum: General
Topic: Using an MCP23017 with a Pi Pico [SOLVED]
Replies: 3
Views: 428

Re: Using an MCP23017 with a Pi Pico

Hi,
scotty101 wrote:
Wed Jun 02, 2021 3:14 pm
The source code for the MicroPython port indicates that the internal pull up resistors configured when you use machine.I2C so external ones shouldn't be needed.
As stated here the internal pull ups are vrery weak, so you should add external resistors.
by pic0
Wed Jun 02, 2021 2:42 pm
Forum: General
Topic: SPI for >16 bits?
Replies: 9
Views: 658

Re: SPI for >16 bits?

Hi, as horuable mentions, use PIO to implement your "simple hardware implementation of the 20 bit shift register". Do not mix it up with the GPIO pins (you wrote "manually controlling the PIO pin"). The PIO is a peripheral which allows you to implement dedicated HW interfaces whi...
by pic0
Tue Jun 01, 2021 6:23 pm
Forum: SDK
Topic: General packing of structs
Replies: 5
Views: 311

Re: General packing of structs

Thank you, I will think of it.
by pic0
Tue Jun 01, 2021 4:19 pm
Forum: SDK
Topic: General packing of structs
Replies: 5
Views: 311

Re: General packing of structs

Thank you, but where I have to put in this switch?
by pic0
Tue Jun 01, 2021 3:52 pm
Forum: SDK
Topic: General packing of structs
Replies: 5
Views: 311

General packing of structs

Hi, I have encountered that the following definition of the struct t_macro_para leads to a wrong size: typedef union { uint32_t as_uint32; int32_t as_int32; uint8_t as_uint8[4]; // avr uses little endian - LSB is uint8[0] int8_t as_int8[4]; uint16_t as_uint16[2]; // avr uses little endian - LSB is u...
by pic0
Fri May 28, 2021 1:01 pm
Forum: SDK
Topic: Race condition in pio_sm_drain_tx_fifo()?
Replies: 0
Views: 132

Race condition in pio_sm_drain_tx_fifo()?

Hi, While investigating if I shall use pio_sm_drain_tx_fifo() or pio_sm_clear_fifos() to clear the TX fifo of a statemachine, I have the impression that pio_sm_drain_tx_fifo() might have a side effect when a race condition applies. This function is implemented in V1.1.2: void pio_sm_drain_tx_fifo(PI...
by pic0
Tue May 25, 2021 10:21 pm
Forum: SDK
Topic: pio interrupts
Replies: 6
Views: 704

Re: pio interrupts, my solution

Hi, (please use the "Code" tag, it helps to read the code much easier) #define REGISTER_32(ADDRESS) (*((volatile unsigned int *)(ADDRESS))) #define IRQ0_INTE REGISTER_32(PIO0_BASE + 0x12c) IRQ0_INTE |= 0x001; //bit0 for interrupt on SM0_RXNEMPTY I used the following one for pio0, I think i...
by pic0
Fri May 21, 2021 11:58 am
Forum: SDK
Topic: Setting board in Visual Studio Code
Replies: 3
Views: 291

Re: Setting board in Visual Studio Code

How do I set the board type in Visual Studio code. In appendix D of the STC manual is says to pass it as a parameter to cmake but how do I do this in Visual Studio code.. So you are not using the Pico board but a different board. If I understood it correctly you can add a line in CMakeLists.txt (I ...
by pic0
Fri May 14, 2021 2:28 pm
Forum: SDK
Topic: Selective execute from RAM
Replies: 3
Views: 269

Re: Selective execute from RAM

I have a question to move functions to execute from RAM: Is it, from performance point of view, better to move short functions (like interrupt service routines), which are definitely called from one core only, to the scratch X or scratch Y (depending on the core)? I have seen that the call stack of ...
by pic0
Wed May 12, 2021 12:58 pm
Forum: SDK
Topic: How to use flash as an EEPROM replacement?
Replies: 5
Views: 337

Re: How to use flash as an EEPROM replacement?

kilograham wrote:
Wed May 12, 2021 12:55 pm
... or make sure the IRQ handler runs from flash
Seems to be a typo: Should be "runs from RAM" in my opinion.
by pic0
Wed May 12, 2021 9:42 am
Forum: SDK
Topic: [SOLVED] Building for board with 16MB flash but linker expects 2MB maximum
Replies: 5
Views: 310

Re: Building for board with 16MB flash but linker expects 2MB maximum

You can copy that file to your project directory and reference it in cmake. With this you can have project related configurations.
by pic0
Mon May 03, 2021 8:45 pm
Forum: General
Topic: Not consitant PWM signal.
Replies: 28
Views: 940

Re: Not consitant PWM signal.

If you have several IRQs (including the ones from the SDK), you should consider setting the correct priorities of them. So I would set in your case the priority of PWM_IRQ_WRAP to the highest (0) to ensure that it always fires as quick as possible independent to other IRQs. Another possibility would...
by pic0
Sun May 02, 2021 3:55 pm
Forum: General
Topic: Not consitant PWM signal.
Replies: 28
Views: 940

Re: Not consitant PWM signal.

It is reporting cases with >1 only.

As mentioned before, I assume there is an interrupt service routine called and if this happens between these two commands it takes longer.
by pic0
Sat May 01, 2021 7:21 pm
Forum: General
Topic: Not consitant PWM signal.
Replies: 28
Views: 940

Re: Not consitant PWM signal.

I think there is an interrupt consuming some time.

Don't know how you have setup your PWM, but if it is the HW PWM, it shouldn't be affected by any interrupt.
by pic0
Wed Apr 28, 2021 9:53 pm
Forum: SDK
Topic: Can't seem to store on flash
Replies: 21
Views: 710

Re: Can't seem to store on flash

Have you tried to read out the flash at ADDRESS to see what is compared? In my opinion you need to erase before you program the flash as programming is usually writing the 0-bits you want to have, but if you want to write bits to value 1 it does not work. So you would need to have a read-modify-writ...

Go to advanced search