Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 1st July 2009, 04:42 PM   #31
Default

This is the sample code from the data sheet
Code:
      CALL SampleTime     ;Acquisiton delay
      BSF ADCON0,GO       ;Start conversion
      BTFSC ADCON0,GO   ;Is conversion done?
      GOTO $-1                  ;No, test again
      BANKSEL ADRESH      ;
      MOVF ADRESH,W      ;Read upper 2 bits
      MOVWF RESULTHI    ;store in GPR space
      BANKSEL ADRESL     ;
      MOVF ADRESL,W      ;Read lower 8 bits
      MOVWF RESULTLO   ;Store in GPR space
This is the part that your taking about
Code:
 CALL SampleTime     ;Acquisiton delay
I read the adc apnote and the example they gave for the SampleTime delay was
Code:
SampleTime:
           nop   ;1 cycle
           return  ;4 cycles
be80be is offline  
Old 1st July 2009, 04:45 PM   #32
Default

Your code is fine Burt, I shouldn't pay any attention to him - you only need to check if the ADC is busy after initiating a read - unless you've initiated a read, it can't possibly be busy.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 1st July 2009, 07:50 PM   #33
Default

This is from microchip sample code
Code:
MainLoop:
     nop                      ; wait 5uS for A2D amp to settle and capacitor to charge.
     nop                      ; wait 1uS
     nop                      ; wait 1uS
     nop                      ; wait 1uS
     nop                      ; wait 1uS
     bsf       ADCON0,GO      ; start conversion
     btfss     ADCON0,GO      ; this bit will change to zero when the conversion is complete
what I did is the same thing
A call =2 nop =1 return = 1 that's five for A2D amp to settle and capacitor to charge
be80be is offline  
Old 1st July 2009, 08:24 PM   #34
Default

Abusive post deleted - moderator.

24 hour ban for abusive behaviour.

Last edited by Nigel Goodwin; 1st July 2009 at 08:27 PM.
millwood is offline  
Old 1st July 2009, 08:27 PM   #35
Default

Bad language post deleted - ElectroMaster.

Next time will be a official warning.

Last edited by ElectroMaster; 4th July 2009 at 11:55 PM.
Pommie is online now  
Old 1st July 2009, 08:45 PM   #36
Default

Quote:
Originally Posted by Pommie View Post
So, which port of the 16F844 has the analogue input?
Perhaps you should also ask, "Where do I find this mysterious PIC? It doesn't appear on the MicroChip site at all."
__________________
Inside every little problem, is a big problem trying to get out.
kchriste is offline  
Old 2nd July 2009, 10:16 PM   #37
Default

Mrdeb here the schematic for the test board I made
Attached Thumbnails
Some ideals on adc-play.png  

Last edited by be80be; 3rd July 2009 at 04:24 AM.
be80be is offline  
Old 3rd July 2009, 04:13 AM   #38
Default what's with the R, GP1 AND GP2??

in the middle of the schematic??
MrDEB is offline  
Old 3rd July 2009, 04:28 AM   #39
Default

Sorry about that I didn't remove it all it was a 74hc164 but it's not on that board it was on the schematic I thought i remove it all my kids was trying to get me to take them skating and i didn't look it over good I fixed it should make since now.
be80be is offline  
Old 3rd July 2009, 03:15 PM   #40
Default

here all the files mrdeb
Attached Thumbnails
Some ideals on adc-play.png  
Attached Files
File Type: zip test.zip (19.3 KB, 5 views)
be80be is offline  
Old 3rd July 2009, 08:45 PM   #41
Default

Hey Burt i did something like that for the junebug a while back its in the second JPUG. (Junebug Newsletter (Junebug User Guide)

Good Job!!

Check out: #2 June 2008
JPUG the Junebug PIC Users Group Newsletter

Even did a nice PCB layout when you scroll down...

Last edited by AtomSoft; 3rd July 2009 at 08:46 PM.
AtomSoft is online now  
Old 4th July 2009, 01:19 AM   #42
Default PCB file BUT?

if I had the sch file then I can finish.
this is the express pcb file for board
how can I post a file??
not really done but its a start.
need sch file or I have to redraw it
Attached Thumbnails
Some ideals on adc-capture7-3-2009-6.17.36-pm.png  
MrDEB is offline  
Old 4th July 2009, 01:40 AM   #43
Default

Here that is
Attached Files
File Type: zip play.zip (24.4 KB, 4 views)
be80be is offline  
Reply

Tags
adc, ideals

Thread Tools
Display Modes




All times are GMT. The time now is 04:41 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker