Search found 12 matches

by paulhun
Tue Nov 27, 2018 9:34 am
Forum: General Discussion
Topic: Software Interrupts
Replies: 2
Views: 6878

Re: Software Interrupts

I'm writing an application to monitor a stepper motor and it's steps. I read the steps in and check the motor has moved. Cycle times can be as little as 400us depending on speed but in general 600us ( I tend to run the machine slower rather than faster) From guidance given to-date I can successfully...
by paulhun
Mon Nov 26, 2018 3:48 pm
Forum: General Discussion
Topic: Software Interrupts
Replies: 2
Views: 6878

Software Interrupts

Can anyone please help me with example code for a software generated interrupt. I suspect it will require registration of an interrupt handler, and an handler, perhaps something in the order of below. I have a number of tasks running on both cores and want to be able to 'check and compare' when the ...
by paulhun
Sun Sep 23, 2018 5:16 pm
Forum: General Discussion
Topic: Range Extension of the Pulse Counter (PCNT)
Replies: 4
Views: 7197

Re: Range Extension of the Pulse Counter (PCNT)

Hi Deouss, are you able to offer any example code for your suggestion?
I've gone round in circles for a few times with this but 'nothing has clicked' - I'm sure I'm not seeing the wood for the trees

thanks in advance Paul
by paulhun
Sun Sep 16, 2018 7:52 am
Forum: ESP-IDF
Topic: My long path to configuring the RMT and PCNT to share GPIO
Replies: 14
Views: 19515

Re: My long path to configuring the RMT and PCNT to share GPIO

My code #define sVersion 1.01 /** * Brief: * This test code is used to monitor steps received (destined for a step motor) and checks an encoder for movement. * * GPIO status: * GPIO16: output * GPIO17: output * GPIO18: output * GPIO19: output * GPIO4: input, RMT, steps in * GPIO5: input, PCNT, encod...
by paulhun
Sat Sep 15, 2018 3:25 pm
Forum: ESP-IDF
Topic: My long path to configuring the RMT and PCNT to share GPIO
Replies: 14
Views: 19515

Re: My long path to configuring the RMT and PCNT to share GPIO

Hi, ESP_Angus many thanks for your reply. I’ve switched to RMT for input step capture and brought forward some of the various functions. My issue with the receive ISR handler function timing out after 5 seconds was due to xRingbufferReceive() not blocking correctly, once I changed to xRingbufferRece...
by paulhun
Mon Sep 03, 2018 6:18 pm
Forum: ESP-IDF
Topic: My long path to configuring the RMT and PCNT to share GPIO
Replies: 14
Views: 19515

Re: My long path to configuring the RMT and PCNT to share GPIO

Well I've sorted how to do this. PCNT works well to capture the encoder inputs and RMT (receive) is almost there. RMT (receive) will count the input pulses without loss, but, when there has been a period of inactivity for between 5/6 seconds it becomes inactive. I can only getting working again by r...
by paulhun
Mon Sep 03, 2018 5:49 pm
Forum: ESP-IDF
Topic: RMT Receive - Inactive after 6 seconds
Replies: 0
Views: 2366

RMT Receive - Inactive after 6 seconds

I'm using the RMT module to count input pulses, it works well except when there is a break between pulses of more than 6 seconds. In other words, I'm counting pulses that are sent to a stepper driver, so they are received as and when generated. When RMT receives an input pulse it's counted and gener...
by paulhun
Fri Aug 31, 2018 1:13 pm
Forum: General Discussion
Topic: RMT Receive ISR handler
Replies: 2
Views: 4075

Re: RMT Receive ISR handler

These are the basic code elements I tried but without any success /* RMT receiver */ #define RMT_RX_ACTIVE_LEVEL 1 // Data bit is active high #define RMT_RX_CHANNEL 0 // RMT channel for receiver #define RMT_RX_GPIO_NUM GPIO_NUM_4 // GPIO number for receiver #define RMT_CLK_DIV 100 // RMT counter clo...
by paulhun
Fri Aug 31, 2018 10:49 am
Forum: General Discussion
Topic: RMT Receive ISR handler
Replies: 2
Views: 4075

RMT Receive ISR handler

Hi, Can anyone please point me to / or offer and example of how to associate an ISR handler to the RMT receive element. I'm looking for when the RMT receiver has finished receiving a signal to be able to do.... when the interrupt fires. Triggered on RMT_CHn_RX_END_INT: Triggered when the receiver ha...
by paulhun
Fri Aug 31, 2018 10:10 am
Forum: ESP-IDF
Topic: My long path to configuring the RMT and PCNT to share GPIO
Replies: 14
Views: 19515

Re: My long path to configuring the RMT and PCNT to share GPIO

Thanks Deouss, clarkster for the heads up. PCNT works really well for capturing my encoder inputs as do RMT for the step pulses - no stuttering / latency issues. But, I need to know when a step pulses arrives which direction the stepper motor is moving in, in other words, on a step input I need to k...