pcbway

PIC 16f648a Komparatoren.

Başlatan arzew, 10 Mart 2010, 10:01:45

arzew

Mal sabahları, ben fonksiyonla multiplexées sevmeyecek 4 Komparatoren sonra giriş 16f648a,
16f648a datasheet 10 tane düşünür -1). Benim o bu Komparatoren emiri olur \" dört giriş iki tane multiplex comparators.
 Benim hiç kesintim yok benim değişmelerdeki fikirim ra0,1,2,3 kuşatma kalk girişler, benim hatalarım programı
kanıtlanabilir onlar için olur. Amaç: 4 girişler configure; tane pic16f648a * * * * * * configures çap Vergleich

Amaç: 4 girişler configure; tane pic16f648a

* * * * * * configures çap Vergleich ******


clrf   flag_reg
clrf   PORTA
movf   CMCON,0
andlw   0xC0
iorwf   flag_reg,1
movlw   0x02           ;configurer comparateurs dans mode 4 entrées multiplexées
movwf   CMCON
bsf   STATUS,RP0
movlw   b\'00001111\'    ;RA0,1,2,3 entrées multiplexées
movwf   TRISA

bcf   STATUS,RP0
call   t3ms
movf   CMCON,1

bcf   PIR1,CMIF      ;effacer flag comparateur
bsf   STATUS,RP0
bsf   PIE1,CMIE      ;activer interr comparateur
bcf   STATUS,RP0
bsf   INTCON,PEIE
bsf   INTCON,GIE


;*********  configurer référence tension interne au PIC  **********
   movlw   0x02      ;4 entrées multiplexées
   movwf   CMCON
   bsf   STATUS,RP0
   movlw   0x06      ;b\'00000110\'
   movwf   TRISA
   movlw   0xA6      ;b\'10101010\'
   movwf   VRCON      ;tension référence interne 2,08 V   
   bcf   STATUS,RP0
   call   t3ms
;**********************
debut   nop
   goto   debut



Örnek 11 tane - 1 datasheet, ra0 dışarı çıktığı söyleyen zaman / alışık movlw 0x07 trisa movwf sonra alır? Tayvan\'a, o Komparatoren oluşumunun içindeki bir emir verir çaplar daha önce referans gerilimi veya? Benim programımı hiç durumun içinde denetlemez ben beklerim! Senin yardımın için

 Arzew

neural

I want to help you for this subject.
I think so google translate has problem to turkish language converting.
If you write in english language, I can help you more.


arzew

Hello

I would like to use(get) comparators of the 16F648A in particular those who are multiplexés, register CMCON (CM(LECTURE) < 2:0 > 010)
I understand rather badly the functioning of these subtleties malgrè datasheet doc of Microchip.
Even having written the configuration of the reference module tension I have my exits(releases) C1OUT and C2OUT constantly in 1.
Maybe has you he a particuliaire method in the writing of the program there?

If somebody knows an alternative or a method I thank him(it) for it beforehand for explaining him(her,it)...

Thank you for your help(assistant)

Denis

my program:

;******  configurer module comparateur  ******
clrf   flag_reg
clrf   PORTA
movf   CMCON,0
andlw   0xC0
iorwf   flag_reg,1
movlw   0x02           ;configurer comparateurs dans mode 4 entrées multiplexées
movwf   CMCON
bsf   STATUS,RP0
movlw   b\'00001111\'    ;RA0,1,2,3 entrées multiplexées
movwf   TRISA

bcf   STATUS,RP0
call   t3ms
movf   CMCON,1

bcf   PIR1,CMIF      ;effacer flag comparateur
bsf   STATUS,RP0
bsf   PIE1,CMIE      ;activer interr comparateur
bcf   STATUS,RP0
bsf   INTCON,PEIE
bsf   INTCON,GIE


;*********  configurer référence tension interne au PIC  **********
   movlw   0x02      ;4 entrées multiplexées
   movwf   CMCON
   bsf   STATUS,RP0
   movlw   0x07      ;b\'00000111\'
   movwf   TRISA
   movlw   0xA6      ;b\'10101010\'
   movwf   VRCON      ;tension référence interne 2,08 V   
   bcf   STATUS,RP0
   call   t3ms
;**********************
debut   nop
   goto   debut

neural

Hi again,
I writed a asm code for you and I tested on proteus isis software. It\'s working.
If you don\'t use interrupt you can\'t write on your code. I cleaned.
Can you try the code and can you write to me the result?


movlw b\'00000010\' ; comparator on and
movwf cmcon ; C1 V- > RA0 , C2 V- > RA1

bank1 ; this is a macro change the bank

movlw b\'00000011\'
movwf trisa
movlw b\'00000000\'
movwf trisb

movlw 0xA6 ; voltage reference modul on
movwf vrcon ; and voltage reference is 2.08V
 
bank0 ; this is a macro change the bank


loop movf cmcon,w
andlw b\'11000000\'

movwf portb ; portb<7,6> c1out and c2out
goto loop


arzew

Hello,

Thank you for your explanations!
I am going to try your lines of programming.
I also have Protèus.

Goodbye

arzew

Hello,

Regrettably it does not work !
In the starting up of the program, the bits 6 and 7 of the register CMCON pass in 1 in the line 232!
There is thus display in the PORTB bits 6 and 7

Thank you for your help

neural

Hi,
I send you comparator project with proteus design in the attachment (.zip) file.
Can you check the project and try it.

You told \"the bits 6 and 7 of the register CMCON pass in the 1 on the line 232\". I check this line of code.
Can you send me program code of the your project. I can try your code for you on the proteus and i help you more.

I also, what is version of your mpasm? I \'m using 5.20 version of the mplab software.

arzew

Hi,

Here is the program .asm, I use MPASM V7.5
I also give the assembly(editing) for Protéus 7.2 SP2
The LEDs connected on PORTB6 and PORTB7 does not work (do not ignite!)
They have to ignite because movf CMCON, 0 andlw b \'11000000\' has to put the bit 6 and 7 of the PORTB to 1!!!

Goodbye

ps: I tried your program the bit 7 of PORTB ignites with MPLAB but does not ignite with Protéus!
I do not use quartz.

arzew

I have to forget to post my program

How to send a file?

arzew

Alıntı yapılan: arzew - 14 Mart 2010, 20:26:23I have to forget to post my program

How to send a file?

ok I managed to send my file!

arzew

It\'s a pity no answers to my exercise!    ???

Arzew