PDA

View Full Version : MC Studio and 18F252



trust issues
- 28th October 2004, 20:01
Hi all, I'm trying to program a PIC 18F252 using MicroCode studio. I am new to PIC's in general but what I need help with in particular is naming the pins. How in the code do I refer to a particular pin? Like how would I get the code to scan to see if RA0 is high or low? or to output a high logic signal from RA1?
thanks in advance.

mister_e
- 28th October 2004, 20:06
Hi all, I'm trying to program a PIC 18F252 using MicroCode studio. I am new to PIC's in general but what I need help with in particular is naming the pins. How in the code do I refer to a particular pin? Like how would I get the code to scan to see if RA0 is high or low? or to output a high logic signal from RA1?
thanks in advance.

If you want to test status of a pin:

HighOrLow VAR BIT

HighOrLow=PORTA.0


The result is in the HighOrLow Variable

To send high level to RA1 use
PORTA.1=1
or
HIGH PORTA.1

To send low level
PORTA.1=0
or
LOW PORTA.1

Dwayne
- 28th October 2004, 21:09
Hello Trust Issues,

TI>>Hi all, I'm trying to program a PIC 18F252 using MicroCode studio. I am new to PIC's in general but what I need help with in particular is naming the pins.<<


Forgive me if I am wrong, or incorrect to make a quick guess here, but MicoCode Studio will not program your chip. I believe you still need Pic Basic Pro for your compiling and MPASM or other assembler loading program for your chip. MicoCode Studio is a "Shell" for PBP and your loader. Powerful shell at that.

the way I read your message, you are fairly new to PICS, and I didnt want you to think that MicroCode Studio was all you needed.

If I am incorrect on the above, will someone please set me straight? (I do not use MicroCode Studio) I have downloaded the "Lite" version, but gave up on it... It didn't support my chips... and I didn't want to spend more money on this shell.

Dwayne

example of simple pin checks and controls.

Pin1 Var GPIO.1
Pin2 Var GPIO.2

if Pin1=High then Pin1=Low
if Pin2=1 then Pin2=0
end

trust issues
- 28th October 2004, 21:23
I think It's ok for me to program in MicroCode Studio, in the top left corner theres the drop down menu "Target Processor" and it has my 18F252 in it. Does this mean anything or will I have to use another program?

mister_e
- 28th October 2004, 21:28
Bad guess Dwayne... Microcode studio will support every PICs on the market. If he's not in the list, you can it if you edit the pic.ini file in the MCS directory. Maybe you use an older version.

If you want to compile with PIC18F serie, you must set MPASM as assembler in the View > PicBasicOption >assembler tab. In case MPASM is not set, PM will be used for. As is seems PM is not support 18F serie for now. This is why Dwayne.

Don't be affraid of MicroCode Studio. This is the best i know on the market... better than the shi... MPLAB. But again, it's my own opinion here.

Dwayne
- 28th October 2004, 22:05
Hello Steve,

Steve>>Bad guess Dwayne... Microcode studio will support every PICs on the market. If he's not in the list, you can it if you edit the pic.ini file in the MCS directory. Maybe you use an older version.<<


Then are you saying that the MicroCode Studio, you no longer need PBP to program your chip? I was under the impression that you had to have PBP *and* MicroCode Studio. Thus I bought PBP, because it was cheaper and had all my chips on it.


Dwayne

mister_e
- 28th October 2004, 22:43
Dwayne,
MicroCode Studio is a simple code,text editor + few powerfull utility. In fact you must have PBP + MPASM (if you use 18F series) to compile your code within MicroCode Studio.

MicroCode studio offer a bootloader for few PIC too. In this case you just need an little external circuit to program them.

In case the bootloader do not support your chip, you still need an external programmer like EPIC,PONYPROg, PicStart or any other Universal Programmer like BK Precision 844a. Since the code is compile as an HEX files, you can use anything you want.

Dwayne
- 29th October 2004, 14:49
Hello Steve,

Steve>>MicroCode Studio is a simple code,text editor + few powerfull utility. In fact you must have PBP + MPASM (if you use 18F series) to compile your code within MicroCode Studio.<<

This is what I call shell.

Dwayne