Search found 12 matches

by pirvcb
Tue Apr 27, 2021 12:53 am
Forum: Flowcode V8
Topic: AVR error incrementing unsigned long variable inside interrupt
Replies: 2
Views: 8516

Re: AVR error incrementing unsigned long variable inside interrupt

I finally found the problem. In next days i'll post examples for wrong and solutin scenarios. Thnks anyway!
by pirvcb
Fri Apr 23, 2021 12:38 am
Forum: Flowcode V8
Topic: AVR error incrementing unsigned long variable inside interrupt
Replies: 2
Views: 8516

AVR error incrementing unsigned long variable inside interrupt

Hello there. I cant solve this error. Incrementing an unsigned long variable inside a timer interrupt (atmega2560), when it reaches the border limit of 0xFF, at the next step, 0x100, it gets corrupted. Tried with C icon and declred it in supplementary code as VOLATILE but no way. Tried also to under...
by pirvcb
Fri Apr 02, 2021 11:40 am
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

ABOUT ERRATIC BEHAVOIR as i wrote in previous post.... The better soltion that i had found solution is attached here. In the ERRATIC CORRECTED snippet, things was ok on AT328P but again erratic in mega 2560. The Macro Component TIMER inside flowcode works ok but is cpu angry, so seems ok if you need...
by pirvcb
Thu Apr 01, 2021 2:24 pm
Forum: Flowcode V8
Topic: Driving HT16K33 4 digits I2C module example
Replies: 0
Views: 53454

Driving HT16K33 4 digits I2C module example

I managed to adapt a snippet posted by Benj in an older post to easy drive the module linked. Settings are for mega2560 To anyone goes in same trouble.... https://it.aliexpress.com/item/4000148474491.html?spm=a2g0o.productlist.0.0.3aa27034pLvCiU&algo_pvid=7cda5299-17c0-46a6-927e-f0de34769e49&algo_ex...
by pirvcb
Thu Apr 01, 2021 2:10 pm
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

Putting pullup resistors on the mcu card soplves partially the fault by unaspected disconnection. Anyway, if for some event, the Holtek device can't receive the waited ACK by the mcu, it remains with a line LOW, and this stops again the MCU. One solution, could be set a flag before and resetting it ...
by pirvcb
Fri Mar 12, 2021 5:03 pm
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

FANTASTIC!
I'll try as soon as possible and i'll report here.
Thank you!
by pirvcb
Fri Mar 12, 2021 3:20 pm
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

Well, fixed by myself the second problem. Adding a variable inside the interrupt and copy the value of the incremented variable in it fix the erratic behavoir.
Attached.

The first problem is still up here....
by pirvcb
Fri Mar 12, 2021 12:39 pm
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

Here the sample code. When HK Macro icon is disabled it works, blinking Port_B led. In real hardware, if HK controller gets disconnected, the code execution looks up. Also, there is another little problem. As you can see, i have created a time base toggling the variable tick inside an interrupput an...
by pirvcb
Fri Mar 12, 2021 11:33 am
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

Re: HT16K33 fault stops program execution

Thanks for your reply. WhatchDog is not a solution in my case. I dont need reboot the micro, i have to step over, going on with the code.
ATMEGA 2560 is the choiced platform.
by pirvcb
Thu Mar 11, 2021 6:29 pm
Forum: Flowcode V8
Topic: HT16K33 fault stops program execution
Replies: 11
Views: 4717

HT16K33 fault stops program execution

Hello there! I'm looking for a solution to solve this problem. If the HT16K33 controller gets disconnected from the micro for any reason, when you call its Component during the program, the microcontroller stuck waiting for a reply by I2C protocol. There is a way to recovery out, a time limit or so,...
by pirvcb
Mon Apr 15, 2019 7:05 pm
Forum: General Programming
Topic: Help to set up a 1ms time base interrupt Mega2560
Replies: 3
Views: 3648

Re: Help to set up a 1ms time base interrupt Mega2560

Yes, i would like have exact timing of 1ms to simplify wheel rpm calculation. Was only a facility, i can go over wuthout it. The other and bigger problem is that putting in sleep mode the micro ATMEGA2560, without any other absobtion than itself, i can't obtain current under 8ma that's quite high fo...
by pirvcb
Mon Apr 15, 2019 11:00 am
Forum: General Programming
Topic: Help to set up a 1ms time base interrupt Mega2560
Replies: 3
Views: 3648

Help to set up a 1ms time base interrupt Mega2560

Hello to everyone! The platform is an Arduino Mega. But i program it directly by ICSP external programmer. So, no bootloader reserved memory etc. I need to set up a 1ms time base interrupt in an AVR ATMEGA 2560 at 16MHz. Does someone can help me in doing this? For PIC, i seen, the problem inside Flo...