hi there! is there some1 here who can help me with my problem with my 877 pic. my pic wasnt able to give me the correct output of high logic eventhough i had my PORTC and A in all bit set. what could be the problem with that?thanks [/b]
hi there! is there some1 here who can help me with my problem with my 877 pic. my pic wasnt able to give me the correct output of high logic eventhough i had my PORTC and A in all bit set. what could be the problem with that?thanks [/b]
Make sure you disable the A2D inputs, these are enabled by default and make ports A and E inputs. The 877A also has comparators (but I don't know which port they use), these are possibly also enabled by default.
hey there thanks for the help...really appreciate it, can i send my code later to you? and another thing, have you heard of the MAXIM 114 an ADC chip(8bits)...coz im trying to interfaced it with my pic using its outputs as my input for my pic..PORTB will be my input from ADC!
No need to use an external ADC, there is a built in ADC 8bit (or 10 bit) in the 16F877... you just need to apply your analog volatage straight to the PIC and set ADCON registers, and tell it to do the conversion.
It is easly done... and you don't waste I/O, and time comunicating to a ADC converter.
hi there ivancho, nweiz thanks for the reply.... the reason why we used an external ADC is that i dont know how to make use of the ADC in the PIC and it will cost us much time..can you show me an example of it?
hi there ivancho, nweiz thanks for the reply.... the reason why we used an external ADC is that i dont know how to make use of the ADC in the PIC and it will cost us much time..can you show me an example of it?
wut if i need to compare my inputs by subtracting them : new - previous, then ill check its carry if it is 1 or 0.....can it comprehend with the speed of my sensor which will have its output in just 5 seconds?
wut if i need to compare my inputs by subtracting them : new - previous, then ill check its carry if it is 1 or 0.....can it comprehend with the speed of my sensor which will have its output in just 5 seconds?
Yes, no problem - a 16 bit subtraction can be done pretty fast, using a 20MHz crystal a 16F877 can perform 5 instructions in 1uS, that's 5,000,000 instructions per second.
Depending on the resolution you need, and how you set the A2D up, you can use it as an 8 bit A2D, this way you only need to do an 8 bit compare.
But if you're talking about 5 seconds - that's an absolute age in PIC terms, most PIC's spend the vast majority of their life in loops wasting time!.
sir my problem is how can i give my source code an overhaul by not not using the whole PORTBas my input and use only one pin from PORTE as my input...CAN YOU HELP ME WITH MY ADC IN THE PIC?thank you very much sir
sir my problem is how can i give my source code an overhaul by not not using the whole PORTBas my input and use only one pin from PORTE as my input...CAN YOU HELP ME WITH MY ADC IN THE PIC?thank you very much sir
For an analogue input, it only uses one input pin - you can select which one it uses by writing to a register. The 16F877 only has one A2D, this is switched to the different input pins by the value in the register.
sir my problem is how can i give my source code an overhaul by not not using the whole PORTBas my input and use only one pin from PORTE as my input...CAN YOU HELP ME WITH MY ADC IN THE PIC?thank you very much sir