Search found 139 matches

by daveb0360
Mon Aug 20, 2012 5:03 pm
Forum: Flowcode V4
Topic: ADC Averaging macro
Replies: 13
Views: 5721

Re: ADC Averaging macro

Hi Enamul, Yes I am clear now thanks so much. :D The last file you sent, behaves the same with or without the first 'tempnew=0' statement. :? I didn't realise you could put 2 lines of instruction in a single calculation icon....duhhh. Something else learnt! Project is working as expected so far. In ...
by daveb0360
Mon Aug 20, 2012 4:17 pm
Forum: Flowcode V4
Topic: ADC Averaging macro
Replies: 13
Views: 5721

Re: ADC Averaging macro

Hi again..........ermmmm
Just ignore me......you can cut and paste from another instance of FC.......just done it....get a warning about unreferenced variables but it works...
Genius !!

Simples......to quote our famous meerkat friends...

Dave
by daveb0360
Mon Aug 20, 2012 4:14 pm
Forum: Flowcode V4
Topic: ADC Averaging macro
Replies: 13
Views: 5721

Re: ADC Averaging macro

Hi Enamul,
Now then, since I can't export this 'main' routine as a macro, and I can't cut and paste from one instance of FC to another.........do I have to write it all out in my main program?
Or is there a trick shortcut?

Funny one this.......just being lazy....lol

Dave
by daveb0360
Mon Aug 20, 2012 4:10 pm
Forum: Flowcode V4
Topic: ADC Averaging macro
Replies: 13
Views: 5721

Re: ADC Averaging macro

Hi Enamul & thanks. I regret, this is close but not quite what I wanted. The final value 'degC' is only required to update after each count of 8 without returning to zero inbetween. so...it begins read temp (int) store as temp1 read temp again......add to temp1 - loop 8 times at the end of the 8 loo...
by daveb0360
Mon Aug 20, 2012 2:45 pm
Forum: Flowcode V4
Topic: ADC Averaging macro
Replies: 13
Views: 5721

ADC Averaging macro

Hi all, I posted this elsewhere by accident so apologies for the confusion.. Hello Uli, You can also do ADC averaging by taking multiple samples, adding the results together in a INT variable and then dividing by the number of samples. Remember not to let the INT variable accumulate more then 32767 ...
by daveb0360
Fri Aug 17, 2012 9:00 pm
Forum: Flowcode V4
Topic: Change one variable value based on a range of measurements
Replies: 3
Views: 2164

Re: Change one variable value based on a range of measuremen

Hi Martin, As usual you have the answer.......I am sure you can see what I'm trying to do.....was trying to ease the burden on you working on this water heater code by going solo.....forlorn effort as I spent all day trying to get past this first hurdle. My theory was that I could have the voltage a...
by daveb0360
Fri Aug 17, 2012 5:41 pm
Forum: Flowcode V4
Topic: Change one variable value based on a range of measurements
Replies: 3
Views: 2164

Change one variable value based on a range of measurements

Hi, I'm not at all sure if the subject line describes what I'm trying to do but here goes. I'm using a 12F617 under FCv4. I have an A/D Channel watching a voltage rail. The program must set one variable called ACTIVE to '1' based on acceptance that the value read on the A/D input, falls between 2 wi...
by daveb0360
Fri Aug 17, 2012 4:35 pm
Forum: General Programming
Topic: Do shorter variable names result in smaller code (hex)
Replies: 8
Views: 3261

Re: Do shorter variable names result in smaller code (hex)

Here's an updated spreadsheet others may find useful. I have equipped it with a front page where variables can be entered and the corresponding integer value returned. for byte variables, change the value '1024' to 255 and a corresponding byte variable will result. Sure it's obvious to most and most...
by daveb0360
Fri Aug 17, 2012 2:23 am
Forum: General Programming
Topic: 2 x 12 Volts Battery Serial voltage mesurement??
Replies: 5
Views: 2426

