I can select bank in the C18 using linker script and #pramga udata. Luke -----Original Message----- From: =D6mer Yalhi [mailto:oyalhi@TEKSAN.COM.TR] Sent: Thursday, August 15, 2002 9:17 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: bank switch instructions. As mentioned below, you can use inline assembly to do the bank switching. With C18 you write: _asm ... some assembly code here _endasm However, I don't see the need for switching banks. If you could tell = us what you want to do, maybe there could be another solution to the problem, with no bank switcing. =D6mer YALHI oyalhi@teksan.com.tr http://www.teksan.com.tr Tel : +90 212 613 22 00 Fax: +90 212 544 70 35 -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Hu, Luhui Sent: Thursday, August 15, 2002 3:55 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: bank switch instructions. Hi Brendan, Do you mean the Mplab C18 can select bank of PIC18F automatically? PLease give some suggestions how to select banks in the PIC18F using C18! Thanks in advance Luke -----Original Message----- From: Brendan Moran [mailto:annirack@SHAW.CA] Sent: Thursday, August 15, 2002 2:27 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: bank switch instructions. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Deva, If you want to avoid bank switching entirely, you can move to a PIC18F series chip. Incidentally, the 16F84 is now obsolete. If that's what you have available for whatever reason, that's fine, but the 16F628 is = a much more powerful controller, with the same instruction set as the 16F84. That said, bank switching can be done in any C compiler that supports inline assembly by using the BCF and BSF instructions. You should be able to use something like: #inline bsf STATUS,RP0 var1++ #inline bcf STATUS,RP1 Now, understand that this is not good code, but it will do in a pinch, just make sure to fix it later. It is not self documenting, and it = would be far better if you could use bank switch macros or get the compiler = to handle it properly. Speaking of which, doesn't the C compiler handle switches if you overrun the amount of RAM available in one bank? Hope that helps. At 07:48 AM 15/08/2002 +0300, you wrote: > Hi Deva, > Could you explain, please, why you choose PIC16F84? >Why not other PIC? I'm just wondering. > I'll not comment your choice, since I've got a >shut up command, though in polite manner from one >of List's heavy-weight during the discussion beginner's choice.=20 >"Freedom of speech", you know, is as knotty problem as 16FXX bank=20 >switching. > > Mike. Mike, on this list, it is difficult some times to tell the difference between vehemence and anger. Are you certain that it is a "shut up command" and not an "I disagree with you"? For the record, I think = that the 18F parts are great, but they're not as available as many of the = 16F parts. Note that the OP said that there wasn't enough time to switch = to a larger processor. I presume that the OP would use a better one under looser time constraints. Regards, - --Brendan -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.8 for non-commercial use iQA/AwUBPVtJoAVk8xtQuK+BEQLcZwCgiCRlq4hFKnDwHhgk0nLsXTPB+o0AoOrY aXPbi6J8cFu8z+HHI8qaRKFo =3DWjwO -----END PGP SIGNATURE----- -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads