HC-SR04 not working with ""Pic"" Anymore

For general Flowcode discussion that does not belong in the other sections.
chipfryer27
Valued Contributor
Posts: 1685
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by chipfryer27 »

Hi

Sorry, I'm a bit out of the loop due to travel. A couple of months ago I was playing with one of these and got good repeatable results (all hail Martin) with a PIC. I think Martin also assisted with an ESP32 too.

Not had a chance to get back into my evil lab yet, but I think I still have my test setup that supported the sensor still assembled. I have both Uno and ESP32 so can try them when I get a chance. Not sure when that will be though but hopefully soon.

Regards

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Flowcode v10 Re: HC-SR04 not working with ""Pic"" Anymore

Post by daddytims_tims »

Hi
lain and Jorgen

I am having problem with the Map Function, it's not working, but before the summer it uses to work.
May be its the type of Chip am using

I only use my laptop just for FC v10 ONLY

I don't want to think this way.
but I am starting to wonder if something is wrong with my new win 11, I DONT USE FLASH DRIVE IN IT. wondering if it contracts some sort of virus Sunday gone. it was showing values in the morning. Then it just Stop.

I went back to my old program it works. but not working with the Latest one.

AM going to try back the esp32 and the wats the result.

regards
ryan

chipfryer27
Valued Contributor
Posts: 1685
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by chipfryer27 »

Hi Ryan

Many free Anti-Virus solutions out there including Windows Defender so it is worth installing something.

Unlikely that the FC issues are related though.

You can test the Map functionality by just assigning variables in a calculation and viewing the results in Simulation Debugger or on a display.

Regards

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Flowcode v10 Re: HC-SR04 not working with ""Pic"" Anymore

Post by daddytims_tims »

Hi

I did Scan it with Win Defender, there's nothing there. it shouldn't be any virus thou.

>>I had no luck with the esp32

I simulated the OLD Project with the "MAP FUNCTION" and it work using the Pic16F877A.
I had an old example with the Map function using PWM as well and it responded too

Just confirm to I created a NEW Project with the HC-SR04, and Pic16f877a It work, showing its value, IMPRESSIVE READINGs

>> Still not showing values with the smaller uC "Pic18f1320" anymore Not sure why thou.
>> also trying using the "Map function" with the new project I just created. Map function Didn't response.

regards
Attachments
v10 877A.jpg
v10 877A.jpg (164.37 KiB) Viewed 4821 times

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Flowcode v10 Re: HC-SR04 Return 9999

Post by daddytims_tims »

Hi

Can anyone check and tell me if the Sr04 components Is Working?

Mine is returning 9999 Now.

Thanks again.

regards
Attachments
20241004_104333.jpg
20241004_104333.jpg (63.08 KiB) Viewed 3435 times

chipfryer27
Valued Contributor
Posts: 1685
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by chipfryer27 »

Hi

A few months back I did some experimentation with these with good results.

Not sure if anything changed component wise since then.

If you could share your chart we can look and see if anything is astray.

Sorry, can't access hardware to check things but can maybe assist otherwise.

Regards

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by daddytims_tims »

Hi

It's the same one. That I have been using earlier when it used to work.
Now am back to it and its returns 9999

regards
Attachments
Pic18f1320_SR04.fcfx
(12.05 KiB) Downloaded 152 times

chipfryer27
Valued Contributor
Posts: 1685
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by chipfryer27 »

Hi

Will download at weekend and have a look.

Regards

17712885438
Posts: 21
Joined: Thu Nov 02, 2023 8:11 am

Re: HC-SR04 not working with ""Pic"" Anymore

Post by 17712885438 »

There is a problem. The HC-SR04 is completely problem-free in V8. There have been problems with the V10. Does not work in proteus simulation.

chipfryer27
Valued Contributor
Posts: 1685
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by chipfryer27 »

Hi

The component seems to work OK in hardware on many different chips, as per forum posts with FCv10 creating the code. If Proteus has an issue would it not be better to ask Proteus why they cannot handle the code? Perhaps send them the C/Hex files you created for them to analyse why they can't simulate?

Regards

Post Reply