Re: 2 x 12 Volts Battery Serial voltage mesurement??

Hiya, Just to add a note to the above schematics. One major benefit of this type of floating circuit is that the measurements taken are ratiometric. That is to say that if VDD is used as reference, the mid point of the measurement range will always be at 1024/2 (10bit) regardless of whether the pic ...
by daveb0360
Fri Aug 17, 2012 2:07 am
Forum: General Programming
Topic: 2 x 12 Volts Battery Serial voltage mesurement??
Replies: 5
Views: 2426

Re: 2 x 12 Volts Battery Serial voltage mesurement??

Hiya, If you look at the images below, you will see a method that is straightforward as long as the measurement circuit using the pic, can float. It relies on matched resistors for accuracy, the better the match, the better the accuracy. Basically, the pic is powered from both batteries and the adc ...
by daveb0360
Thu Aug 16, 2012 6:13 pm
Forum: General Programming
Topic: Do shorter variable names result in smaller code (hex)
Replies: 8
Views: 3261

Voltage to 10bit integers - Method

So, In short, I have attached the spreadsheet for the 2k2 Thermistor I am using which shows the 10bit integer for the calculated temperatures. This gives, within the range I am most interested in (30 - 50c) a useable resolution of approximately 0.1degC (as opposed to 0.4degC if I used an 8bit byte.)...
by daveb0360
Thu Aug 16, 2012 5:54 pm
Forum: General Programming
Topic: Do shorter variable names result in smaller code (hex)
Replies: 8
Views: 3261

Re: Do shorter variable names result in smaller code (hex)

Hi Guys, So, because all my variables have a known value, apart from the measured ones. I have compiled a small spreadsheet to calculate the 10bit integer result for a real world value as shown below. This will enable me to enter the known values as integers within the variables and perform decision...
by daveb0360
Thu Aug 16, 2012 2:05 pm
Forum: Flowcode V4
Topic: Help us choose the next Flowcode Video subject
Replies: 13
Views: 22370

Re: Help us choose the next Flowcode Video subject

Hi Dazz,

WOW, that's a lot to take in but very useful........very, very useful !

I can't actually find a sourceboost folder........mystery :?

Many thanks though,

Dave
by daveb0360
Thu Aug 16, 2012 1:59 pm
Forum: Programming Tips & Tricks
Topic: Great Excel Tool
Replies: 2
Views: 2932

Re: Great Excel Tool

Hi Dazz, Something I would love to do but I can't class myself as expert in all it's functionality. In my business as and electronics engineer, I work constantly with customers' Bill of Materials which are often in excel. Customers are repeatedly issuing BOM's with (example) C1, 100nF 16V Capacitor ...
by daveb0360
Thu Aug 16, 2012 1:33 pm
Forum: General Programming
Topic: Do shorter variable names result in smaller code (hex)
Replies: 8
Views: 3261

Why can't I use 'readasvoltage' openly, as is, literally?

Thanks Ben, Fully understood. Another question though....something I'm struggling to get my head around. Using the fiollowing assumptions. My program does not need to run quickly or be accurate with timings. But it does need to be accurate and consistent in reading voltages from resistive dividers. ...
by daveb0360
Thu Aug 16, 2012 11:10 am
Forum: General Programming
Topic: Do shorter variable names result in smaller code (hex)
Replies: 8
Views: 3261

Do shorter variable names result in smaller code (hex)

Hi,
This WILL seem like a silly question to most but hey !.....I'm dumb.

If I use shortened variable names in my flowcode file, will this reduce final size of hex code? Logic tells me it should but my logic is not usually Spock like.

Dave
by daveb0360
Thu Aug 16, 2012 10:39 am
Forum: Programming Tips & Tricks
Topic: Great Excel Tool
Replies: 2
Views: 2932

Great Excel Tool

