Author Topic: PIC 16f628 to Nokia LCD... help needed please :)  (Read 5541 times)

0 Members and 1 Guest are viewing this topic.

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
PIC 16f628 to Nokia LCD... help needed please :)
« on: January 12, 2011, 12:20:51 pm »
Hi guys. Okay, at this site: http://www.sunbizhosting.com/~spiral/3310lcd/3310.html resides a project written for a 16f628, which causes text to be displayed on an old Nokia dot matrix display. The issue I have, is that the only PIC I have right now, is a 16f627, and not a 16f628. It seems the author doesn't explain himself very thoroughly, and I am having massive problems compiling this for the 16f627 using MPLAB + Hi-Tech C. :(

I have tried building the circuit in Proteus ISIS with the supplied hex file, and the 16f628 model works, but when I drop in a 16f627... nothing! Also, he has made an omission by not connecting VSS to 3V in the schematic - fixed that.

I wonder if someone more seasoned would show me the way to go?

Thank you :)
 

Offline arcom

  • Contributor
  • Posts: 42
  • Country: hr
    • Arc's Lab
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #1 on: January 12, 2011, 02:24:16 pm »
Are you sure the program will fit within the 1KB memory of PIC16F627?
'627 and '628 are identical except for the memory size so a HEX for '628 should work in '627 provided that it fits in 1KB.

BTW: VSS goes to GND, not 3V.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #2 on: January 12, 2011, 02:51:48 pm »
Are you sure the program will fit within the 1KB memory of PIC16F627?
'627 and '628 are identical except for the memory size so a HEX for '628 should work in '627 provided that it fits in 1KB.

BTW: VSS goes to GND, not 3V.

Oops, that was what I meant - had only just woken up when writing this, thanks :D

Well the .HEX programs into the 12f627 okay, so is that assurance enough?
 

Offline arcom

  • Contributor
  • Posts: 42
  • Country: hr
    • Arc's Lab
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #3 on: January 12, 2011, 09:02:09 pm »
I've opened up the HEX file in my programmer and the problem is that the font data table is pushed at the end of memory which is why you cannot use 16F627 unless you recompile the code for it. When the code performes a jump to get the font data it loads an address which exceeds the memory page and the PIC hangs. I have tested it with 16F628 and it works OK.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #4 on: January 13, 2011, 01:26:09 am »
I've opened up the HEX file in my programmer and the problem is that the font data table is pushed at the end of memory which is why you cannot use 16F627 unless you recompile the code for it. When the code performes a jump to get the font data it loads an address which exceeds the memory page and the PIC hangs. I have tested it with 16F628 and it works OK.

Whoever this Ramandeep character who wrote the code & schematics, he is VERY VERY bad at documenting things. The schematic has errors, and the source code... well he doesn't even explain properly how to compile it - just leaves VERY brief, ambiguous note in "3310.c".

Would you mind explaining how I compile this in MPLAB & Hi-Tech C (both latest). Thanks
 

Offline arcom

  • Contributor
  • Posts: 42
  • Country: hr
    • Arc's Lab
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #5 on: January 13, 2011, 12:33:13 pm »
I successfully compiled the code for 16F627 but had to truncate the text.
So, in "main.c" instead of:
Code: [Select]
nokia_printmessage("I got this code from www,spiralbrain,tk Written by Ramandeep Singh :D");
write this:
Code: [Select]
nokia_printmessage("I got this code from...");

and hit the compile button.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #6 on: January 14, 2011, 02:02:27 am »
Whoever this Ramandeep character who wrote the code & schematics, he is VERY VERY bad at documenting things.
and you are VERY VERY bad programmer. you are lucky he did it "half open source". chaow!


I'll admit to that, which is why I asked.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #7 on: January 14, 2011, 02:07:18 am »
I successfully compiled the code for 16F627 but had to truncate the text.
So, in "main.c" instead of:
Code: [Select]
nokia_printmessage("I got this code from www,spiralbrain,tk Written by Ramandeep Singh :D");
write this:
Code: [Select]
nokia_printmessage("I got this code from...");

and hit the compile button.

Okay, how did you do that? I keep getting TONS of errors, and I don't know what to include (and what to add to project folders) and where :(

Thank you
 

Offline arcom

  • Contributor
  • Posts: 42
  • Country: hr
    • Arc's Lab
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #8 on: January 14, 2011, 09:22:03 am »
Are you sure you really want to know that? ;D
OK, here it goes: I opened the "main.c" file in Notepad, truncated the text and then used a command line with the following:
Quote
picc.exe main.c --chip=16f627

Can you be more specific as in what errors you get? "I keep getting TONS of errors..." is not really helpful.
 

Offline glossywhiteTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: PIC 16f628 to Nokia LCD... help needed please :)
« Reply #9 on: January 14, 2011, 07:14:35 pm »
Too many errors to list. I'll send you what I see, when I get a minute. I'll try your suggestion, thanks. The sooner I learn assembly the better - find it MUCH simpler. :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf