Help with C code for a PIC18f4550 GPS Clock

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

Help with C code for a PIC18f4550 GPS Clock

Postby t1d » Fri Sep 13, 2019 12:05 am

Background:
Windows 10/PIC18F4550/MPLAB X IDE v5.25/XC8 v2.10/C90/PICKit2 V2.61/PICCircuits programmer/ LCD is 1602 (HD44780 Clone) 8-Wired.

Built on my custom "Lunch Break" board, which is a "Pinguino" type PCB with sockets for the pin connections/All pin placements confirmed and checked for continuity/Pin to Pin wiring for control lines/Breadboard for the power distribution and the Contrast Pot./DuPont wires and a few jumpers.

I am using a 1602 LCD, instead of the 2004 LCD listed in the project. My understanding is it should work with the code, but I just won’t get the extra two lines of output. I have ordered 2004s.

This post looks similar to one I posted on the Microchip forum, but it is a completely different subject. It is a continuation of the same project’s development.
======================================================================

I am using this tutorial to make my first attempt at making a GPS Clock.
https://www.electronicwings.com/pic/gps ... pic18f4550
(See file links on the web page for originals.)

I plan to get the code working and then comment out everything but the time and date information. I will leave the remainder to activate in future GPS projects.

I flashed the hex that was provided, but I did not get any output displayed.

So, I used Ric’s trick to get a clean start on compiling the code, myself. = Create a new project; create blank header and .c files having the exact same titles; copy and paste the code from each header and .c file directly to the fresh, new pages, clean/compile.

The code did compile successfully, but with lots of warnings. I flashed the resulting hex, but I still didn’t get any output displayed.

My compiled code is at DropBox:
https://www.dropbox.com/s/a5bq1vjk82c36 ... X.zip?dl=0

