Search results

  1. K

    adc temperature problem

    I found documentation for ADC_Read() which is a MikroC library function. It returns a 10-bit A/D result so simply shift right 2, like in your example code: myvalue = ADC_Read(0) >> 2; should do the trick. BTW, since you're using the ADC library functions you should use ADC_Init() to set up...
  2. K

    need help with reducing DC voltage

    The simplest way may be to use the 120V AC valves and switch them using relays (like the ones duke37 mentioned) from the 100V DC controller outputs. You'll need resistors that will drop the DC voltage from 100V to whatever the relay coil DC voltage rating is. The resistance needed will depend...
  3. K

    micro controller design

    So, are you attempting to develop a microprocessor or a microcontroller? Based on your specs, it looks closer to a microprocessor with some on board ROM and RAM, relying on external support for peripherals, containing external address, data, and (sometimes) I/O buses. Microcontrollers have a...
  4. K

    Hello, Welcome! (Introduce yourself)

    Hi peeps, I live in the frigid northeast USA, work as a software engineer (mostly .net) and do electronics (including some inventions) as a hobby. I use PIC microcontrollers in a lot of my projects. Looking forward to participating more and learning on here.
  5. K

    pic 16f870 programming

    You can shorten that code to: void main() org 0x10 { trisb=0x00; trisc=0xff; while(1) { if(portc.f0==0) portb.f0=1; else portb.f0=0; if(portc.f1==0) portb.f1=1; else portb.f1=0; } } Or even shorter: void main()...
  6. K

    adc temperature problem

    Assuming adc_read() returns the full 10-bit value, you could simply divide by 4 (or shift right 2) to make it an 8 bit value the same as your old PIC. Also, with ADFM = 0 (bit 7 of ADCON1), the result is placed with the 8 most significant bits in ADRESH and the 2 least significant bits in...
  7. K

    Arduino turning a knob left and right with Digital PWM

    Or, if you really want to get creative: wire the existing pot up as a voltage divider and feed an A/D pin on the Arduino, then replace that pot in the original circuit with a digital pot controlled by the Arduino. Then you can control the level directly using the knob or through whatever means...
  8. K

    Smallest led controller

    The LM3916 does exactly what you're asking for, but apparently is only available in a DIP package, plus it requires some external components. A small PIC (14-pin or so) with a built-in A/D converter would work. You'll need 8 pins for the LED outputs (unless you multiplex them, not really worth...
  9. K

    pic 16f870 programming

    Inside a loop, check button1, if pressed turn on LED 1, if not turn off LED 1. check button2, if pressed turn on LED 2, if not turn off LED 2 The loop will keep it checking the buttons and updating the LEDs. The loop itself should be doable in about 5 lines of code, and that's if you put the...
  10. K

    Solid Capacitor Identification Assistance Requested

    There's good info here on deciphering SMD capacitor values: http://www.radio-electronics.com/info/data/capacitor/smd_capacitor.php The V in VHC indicates 35V. So, get a 33uf 35V cap to replace it.
  11. K

    PIC Multiple Timer Interrupt Problem

    Based on your T2CON and T1CON settings, timer1 is overflowing before timer2, so its interrupt flag is set before your timer2 interrupt fires. Disabling the interrupt (TMR1IE) only stops the interrupt from occurring, it doesn't stop the TMR1IF interrupt flag from getting set. Use this to get...
  12. K

    PIC16F873/7A UART Receiving problem

    When you say "pins were made high", did you set TRISC 6 & 7 high, which makes the pins input? Both TRISC 6 and TRISC 7 need to be high for the UART to work. Setting PORTC values on these pins won't have any effect on the UART. If you're using the other PORTC pins as outputs, set TRISC = 0xC0;
  13. K

    Flaming Pipe Organ / Midi HT Spark Controller

    Can you post a schematic? Sounds to me like your spark circuit is creating back EMF or a drain on your power source causing the micro to crash. Do you have decoupling capacitors in your circuit? At minimum, 0.1uf caps across the Vdd and Vss (or Gnd) pins on the micro and other logic ICs, as...
  14. K

    Digital clock using DS3234

    The advantage of a microcontroller in your project is that it'll replace a lot of other logic you'd need to "count" the time and render it on an LED display. Instead of multiple counter ICs, BCD-to-7-segment decoder ICs (or 26 diodes as you mention), and decade counters and drivers for...
Top