Jump to content

adamthole

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About adamthole

  • Rank
    Newbrie
  1. I am working on a new project that may be using the PIC10F220 or PIC12F510. Why are those not officially supported, and would it be possible to develop for them anyway (similar target)? The enhancement request is for official support for both chips.
  2. Is it possible to make SourceBoost run off of a USB key? I am a student and in some of my classes I would like to work on my hobby projects while they are going over stuff I already know, but I cannot open SourceBoost, because I do not have admin privelidges on the computers. Is it possible to make thte current version run on a USB stick somehow, or not? Perhaps this would cause some liscence issues, as you only want a single liscence to be ran on a single computer? Just an idea, let me know what you think. If not, I can still edit the code in notepad and compile when I get home. Adam
  3. Worked, all I had to do was change it to that chip. Thanks!
  4. Hello, I was just curious if I am doing something wrong with the code or simulator, or if the simulator just cannot simulate what I am trying to do? I am new to PIC and have been trying things out on the simulator to get better at it. One thing I am trying to learn right now is how to read ADC values. I downloaded evandude's adc code for the pic 16f88 and modified it slightly: //////Begin Code/////// #include <system.h> #pragma DATA 0x2007, 0x3F50//_INTRC_IO & _WDT_OFF & _LVP_OFF //important bits in SFR's for ADC, UART, and interrupt. volatile bit go @ ADCON0.GO; volatile bit gie @ INTCON.GIE; volatile bit rcie @ PIE1.RCIE; volatile bit peie @ INTCON.PEIE; volatile bit rcif @ PIR1.RCIF; volatile bit trmt @ TXSTA.TRMT; char data_in; bit newdata; //Function: Reads one value from the ADC //Returns: most significant byte of result inline char adc_read() { go = 1; while (go); return adresh; } void main() { //*********************// // configure I/O ports // //*********************// portb = 00000000b; trisb = 11111111b; //0 = Output, 1 = Input porta = 00000000b; trisa = 11111111b; //0 = Output, 1 = Input //***************// // configure ADC // //***************// osccon = 01110000b; //internal oscillator @ 8MHz cmcon = 00000111b; //comparators off ansel = 00000001b; //AN0 on (RA0) adcon1 = 00000000b; //left justified, fosc/2 clock, Vdd & Vss ref voltages adcon0 = 00000101b; //set to AN0, ADC operating char adcval,temp; while(1) { temp=adc_read(); delay_ms(5); } } /////END CODE///// I run the program, put XX voltage on pin RA0 with the Variable PSU and I watch temp. Temp is always 0. When I step through the program it hangs when it goes to function adc_read(). The simulator apparently is not clearing the go bit when it gets a value. I have modified the adc_read() so it isn't in the infinite loop and temp still remains 0 all the time. Am I doing something wrong or was the simulator just not made for what I am doing? I couldn't get the original code to work correctly, available: http://www.eegeek.net/electronics/tutorials/PIC/adctest.c Thanks
×
×
  • Create New...