Hi all, If like me, you need to manipulate spreadsheets etc as part of your programming requirements, I can highly recommend an excel add-in called ASAP Utilities. http://www.asap-utilities.com/ It adds massive functionality to excel, particularly useful are it's concatenate function which is very u...
by daveb0360
Thu Aug 16, 2012 12:49 am
Forum: Flowcode V4
Topic: Help us choose the next Flowcode Video subject
Replies: 13
Views: 22370

Re: Help us choose the next Flowcode Video subject

Hi Dazz,
Thanks for the info.....unfortunately, I am only working with v4 program which doesn't have the more detailed help file you display here.
However, I've noted the info so thanks......now I understand better.


Dave
by daveb0360
Wed Aug 15, 2012 8:45 pm
Forum: Flowcode V4
Topic: Help us choose the next Flowcode Video subject
Replies: 13
Views: 22370

Re: Help us choose the next Flowcode Video subject

Personally, I find, although I understand how to put a flowcode together from a state machine point of view, It's syntax that constantly trips me up. eg. what the hell does this mean..((Count>=LED_On) && (LED_Status=1))|| ((Count>=LED_Off) && (LED_Status=0)) What do the double && and the || mean, th...
by daveb0360
Wed Aug 15, 2012 7:25 pm
Forum: General Programming
Topic: Adc Accuracy
Replies: 15
Views: 6828

Re: Adc Accuracy

Hi Uli, I use the maximum current 'into' any pin specification from the datasheet. This is basically defined as the maximum forward current of the steering diodes that are at the i/o pins (except MCLR). Most pic's.....and indeed, many other logic families and processors, define this as 10mA max. Usi...
by daveb0360
Wed Aug 15, 2012 5:13 pm
Forum: Flowcode V4
Topic: code for dual voltage 'window' on ADC input
Replies: 85
Views: 29943

Re: code for dual voltage 'window' on ADC input

Hi again. I'm so sorry but this is no better. Initially, at power up, supply below normal, led indicates intermittent pulses as required. Then, at supply increase to ~15V, (at the correct voltage for normal running,) Heater switches on, LED flashes even pulse absolutely correctly! On reaching the 45...
by daveb0360
Wed Aug 15, 2012 3:20 pm
Forum: Flowcode V4
Topic: code for dual voltage 'window' on ADC input
Replies: 85
Views: 29943

Re: code for dual voltage 'window' on ADC input

Hi Martin, Sorry this is making you so tired...truly. I measured the voltage at adc pin when temp at 42C and it measures amazingly close to the predicted (calculated) value in the spreadsheet at 3.26V. Any error is probably my meter. The led patterns displayed by this version are much closer to the ...
by daveb0360
Tue Aug 14, 2012 11:09 pm
Forum: Flowcode V4
Topic: code for dual voltage 'window' on ADC input
Replies: 85
Views: 29943

Re: code for dual voltage 'window' on ADC input

I never did like the idea of Vpp on a measurement pin! Dave, You are aware the Vpp pin doubles as reset if not configured for I/O? BTW in your diagram that pin is not used for measurement but connected to plus 5v via 100K. Regards, Jac Hi Jac, Now I feel very dumb.......I've been going round in cir...
by daveb0360
Tue Aug 14, 2012 11:02 pm
Forum: Flowcode V4
Topic: code for dual voltage 'window' on ADC input
Replies: 85
Views: 29943

Re: code for dual voltage 'window' on ADC input

Hi Martin, Sorry but I can't use the FC5 file. I don't have and can't presently afford the full software and the free version won't allow the 675 or 617 chips...etc....etc. Appreciate your efforts but I can't take that road at present. FYI, I modified the hardware to use a 78L05 regulator and switch...
by daveb0360
Tue Aug 14, 2012 5:33 pm
Forum: Flowcode V4
Topic: Visual Improvement to GUI
Replies: 4
Views: 2366

Re: Visual Improvement to GUI

Hi Jonny,
Well I'll be damned!........you're right !.........The dwell time over the icon is a little long......that's why I've never noticed.........sorry to waste time on the forum then..........oops :oops:

Dave