Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Recent content by ghead

  1. ghead

    Trying to pass and return a variable to a function returns uneffected value

    Aha so for first point call should be like this average = Filter(average); and for second, the argument/variable I'm passing is a global variable, So i would just assign the altered value within the call thus not needing to bother returning, Or really even passing it as an argument in...
  2. ghead

    Trying to pass and return a variable to a function returns uneffected value

    I tried unsigned int Filter(unsigned int sample){ sample = sample + 100; return sample; } but still same result of variable unchanged. And calling from main loop average = 100; Filter(average); I was sure this was right but still not working, I will try write new code to test this on its...
  3. ghead

    Trying to pass and return a variable to a function returns uneffected value

    HI, I'm using Mikroc pro for pic and PIC16F877A I'm trying to pass a variable to a function like this filter(average); to this function Filter(unsigned int sample){ if (sum == 0) { bufferA[0] = sample; sum = sample * 4; } sum -= bufferA[oldest]; sum += sample...
  4. ghead

    [SOLVED] How to prevent latching with scr

    Don't if this helps but I've used this type of method before for dumping and charging a capacitor after trying many configurations with scrs gave up and used a good mosfet.
  5. ghead

    [SOLVED] Code compilies with no errors but will not run at all

    So turns out some files were corrupted (hdd is failing apparently), After reinstalling Mikroc and rebooting, chkdsk popped up and 2 hrs later.. Fixed!!!! Program runs exactly as expected, weird how other projects compiled fine and ran, But then I never moved source files etc so was probably my...
  6. ghead

    [SOLVED] Code compilies with no errors but will not run at all

    I should have included that info. I compiled it in mikroc pro and loaded hex into pic simulator ide and disassembled it to view where and what instruction was causing it to fail.
  7. ghead

    [SOLVED] Code compilies with no errors but will not run at all

    I am aware of how poor it is as i'm still new at learning c. Any simple pointers would help as this is practice/learning, May have jumped in the deep end with this project but its so close to give up now.
  8. ghead

    [SOLVED] ATOI command causes program to fail

    I'm not quite understanding, Do you mean i've got the syntax wrong and should be more like this setup union U16_ { unsigned int word; // For accessing the whole 16-bit unsigned int/////// unsigned char byte[2]; // For accessing 16-bits as individual bytes///////// }; Combine after...
  9. ghead

    [SOLVED] Code compilies with no errors but will not run at all

    I've been having this same problem intermittently while writing/testing this code, Basically each routine/loop will run fine separately but when added all together code compiles with no warnings/errors but will not run. Currently when compiled and loaded into simulator this first instruction is...
  10. ghead

    [SOLVED] ATOI command causes program to fail

    So something like this for write { union U16_ Int2Bytes; Int2Bytes.word = target_temp; eeprom_write (0x00,Int2Bytes.byte[1]); // write the hi byte eeprom_write (0x01,Int2Bytes.byte[0]); // write the lo byte...
  11. ghead

    [SOLVED] ATOI command causes program to fail

    I'm Reading the temperature via spi device and displaying it on lcd and controlling fan or heater with target temp and overshoot values . The values being stored are for the target temperature and an overshoot value, Both with a 0 - 500 decimal range. So i would be better reading the hi byte...
  12. ghead

    [SOLVED] ATOI command causes program to fail

    I'm using arrayFlow for other operations and was trying to save declaring another array when I already have one declared. Maybe not the right thing to do but as this device has limited ram. For the other functions arrayFlow is being used it works fine (I changed size from [7] to [5] to save...
  13. ghead

    [SOLVED] ATOI command causes program to fail

    HI, I'm trying to read a string from eeprom and use ATOI to convert to a int. Converting int to string and writing to eeprom works fine but when I add the following line the program fails (nothing displays on lcd or any ouputs) arrayFlow[0] = eeprom_read (0x00); arrayFlow[0]...
  14. ghead

    PIC16f877a not communicate with pickit2

    Have you checked the setting of MCLR? had same issue recently with pickit2 and i needed to add pull up resistor to run program with ICSP connected.
  15. ghead

    [SOLVED] Help checking my code, hex file only 1kb after compiling - MikroC for PIC

    I am only using PIC16F887A because I have another project (reflow oven controller) based on it so had a few spare and its doing similar job here as in reflow project just much less program going so its more about learning and building something (I enjoy the hardware side more usually) than...

Part and Inventory Search

Back
Top