How  to make port a work in stimulus - Page 1
Forum section: electronics / general

author: tahmod
author_rank: Contributor
timestamp: April 12, 2013, 11:45:43 pm
content: Hi,I have declared portb , made the port b an input and then used it in the program. I used the stimulus it worked. However I done the same thing for the porta but it did not work. When i was pressing the fire button in the stimulus, the porta was not setting high in the watch?I am using the 18F87J11 micro-controller.

author: Skimask
author_rank: Super Contributor
timestamp: April 18, 2013, 09:11:39 pm
content: Hmmm...What other functions are present on Port A that may be enabled by default and cause the "simulator" to not respond as you expect but respond correctly in accordance with the datasheet information?

author: kxenos
author_rank: Frequent Contributor
timestamp: April 18, 2013, 09:20:11 pm
content: Has it anything to do with pull-up resistors or I'm being totally irrelevant?

author: tahmod
author_rank: Contributor
timestamp: April 18, 2013, 09:58:49 pm
content: -it is an analogue input, it must be initilise differently?Quote from: Skimask on April 18, 2013, 09:11:39 pm

author: c4757p
author_rank: Super Contributor
timestamp: April 18, 2013, 10:13:20 pm
content: Why don't people asking questions about microcontrollers ever post code? How is anyone supposed to know what's wrong? Post the code you're using and a connection diagram...

author: Rufus
author_rank: Super Contributor
timestamp: April 19, 2013, 12:33:47 am
content: Quote from: c4757p on April 18, 2013, 10:13:20 pmBecause at a guess he is talking about the simulator in Microchip's MPLAB or MPLABX. To be honest people who can't understand that what they post is going to be meaningless to 99% of the people who waste their time trying to read it are a lost cause. The inability to observe a problem from someone else's point of view indicates an inability to observe and solve problems at all.

author: c4757p
author_rank: Super Contributor
timestamp: April 19, 2013, 12:55:30 am
content: Quote from: Rufus on April 19, 2013, 12:33:47 amI'm confused. What about a simulator could possibly make someone think the code is less relevant??

author: Rufus
author_rank: Super Contributor
timestamp: April 19, 2013, 01:30:22 am
content: Quote from: c4757p on April 19, 2013, 12:55:30 amBecause stimulating the port and observing the port change in the simulator displays doesn't need code, or at most it doesn't need more than the execution of any instruction to refresh the display. The OP thinks it is a problem with the simulator or stimulus.

author: Skimask
author_rank: Super Contributor
timestamp: April 19, 2013, 03:01:44 am
content: Quote from: kxenos on April 18, 2013, 09:20:11 pmDon't have the datasheet in front of me (don't want to waste bandwidth opening it up), but I think the pullup resistors are only on port B on this particular PIC.Close...but not quite.At the very least, that bit of info (e.g. internal pull-up resistors) is something that a person might find in the DATASHEET!!!

author: tahmod
author_rank: Contributor
timestamp: April 20, 2013, 12:20:56 am
content: Datasheet =>http://seniordesign.ee.nd.edu/2008/Design%20Teams/Awesome-o/datasheets/39778b.pdfthere is some form of btfsc for analogue quantity or something?Quote from: Skimask on April 19, 2013, 03:01:44 am

author: Skimask
author_rank: Super Contributor
timestamp: April 20, 2013, 06:45:44 am
content: Nevermind...BTFSCBITTESTFILESKIPCLEARBit test file register, Skip if Clear... Where is the analog quantity in that?

author: tahmod
author_rank: Contributor
timestamp: April 20, 2013, 10:34:08 pm
content: -I never said btfsc is for analogue, read my sentence again if you want. I understand that btfsc is for digital, I just asking if there is a command that test for analogue quantity, or you need to convert the analogue to digital and test it in digital?-And a code that test quantity instead of just a bit for example we have two LED and 1 analogue button half rotation of the analogue button turn on the left LED and half the other rotation turn on the other LED.Quote from: Skimask on April 20, 2013, 06:45:44 am

author: Skimask
author_rank: Super Contributor
timestamp: April 21, 2013, 12:32:45 am
content: Really?http://en.wikipedia.org/wiki/Comparator

author: tahmod
author_rank: Contributor
timestamp: April 21, 2013, 09:08:41 am
content: Skymask, I look at the datasheet you can use the instruction CPFGT f,a.ThanksQuote from: Skimask on April 19, 2013, 03:01:44 am

author: amyk
author_rank: Super Contributor
timestamp: April 21, 2013, 09:31:31 am
content: Quote from: tahmod on April 21, 2013, 09:08:41 amYou still have to run the ADC. If you don't understand why then you should probably go all the way back to the beginning and start learning everything over.

author: tahmod
author_rank: Contributor
timestamp: April 21, 2013, 04:51:08 pm
content: Quote from: amyk on April 21, 2013, 09:31:31 amI understand how I can initialize the ADC, how to start the conversion and how to output. I just needed to understand how I could test for it.

author: Skimask
author_rank: Super Contributor
timestamp: April 21, 2013, 06:33:53 pm
content: Quote from: tahmod on April 21, 2013, 04:51:08 pmNo...No...No you don't.

author: IanB
author_rank: Super Contributor
timestamp: April 21, 2013, 06:45:59 pm
content: Our friend here seems to be about 15 years old. I fear we may have to wait another five years or so before it is possible to have a reasonable conversation on technical matters to do with electronics and computing. Age 20 is around that golden age where the clouds of the mind disperse and the sunlight of understanding dawns

author: Skimask
author_rank: Super Contributor
timestamp: April 23, 2013, 04:54:23 am
content: A response from the PM sent to me..."No...No...No you don't."As in...No you apparently don't understand how you can initialize the ADC.No you apparently don't know how to start the conversion.No you apparently don't know how to get the output.And following those thoughts, you surely can't test for "it"...or anything else for that matter.Get an Arduino board and go with it.