Well, I think Josuetas' best option can be found in Post #4I think the original post'ers only option is to do the SELECT CASE thing,
<br>
Well, I think Josuetas' best option can be found in Post #4I think the original post'ers only option is to do the SELECT CASE thing,
<br>
DT
Then you would change the PORTL and or PORTH assignments in the .bas file for the chip you are using.True, but what if the pins are on PortA, or D, or E, or F, or G, or H, or J
PORTL and PORTH determine which ports are used for "Pin Numbers".
PORTL is 0-7
PORTH is 8-15
<br>
DT
Are you talking about the .bas file in the PBP directory?
I would've thought the compiler would go nuts if you changed anything in those .bas files... I know you can change the .inc files....hmm... interesting thoughts brewing in my head now...
Thanks a lot...now I got more crap to think about!![]()
Yes, the .bas file in the PBP folder. ie. 16F877.BAS
And, just like you do with the Config lines in the .inc file.
You can comment out the PORTL/H and TRISL/H lines, which allows you to define them in your main program.
Then you can...Which puts 0-7 on PORTA, and 8-15 on PORTD.Code:PORTL VAR PORTA TRISL VAR TRISA PORTH VAR PORTD TRISH VAR TRISD
Or to whichever ports you wanted.
DT
Hi Darrel,
I have looked in the .bas file for the 18F452 and located the following code
Would I be correct in assuming that you also have to "adjust" the TRISL and TRISH aliases as well?Code:PORTL VAR PORTB PORTH VAR PORTC TRISL VAR TRISB TRISH VAR TRISC
I take it that the ports dont have to be consecutive so that I could put
Which would give me 0-7 = PortB.0-PortB.7 and 8-15 = PortD.0-PortD.7Code:PORTL VAR PORTB PORTH VAR PORTD TRISL VAR TRISB TRISH VAR TRISD
If so that greatly simplifies something I am trying to impliment. The reason I want to change PORTH from C to D is that I need to use the USART which is on C6 and C7 so that would only give me 14 useable pins.
DOH !!!!
Thatll teach me not to make sure I have a newly refreshed view of a thread before I post a reply !!!!
Last edited by keithdoxey; - 27th March 2007 at 20:37. Reason: Explaining why I look like a Dumba$$
Keith
www.diyha.co.uk
www.kat5.tv
I hate when that happens!
At least everything you said was correct.
Could have been worse.
Hey Josuetas,
Still with us?
<br>
DT
Thanks Darrel, yes i am here.... i wasnt but now i am....
Well that is great that at least helps me reduce everything, bad thing is that i already made the PCB, i should get it by thursday... :P
God thing is i Used Portb(ALL) and PortC(2Bits) and portD (2 bits), and PORTA (4bits) 16 1Wire devices.
So i Guess by now i will use Darrel`s recomendation for all portb and change the .bas to use portb A, and maybe handle the rest of the bits with select case :'(.
Darrel by the way.. How then do you use DEFINES to work with your include files? (i dont relly know if yours), does this mean that once the defined is set one is supposed to stay with it and not change it?
Thanks to all for your replies, I am still hoping something better could be done
Bye
Oh good, there you are.
Sometimes I go off on a tangent when there's no more input to the original question.
And there's always another way to skin a porcupine. (sorry, but dogs and cats have enough problems right now with the rat poison and all. Time to skin porcupines)
But since the pins are all scattered across ports, I need some more info.
Can you list the pins used?
What data, "Exactly", are you sending. Probably not a string like the example.
Using 16F or 18F?
(yes, it's assembly language time)
DT
Bookmarks