PIC 16f628 to Nokia LCD... help needed please :) - Page 1
Forum section: electronics / general

author: glossywhite
author_rank: Regular Contributor
timestamp: January 12, 2011, 12:20:51 pm
content: Hi guys. Okay, at this site:http://www.sunbizhosting.com/~spiral/3310lcd/3310.htmlresides 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

author: arcom
author_rank: Contributor
timestamp: January 12, 2011, 02:24:16 pm
content: 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.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 12, 2011, 02:51:48 pm
content: Quote from: arcom on January 12, 2011, 02:24:16 pmOops, that was what I meant - had only just woken up when writing this, thanksWell the .HEX programs into the 12f627 okay, so is that assurance enough?

author: arcom
author_rank: Contributor
timestamp: January 12, 2011, 09:02:09 pm
content: 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.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 13, 2011, 01:26:09 am
content: Quote from: arcom on January 12, 2011, 09:02:09 pmWhoever 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

author: arcom
author_rank: Contributor
timestamp: January 13, 2011, 12:33:13 pm
content: I successfully compiled the code for 16F627 but had to truncate the text.So, in "main.c" instead of:Code:nokia_printmessage("I got this code from www,spiralbrain,tk Written by Ramandeep Singh :D");write this:Code:nokia_printmessage("I got this code from...");and hit the compile button.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 14, 2011, 02:02:27 am
content: Quote from: shafri on January 13, 2011, 03:21:51 pmI'll admit to that, which is why I asked.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 14, 2011, 02:07:18 am
content: Quote from: arcom on January 13, 2011, 12:33:13 pmOkay, 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 whereThank you

author: arcom
author_rank: Contributor
timestamp: January 14, 2011, 09:22:03 am
content: Are you sure you really want to know that?OK, here it goes: I opened the "main.c" file in Notepad, truncated the text and then used a command line with the following:QuoteCan you be more specific as in what errors you get? "I keep getting TONS of errors..." is not really helpful.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 14, 2011, 07:14:35 pm
content: 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.