We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am making a project where I need to use 14 outputs. I choose for that the entire Port 1 pins, P3.2, P3.3, P4.4, P4.5, P4.6 and P4.7. But I have a problem with that last four. They are part of the Port 4 and can function as general I/O or in its alternate function as address pins A16, A17, A18, and A19. Here is where my problem is. I can’t configure them to work as I/Os. I have read about configuring that in an assembler source called startup.a51 by the SFR registers P4CNT, P5CNT, P6CNT, MCON and MCON1. I have found different versions of that source file and tried a lot of different combinations in that registers, but I don't achieve what I want.
For all that, I would be very grateful if someone can explain me how to do it or can reply me with an example of the startup file configured correctly.
Best regards,
Gorka
is that you have to run all over creation to find the answers. http://www.keil.com/forum/docs/thread10623.asp
Erik
"P4CNT, P5CNT, P6CNT, MCON and MCON1"
Those must be specific to a particular chip, or a particular manufacturer's range of chips.
As you haven't bothered to give any details of what chip you're actually using, it's impossible to say...
"I have found different versions of that source file"
Yes there will be different versions for different chips - clearly, you need to choose the correct version!
"tried a lot of different combinations in that registers"
The Datasheet for the specific chip should tell you precisely what combiations you need
"I would be very grateful if someone can explain me how to do it"
Two easy steps: 1. Read the Datasheet for the specific chip; 2. Do what it tells you.
"or can reply me with an example of the startup file configured correctly"
Impossible without knowing the specific chip!
Sorry but I am new to this forum and I am not familiar with the unusual etiquette of the members.
The chip I use is the Dallas DS87C530.
I have now tried every combination of code and still it does not work.
It isn't about etiquette. It's similar to the need to specify make, model and production year (and possibly colour, tyre dimensions, ...) if you need to buy spare parts for a car.
Any missing detail forks off more alternative answers to a question, and few people will try to answer wild-card questions.
As Per says, it's not a matter of etiquette - it's simply providing sufficient information to enable people to know what you're talking about and, hence, make relevant replies.
Remember: anyone reading your post knows absolutely nothing about you or your project - other than what you state explicitly in the post.
"The chip I use is the Dallas DS87C530"
Have you read its Datasheet? Have you read the other Application Notes, guides, etc, available on the Maxim (formerly Dallas) website?
"I have now tried every combination of code and still it does not work."
Clearly, you can't have tried every combination - you haven't found the one(s) that work yet!
Did you start with the basic "Hello World" sample? Have you worked-through the examples to gain familiarity with the tools?
http://www.keil.com/support/man/docs/uv3/uv3_examples.htm
Did you use the Keil-supplied header file for this chip? See: http://www.keil.com/dd/chip/2979.htm
Did you use the Keil-supplied startup code for this chip?
Are you using a commercial board based on this chip? If so, have you checked its documentation and the supplier's support site for hints, tips, examples, etc?