programming PIC16f877 using all-11

hi,

i cant seem to be able to burn my code properly (i am not sure but i think that this is the problem). i used pcwh pic c compiler to write my code, which does nothing but turn a few ports on. i compiled the code and used waccess software with all 11 programmer to burn the hex file generated.

now this is where i think the trouble seems to come in. when i try to load the hex file in to the buffer i am prompted to select the file format and i have the following options:

  1. Binary
  2. Intel Hex
  3. Motorola S Record
  4. PICES HEX
  5. 8Bits INHX8M
  6. 16Bits INHX16

i used pices initially, but it didnt work. then i tried all the rest of them. it didnt work.

can anyone help me in this context. i am attaching the code too although its just a test:

#include #device *=16 ICD=TRUE #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=12000000) #use rs232(baud=9600, xmit=PIN_B0, rcv=PIN_B1)

void main() { set_tris_c(0x00); set_tris_d(0x0f0f); delay_ms(10); output_d(0x79); output_high(PIN_A0); while(1) { printf("helloooo dolly"); delay_ms(1000); output_c(0xaa); } }

Reply to
shehry
Loading thread data ...

Just out of curiosity, what kind of object file (8-bit hex, 16-bit hex or binary) have you asked your compiler to output?

I'm not familiar with CCS, but this looks like it might have problems. Why 12 bits for the TRISD register, for example?

Didn't the compiler vendor supply a known-working blink an led "hello world" demo program?

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

PCWH, can develop both 8 and 16 bit file formats. In your main screen, select 'options', 'file formats'. The screen displayed sets the hex output format, in the tick boxes at the top right. The 16bit format, is the normal one, and is the format referred to above as 'INHX16' (Intel Hex extended 16bit), while the 8bit format is 'INHX8'. There are quite a few 'comments' about the example code though. The file to be programmed, will be called 'filename.hex', where 'filename.c' is your source code name. You are setting the TRIS registers, but the compiler _by default_, will run in 'standard IO' mode, where it generates TRIS controls as ports are accessed. If you want to use TRIS yourself, select 'fast_io' for the ports concerned. Look in the manual for this. You are setting 'ICD=true'. Beware. If you do not have the ICD control pins properly loaded, this will stop the chip running. Are you sure your crystal is suitable for the chip?. If your chip has a -04 suffix on the part number, it is a 4MHz part, and though these will operate up to 10MHz on higher supply voltages, these do not support 12MHz. Have you got MCLR pulled up to 5v?. Have you got both supply connections made?. The chip does need them.

Best Wishes

Reply to
Roger Hamlett

"shehry" schreef in bericht news: snipped-for-privacy@g44g2000cwa.googlegroups.com...

I'm almost sure that pcwh produces intel hex format.

You should be able to see "helloooo dolly" somewhere in the hex dump window of your programmer software. If not, you loaded it with the wrong file format for sure.

--
Thanks, Frank.
(remove \'q\' and \'.invalid\' when replying by email)
Reply to
Frank Bemelman

thanks a lot to all of you...especially to you roger. you removed some of my confusions concerning the tris register. but this time actually the problem was something else. i accidently inserted a 330pf capacitor instead of a 33 pF one :( .

thanks a lot to the rest of you too...you're all great :)

Reply to
shehry

Those zeros, are sent to get you!....

Best Wishes

Reply to
Roger Hamlett

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.