Here’s the warnings:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CLEAN SUCCESSFUL (total time: 114ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/t1dun/Desktop/GPS/PIC Clock/Ewings_18F4550_GPS_Clean.X'
make -f nbproject/Makefile-default.mk dist/default/production/Ewings_18F4550_GPS_Clean.X.production.hex
make[2]: Entering directory 'C:/Users/t1dun/Desktop/GPS/PIC Clock/Ewings_18F4550_GPS_Clean.X'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=18F4550 -c -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/LCD_20x4_C_file.p1 LCD_20x4_C_file.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=18F4550 -c -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/GPS_info.p1 GPS_info.c
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=18F4550 -c -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/USART_Source_File.p1 USART_Source_File.c
GPS_info.c:85:26: warning: (373) implicit signed to unsigned conversion
GPS_info.c:90:42: warning: (373) implicit signed to unsigned conversion
GPS_info.c:108:39: warning: (373) implicit signed to unsigned conversion
GPS_info.c:126:38: warning: (373) implicit signed to unsigned conversion
USART_Source_File.c:14:16: warning: (373) implicit signed to unsigned conversion
LCD_20x4_C_file.c:60:30: warning: (373) implicit signed to unsigned conversion
LCD_20x4_C_file.c:62:30: warning: (373) implicit signed to unsigned conversion
LCD_20x4_C_file.c:64:30: warning: (373) implicit signed to unsigned conversion
LCD_20x4_C_file.c:66:30: warning: (373) implicit signed to unsigned conversion
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe" -mcpu=18F4550 -Wl,-Map=dist/default/production/Ewings_18F4550_GPS_Clean.X.production.map -DXPRJ_default=default -Wl,--defsym=__MPLAB_BUILD=1 -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/Ewings_18F4550_GPS_Clean.X.production.elf build/default/production/GPS_info.p1 build/default/production/LCD_20x4_C_file.p1 build/default/production/USART_Source_File.p1
Non line specific message::: advisory: (1492) using updated 32-bit floating-point libraries; improved accuracy might increase code size
LCD_20x4_C_file.c:70:: warning: (520) function "_LCD_Clear" is never called
USART_Source_File.c:19:: warning: (520) function "_USART_TxChar" is never called
USART_Source_File.c:26:: warning: (520) function "_USART_RxChar" is never called
USART_Source_File.c:40:: warning: (520) function "_USART_SendString" is never called

Memory Summary:
Program space used 3C28h ( 15400) of 8000h bytes ( 47.0%)
Data space used 122h ( 290) of 800h bytes ( 14.2%)
Configuration bits used 7h ( 7) of 7h words (100.0%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
ID Location space used 8h ( 8) of 8h bytes (100.0%)
Data stack space used 0h ( 0) of 6B0h bytes ( 0.0%)

make[2]: Leaving directory 'C:/Users/t1dun/Desktop/GPS/PIC Clock/Ewings_18F4550_GPS_Clean.X'
make[1]: Leaving directory 'C:/Users/t1dun/Desktop/GPS/PIC Clock/Ewings_18F4550_GPS_Clean.X'

BUILD SUCCESSFUL (total time: 11s)
Loading code from C:/Users/t1dun/Desktop/GPS/PIC Clock/Ewings_18F4550_GPS_Clean.X/dist/default/production/Ewings_18F4550_GPS_Clean.X.production.hex...
Loading completed
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I would think that these are the primary problems:
USART_Source_File.c:19:: warning: (520) function "_USART_TxChar" is never called
USART_Source_File.c:26:: warning: (520) function "_USART_RxChar" is never called
USART_Source_File.c:40:: warning: (520) function "_USART_SendString" is never called

I have just taken a look at the debugger, but I don’t know enough about it to use it effectively, yet. So, I am reaching out to learn what might be the problem and the cure.

Please remember that I am very much a novice. I look forward to your thoughts and suggestions. Thank you for your help.
t1d
 
Posts: 8
Joined: Thu Sep 12, 2019 1:52 pm

Re: Help with C code for a PIC18f4550 GPS Clock

Postby t1d » Mon Sep 16, 2019 1:36 am

This post has had a good many views, but no replies. Do I need to provide some other kind of information to help folks give me an answer? Thanks for your help.
t1d
 
Posts: 8
Joined: Thu Sep 12, 2019 1:52 pm

Re: Help with C code for a PIC18f4550 GPS Clock

Postby Roche » Mon Sep 16, 2019 10:00 am

Are yo sure the supplies to the display are correct?
Roche
 
Posts: 72
Joined: Fri Jul 11, 2014 12:35 pm
PIC experience: Professional 5+ years with MCHP products

Re: Help with C code for a PIC18f4550 GPS Clock

Postby t1d » Mon Sep 16, 2019 9:51 pm

Roche wrote:Are yo sure the supplies to the display are correct?
Well, I have double-triple-checked multiple times and I believe everything is correct. And, my demo board has better sockets than a bread board. All of the data connections are on it.

The power distribution is on the bread board and bread board connections are always in question. However, everything is powered.

The 2004 displays have arrived and I tried with one of those. I got the same result. All four lines give character squares, but not numbers, or letters. The contrast does adjust with the pot.

I can see the GPS data traffic on the Chip's Rx line with my oscilloscope. I am trying to set up my PC logic analyzer, but I have never used it before and there is a learning curve.

Does the display initiation code look to be correct?

Thank you for your help.
t1d
 
Posts: 8
Joined: Thu Sep 12, 2019 1:52 pm

Re: Help with C code for a PIC18f4550 GPS Clock

Postby Roche » Tue Sep 17, 2019 11:31 am

You could try just sending a known text string to the display - bypass all the GPS stuff for the moment.
Roche
 
Posts: 72
Joined: Fri Jul 11, 2014 12:35 pm
PIC experience: Professional 5+ years with MCHP products

Re: Help with C code for a PIC18f4550 GPS Clock

Postby t1d » Tue Sep 17, 2019 6:15 pm

Roche wrote:You could try just sending a known text string to the display - bypass all the GPS stuff for the moment.
Thanks, Roche. That is a good suggestion.
t1d
 
Posts: 8
Joined: Thu Sep 12, 2019 1:52 pm


Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 7 guests

cron