Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PIC32 chips now back in stock....

Page 2 of 2
Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 424
 Posted: 04:27pm 13 Jul 2023 Copy link to clipboard Print this post

Hi Volhout,
I'm currently measuring some small voltages, so I'm amplifying them, I'm then doing the following.

Dim Float Iin(11),Volt(11),Iout(11)
Dim Float filtIi(11),filtIo(11),filtV(11)
Dim Integer y

'Take 12 readings, for the Iin, Iout and Volts find the median value
'Do this 12 times and then do the same again on those 12 values
For y=0 To 11
filtIi(y)=Math(median Iin())
filtIo(y)=Math(median Iout())
filtV(y)=Math(median Volt())
Next

' Filter out high and low readings again.
raw(0)=Math(median filtIi())
raw(1)=Math(median filtIo())
raw(2)=Math(median filtV())

Using the built in median, I beleive should order the values then take the middle 2 and average them, because there is a even number of samples.
This gives me reasonably good results and is fast, but I wondered if there was a better way? speed is not critical I'm only taking a sample per second, but I don't want the smoothing to swallow up too much time.
I originally was taking a group of samples, finding the largest and smallest, removing them and then averaging the rest, all in BASIC, so did take a fair time, but this median method seems to give me much more stable results.
Thanks for any input.
Regards, Kevin.

Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6053
 Posted: 05:59pm 13 Jul 2023 Copy link to clipboard Print this post

This might have been better in a new thread, really ...
Mick

Preliminary MMBasic docs & my PCB designs

Grogster

Joined: 31/12/2012
Location: New Zealand
Posts: 9212
 Posted: 01:05am 14 Jul 2023 Copy link to clipboard Print this post

On the subject of before COVID vs after COVID prices, I see the HC12 modules as one module that has more then DOUBLED in price - for the authentic ones - now vs before.

I used to get them for about \$4.50 per unit direct from HC12, now the price is up to about \$10 per piece.  These are still the genuine article, so I continue to use them, but EXACTLY how much of ALL of these price rises across the board on everything from chips to food, is cos of inflation, and how much is cos of profiteering by companies and blaming it on inflation and the virus......

I bet LOTS of companies ARE using the virus excuse, to ramp up prices WAY beyond what is strictly a result of inflation due to the virus.  But that's the world we live in now, and the days of cheap stuff seem to be over.

Perhaps I am just being a cynic.
Smoke makes things work. When the smoke gets out, it stops!

Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 547
 Posted: 02:56am 14 Jul 2023 Copy link to clipboard Print this post

Have a read https://www.inflation corporate america increased prices profits

Also funny how after the top rich get tax breaks inflation starts to creep up
followed by interest rate hikes that also benefits those that don't need to borrow.

The trickle down never works as they find ways to keep the tax break money
in their own pockets.

Quazee137

How about the top 1% pay at least 10% of all their income.

Grogster

Joined: 31/12/2012
Location: New Zealand
Posts: 9212
 Posted: 04:58am 14 Jul 2023 Copy link to clipboard Print this post

I had a feeling that blatant profiteering was at the heart of a good chunk of the high prices we are all now seeing.
Smoke makes things work. When the smoke gets out, it stops!

Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3840
 Posted: 08:09am 14 Jul 2023 Copy link to clipboard Print this post

Bleep said  Hi Volhout,
I'm currently measuring some small voltages, so I'm amplifying them, I'm then doing the following.

Dim Float Iin(11),Volt(11),Iout(11)
Dim Float filtIi(11),filtIo(11),filtV(11)
Dim Integer y

'Take 12 readings, for the Iin, Iout and Volts find the median value
'Do this 12 times and then do the same again on those 12 values
For y=0 To 11
filtIi(y)=Math(median Iin())
filtIo(y)=Math(median Iout())
filtV(y)=Math(median Volt())
Next

' Filter out high and low readings again.
raw(0)=Math(median filtIi())
raw(1)=Math(median filtIo())
raw(2)=Math(median filtV())

Using the built in median, I beleive should order the values then take the middle 2 and average them, because there is a even number of samples.
This gives me reasonably good results and is fast, but I wondered if there was a better way? speed is not critical I'm only taking a sample per second, but I don't want the smoothing to swallow up too much time.
I originally was taking a group of samples, finding the largest and smallest, removing them and then averaging the rest, all in BASIC, so did take a fair time, but this median method seems to give me much more stable results.
Thanks for any input.
Regards, Kevin.

Kevin, as Mick said, let's continue in another thread. But "Median" is not the correct way to measure more accurate.

See:

Median

In think you should use "MATH(MEAN a())"

Volhout
Edited 2023-07-14 18:14 by Volhout
PicomiteVGA PETSCII ROBOTS

athlon1900
Regular Member

Joined: 10/10/2019
Location: Austria
Posts: 48
 Posted: 10:21am 19 Sep 2023 Copy link to clipboard Print this post

robert.rozee said  if microchip did move to a different fab and shrunk the die, that would perhaps open up the opportunity for the mythical dip-28 packaged PIC32MX190 to become a reality! 512k flash and 128k RAM.

cheers,
rob   :-)

Will be great , if these chips-family also being supported by MMBasic.
Double flash (512K) , 64K Ram with 64/100 pin. Avaibile at DigiKey.

PIC32MX170F512H-50I/PT
PIC32MX170F512L-50I/PT
PIC32MX270F512H-50I/PT
PIC32MX270F512L-50I/PT
PIC32MX570F512H-50I/PT
PIC32MX570F512L-50I/PT

Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6053
 Posted: 10:43am 19 Sep 2023 Copy link to clipboard Print this post

Beware of Microchip offerings. Although they list a huge range it doesn't mean that they are all available - or, indeed, that they ever will be. The actual chips available are the ones that get ordered and are consequently stocked. All the others are *available to order*. It's important to only set your heart on chips that are listed as being in stock. :)
Mick

Preliminary MMBasic docs & my PCB designs

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8687
 Posted: 10:50am 19 Sep 2023 Copy link to clipboard Print this post

Quote  Will be great , if these chips-family also being supported by MMBasic.

Why?

If you want 64 or 100 pin MM+ and MMX both give more speed and more functionality

pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 283
 Posted: 12:23pm 19 Sep 2023 Copy link to clipboard Print this post

I'm getting the impression that Microchip is done making DIP-packaged chips.

Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6053
 Posted: 12:37pm 19 Sep 2023 Copy link to clipboard Print this post

That's quite possible. For some time now their main purpose has been for support of existing equipment. Through-hole components in general are getting more and more unpopular with OEMs because it costs more to produce and populate the PCBs that use them.

A 100-pin through-hole DIL chip would be interesting. :)
Mick