Cantafford
Member
I tested the previous code on that schematic and it worked. It s a software problem i think
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If I put 'xx1xx' on ADCON3<4:0> it says: "Input Capture 1 (IC1) starts A/D sequence". The datasheet specifies that in this case the GODONE bit will be set and cleared by hardware. So doesn't that mean that I don't need an AD interrupt and that input capture 1 interrupt will do all the work?The main ( pressing ) issue is the interrupt..... You cant set the ADC to start conversion on the index input AND use the same interrupt to read the ADC.... It'll never be ready... When it boots it takes sooooooo long to restart the ADC conversion.... If the ADC is on continuous why don't you use the ADIF to interrupt??
I set ADCON1 <7:6> to 00: That says: "VREF+ = AVDD, VREF- = AVSS, (AN2 and AN3 are Analog inputs or Digital I/O)". Doesn't that mean I will have +5V and 0V as reference?(VSS and VDD of the PIC which are not showed in proteus for simplicity)?One other thing!!! You are using AVDD and AVSS for the ADC reference but you haven't connected them... The warning is telling you that Vref+ is at 0v..
Yep!! And you read it within 2uS...If I put 'xx1xx' on ADCON3<4:0> it says: "Input Capture 1 (IC1) starts A/D sequence".
If you do that the duty cycle will have no influence on the PWM modules and the motor will run at full speed. It's basically what we did first to check if the module was configured correctly.I swapped OVDCOND and OVDCONS registers and it now goes bananas
Are you using the ADC interrupt feauture? Because if so it must be specified in the ADCON3 that triggers are disabled(if you haven't already done that that is)Yeah I figured as much..... My problem here is I'm running PNP ~ NPN so I'm inverting the output..
I have now swapped it all to NPN and 5v.... I can get it running quite fast, but it doesn't seem to correspond to the ADC input!!!
Nope.... Just using the rolling ADC value.... I must admit, It's quite hard to get it going!!Are you using the ADC interrupt feauture?
Did you get it to spin respecting the pot position?Right!!! If I set dch to 255 the motor spins very fast.... The PDCx pairs require a 14 bit number .. If we set dch to 00111111b then problems... If I set dch to 11111111b then the motor spins... This is because the PDCx value is bigger and the PWM is set to permanent 1.... I think that the PDCx pairs are out of sequence...