Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About chuckwsh

  • Rank

Profile Information

  • Gender
  1. My new toshiba with windows 8 seems to be working fine, its a C55D, I also put mplabx on there and its working so far...good luck!
  2. Yea I just clicked windows 7 compatibility mode, didn't seem to help the wizard error issue. When I installed it , it gave me an issue on a VB file..I just clicked thru it LOL, it just compiled my project tho so, I'll try it at home and see. and what does "not been much support from the writers in a long time" mean, sourceboost????
  3. Does this work under windows 8? I did manage to install on a new laptop, but I don't want to get it licensed if not. I tried project wizard and it gave me an error, I do have my desktop licensed... Chuck
  4. Anyone have a quick done routine to store a float to eeprom? I looked quite a bit and perhaps I didn't follow the setup or I missed something. thanks, or point me to where? Chuck
  5. I am looking at a fluid flow meter issue, which can pulse in input from 0(stopped) to 30khz(full tilt). I put together a routine with tmr1 that will measure >3hz to 30khz pretty accurately... under that frequency I am a bit lost. I am using RC0 on ( i know its an older pic) 16f877a. I'm reading the tmr1l and tmr1h registers and displaying on lcd the frequency, my Oscope says it works. Essentially this is a metering pump controller. When the liquid is stopped thats fine I dont run a pump. BUT If it pumps about one gallon in an hour, the meter very slowly transitions over the period of 60 minutes from low to high then back again so a 30 minute transition cycle. H to L or L to H. I look at the the final value of the tmr1 and if its under 3hz go into a sub routine called just that. there I Want to monitor this long duration transition... I got a little convoluted in that, but if I detect OVER 3hz then I am back to normal run mode.. thoughts? questions? (can I use tmr0 counter from the input of RC0? and count and total transitions ?) Happy Holidays! thanks, Chuck
  6. Thanks, yea, I'm getting there, not much more math after these few lines, now its just monitoring a few inputs and such. my naming convention stinks but I write all this on the fly then go back and make it sensible for the next guy to rip up LOL Happy New Year! BoostLink Optimizing Linker Version 7.20 http://www.sourceboost.com Copyright© 2004-2013 Pavel Baranov Copyright© 2004-2013 David Hobday Caution: argument of 'delay_us' calls must have a value of 1 or more Warning unreferenced functions removed: bad_swr in: C:\Users\chuck\Documents\SourceBoost\Samples\C\BoostC\swrmeter.c Building CASM file Memory Usage Report =================== RAM available:368 bytes, used:124 bytes (33.7%), free:244 bytes (66.3%), Heap size:244 bytes, Heap max single alloc:95 bytes ROM available:8192 words, used:3988 words (48.7%), free:4204 words (51.3%) success Done //----------------------------------------------------------------------------------------------------------------- void Calculate_power(){ float Forward_watts,Forward_watta,conv_ch0,Reflected_watts,Reflected_watta,conv_ch1; conv_ch0 = float32_from_int32(CH0); Forward_watta = float32_mul(conv_ch0,Forward_Alpha ); Forward_watts = float32_add(Forward_watta, Forward_Beta); fwatts = float32_to_int32(Forward_watts); conv_ch1 = float32_from_int32(CH1); Reflected_watta = float32_mul(conv_ch1,Reflected_Alpha ); Reflected_watts = float32_add(Reflected_watta, Reflected_Beta); rwatts = float32_to_int32(Reflected_watts); lcd_gotoxy(0,2); lprintf("FP:%04d",fwatts); lcd_gotoxy(11,2); lprintf("RP:%04d",rwatts); //-------------------------------------------------------------------------------- void Calculate_SWR(){ int swr,swra,swrb; float CHadded,CHsub,CH0f,CH1f,CH0m,CH1m,swrm,swrf; CH0f = float32_from_int32(fwatts); CH1f = float32_from_int32(rwatts); CHadded = float32_add(CH0f,CH1f); CHsub = float32_sub(CH0f,CH1f); swrf = float32_div(CHadded,CHsub); swrm = float32_mul(swrf,1000); swr = float32_to_int32(swrm); swra = (swr/1000); swrb = (swr%1000); lcd_gotoxy(0,3); if (swr > 3000){ lprintf("WARNING->"); } lprintf("SWR:%01d",swra); lprintf("."); lprintf("%d ",swrb); }
  7. also the reason I am needing the floats (so I think) is that the calibration is done over a range of power inputs, then calculated from a slope of a line in excel, as in y = .0948 and x = -37.62 to make the readings linear.
  8. void Calculate_Power(){ /* the formula for VSWR =(1+ sqrt(Prev/Pfwd))/(1-sqrt(Prev/Pfwd)) / just watching the two ADC inputs 0-1023 / I used CH0 and CH1 as an0 and an1, so int temp =CH1/CH0 / I made temp1 a float of int temp so I could use the float sqrt functions / temp2 is the sqrt of temp1, bla bla bla and you can follow the rest / is there a more easy way? since the math functions to me arn't there? / perhaps I have missed something?? thanks , chuck / */ float temp1,temp2,temp3,temp4; temp1 = float32_from_int32(temp); // this is from temp=(CH1/CH0); temp2 = float32_sqrt(temp1); temp3 = float32_add(1,temp1); temp3 = float32_sub(1,temp1); temp4 = float32_div(temp3,temp4); } I'm trying to build a power meter for hamradio, I am using the 2 adc inputs. All the program works fine except now I want to try to do power and swr calculations it seems way too convoluted this way to me plus I am going to run out of space in the 16f877a, I also need to convert the 1023 bit total to dBm which will be more math. too much for this PIC?? thanks! Happy Holidays.
  9. I poked thru the web and this forum, a few posts but not exactly this question.. I want to send some special characters to the LCD, its working fine with text so far. I am building a "meter" and want the lower line of a 4x20 lcd display to be blocks from 0 to 20 blacked in, depending on my power input to the ADC, which I have working and printing out the data in text on line 0. I read the lcd_driver.h file.. but I didnt understand where I could put the lcd into a mode to write it such as in this example http://www.circuitvalley.com/2012/02/lcd-custom-character-hd44780-16x2.html any push in the right direction appreciated! thanks Chuck
  10. I am using the easypic5 development board from Mikroe and a 16f876 chip, all switches are tripple checked for on off and I'm 90% sure this is configured right I have been fighting this for a week! kind of an obsession now! The display is a HD4478 based 4 line running in 4 bit mode, board powered from both usb and had powered externally to see if I was having a power issue. I thought at one point the optimization was doing something so I turned that off... so the issue.. I have 2 pots on the board that put 0-5v on the an0 and an1 pins I can get these 2 routines to run individually and they give me full scale readings 0-5v but when I run them together, even with MAJOR waits (these are smaller now) they read wrong, like there is still discharge time on the adc caps? bleed over? DO i need to clear the adresh and adresl registers??? the simulator works OK, I have full license and plugins. if I turn up an0 it goes to maybe 20f (527 dec) and then when I turn up ad1 they both go full, then when I turn down an0 the an1 goes to about halve again they interfere with each other. I did read on here about waiting inbetween measurings...but I put delay_ms(500) and other than a hard to read display its still not correct. can someone let me know what I am doing incorrectly? I have even changed processors and its the same way (I used the 16f877a they supplied with the board previously) thanks! Chuck #include <system.h> #include <adc.h> #include <stdlib.h> #include <pic16f876.h> #include <lcd_driver.h> #define LCD_ARGS 1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 0, /* Use busy signal: 1 = use busy, 0 = use time delays */\ PORTB, TRISB, /* Data port and data port tris register */ \ PORTB, TRISB, /* Control port and control port tris register */ \ 4, /* Bit number of control port is connected to RS */ \ 6, /* Bit number of control port is connected to RW */ \ 5 /* Bit number of control port is connected to Enable */ //Target PIC16F876 configuration word #pragma DATA _CONFIG, _PWRTE_OFF & _BODEN_ON & _WDT_OFF & _LVP_OFF & _CPD_OFF & _DEBUG_OFF & _HS_OSC & _CP_OFF //Set clock frequency #pragma CLOCK_FREQ 4000000 //8mhz xtal #pragma OPTIMIZE "0" //no optimization void voltmeter(void); void voltmeter2(void); void main( void ) { trisa=0xff; lcd_setup(); lcd_clear(); while(1){ delay_ms(10); voltmeter(); delay_ms(10); voltmeter2(); } } //------------------------------------------------------------------------------------------------------ void voltmeter() { volatile bit Go_Done@ADCON0.2; volatile unsigned char ad_h@ADRESH; volatile unsigned char ad_l@ADRESL; unsigned int AD_Result; unsigned int shiftH; unsigned int shiftL; adcon0=0x41; //fosc8 chan0 ad on adcon1 = 0x04; // left justified fosc8 an0-1-3 selected Go_Done=1; while ( Go_Done == 1 ){ delay_ms(5); } lcd_gotoxy( 0, 0 ); shiftH = ad_h; shiftL = ad_l; AD_Result = (shiftH<<2) | (shiftL>>6); lprintf("A/D0 :%03X ", AD_Result ); delay_ms(10); lcd_clear(); adcon0=0x00; //turn off adc delay_ms(10); } //-------------------------------------voltmeter2-------------------------------------------------------- void voltmeter2() { volatile bit Go_DoneA@ADCON0.2; volatile unsigned char ad_hA@ADRESH; volatile unsigned char ad_lA@ADRESL; unsigned int AD_ResultA; unsigned int shiftHA; unsigned int shiftLA; adcon0 = 0x49; //fosc8 chan1 ad on adcon1 = 0x04; // left justified fosc8 an0-1-3 selected Go_DoneA=1; while ( Go_DoneA == 1 ){ delay_ms(5); } lcd_gotoxy( 0, 1 ); shiftHA = ad_hA; shiftLA = ad_lA; AD_ResultA = (shiftHA<<2) | (shiftLA>>6); lprintf("A/D1 :%03X ", AD_ResultA ); delay_ms(10); lcd_clear(); adcon0=0x00; //turn off adc delay_ms(2);
  11. I loaded it here at work, used the plugins supplied and it works, I need to go back home and see what the scoop is, perhaps its pointing to a bad directory or something...no clue yet..maybe working directories all need to be reconfigured..I work out of several ones depending on what I am doing... chuck
  12. I just paid and downloaded the extras..very new to this... do I need to use includes for the plugins? when I debug..it just keeps running and the button and led that I dropped onto the code pane disapear? looked thru help and most of the forum..sorry to be so green thanks. Chuck
  • Create New...