Skip to content

Commit

Permalink
Merge pull request #46 from nielsonm236/Add-UART-for-debug
Browse files Browse the repository at this point in the history
Add uart for debug
  • Loading branch information
nielsonm236 authored Feb 17, 2021
2 parents 1dea357 + 920e874 commit b155a95
Show file tree
Hide file tree
Showing 19 changed files with 4,548 additions and 4,074 deletions.
Binary file modified Network Module Manual - Code Rev 20210208 0523.docx
Binary file not shown.
2 changes: 1 addition & 1 deletion NetworkModule/.Idea_Groups/Vector_File.grp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Group File Created by IDEA
# Project: <NetworkModule>
# Tue Feb 09 18:19:34 2021
# Tue Feb 16 12:23:36 2021
#
"networkmodule_vector.o"
402 changes: 205 additions & 197 deletions NetworkModule/.Idea_Temp/COBJ.TMP

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions NetworkModule/.Idea_Temp/IDEA.ERR
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
- NetworkModule_vector.o
- crts0.sm8
- ds18b20.o
- enc28j60.o
- gpio.o
- httpd.o
- main.o
- mqtt.o
- mqtt_pal.o
- spi.o
- timer.o
- uart.o
- uip.o
- uip_arp.o
- uip_tcpapphub.o
- libisl0.sm8
- libm0.sm8
- NetworkModule_vector.o
- crts0.sm8
- ds18b20.o
- enc28j60.o
- gpio.o
- httpd.o
- main.o
- mqtt.o
- mqtt_pal.o
- spi.o
- timer.o
- uart.o
- uip.o
- uip_arp.o
- uip_tcpapphub.o
- libisl0.sm8
- libm0.sm8
NetworkModule_vector.o:
C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\crts0.sm8:
ds18b20.o:
enc28j60.o:
gpio.o:
httpd.o:
main.o:
mqtt.o:
mqtt_pal.o:
spi.o:
timer.o:
uart.o:
uip.o:
uip_arp.o:
uip_tcpapphub.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)isxdig0.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)memmov.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)strcat0.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)strlen0.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)bmulx.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)eeprom.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)fmul.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ftol.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)itolx.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)itoly.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladc.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladd.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lcmp.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgadc.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgadd.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lglsh.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgor.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgsbc.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgursh.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lreg.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ltor.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ludiv.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ldiv.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgneg.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lneg.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lumod.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lzmp.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)rtol.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)sdivx.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)uitof.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)utolx.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)xreg.o:
(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)yreg.o:
4 changes: 2 additions & 2 deletions NetworkModule/.Idea_Temp/IDEABLD.BAT
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
REM COMMAND FILE BUILT BY IDEA
REM Tue Feb 09 18:19:31 2021
REM Tue Feb 16 12:23:32 2021
REM
cxstm8 -v -l +strict +debug +modsl0 +split +warn "networkmodule_vector.c"
cxstm8 -v -l +strict +debug +modsl0 +split +warn "ds18b20.c" "enc28j60.c" "gpio.c" "httpd.c" "main.c" "mqtt.c" "mqtt_pal.c" "spi.c" "timer.c" "uip.c" "uip_arp.c" "uip_tcpapphub.c"
cxstm8 -v -l +strict +debug +modsl0 +split +warn "ds18b20.c" "enc28j60.c" "gpio.c" "httpd.c" "main.c" "mqtt.c" "mqtt_pal.c" "spi.c" "timer.c" "uart.c" "uip.c" "uip_arp.c" "uip_tcpapphub.c"
clnk -v -sa -o "NetworkModule.sm8" -m "NetworkModule.map" "networkmodule.lkf"
chex -f3 -o "NetworkModule.sx" "NetworkModule.sm8"
clabs "NetworkModule.sm8"
8 changes: 0 additions & 8 deletions NetworkModule/DS18B20.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ void get_temperature()
// close enough for this application.


// uint8_t i;
int i;
uint8_t j;
uint8_t device_num;
Expand Down Expand Up @@ -290,7 +289,6 @@ int reset_pulse()
{
// Generates a master reset pulse on the specified IO
// The pulse must be a minimum of 480us
// uint8_t rtn;
int rtn;

PC_ODR |= 0x40; // write IO ODR to 1
Expand Down Expand Up @@ -348,9 +346,7 @@ int read_bit()
// pullup working in about 1/2us with a 12 inch wire lead. Longer leads to
// the DS18B20 may result in a slower rise time.
// After reading a bit we must wait 60us before reading the next bit.
// uint8_t nop_cnt;
int nop_cnt;
// uint8_t bit;
int bit;

bit = 0;
Expand All @@ -371,7 +367,6 @@ int read_bit()

void write_bit(uint8_t transmit_bit)
{
// uint8_t i;
int i;

// To send a 1 bit we need to pulse the output low for a minimum of 5us and
Expand Down Expand Up @@ -409,7 +404,6 @@ void FindDevices(void)
// found (a value equal to one less than the number of devices found since
// the index is 0, 1, 2, 3, 4 for the devices).

// uint8_t m;
int m;

numROMs = -1; // -1 indicates no devices
Expand Down Expand Up @@ -520,9 +514,7 @@ uint8_t Next(void)

uint8_t dallas_crc8(uint8_t *data, uint8_t size)
{
// int8_t i;
int i;
// uint8_t j;
int j;
uint8_t inbyte;
uint8_t mix;
Expand Down
20 changes: 10 additions & 10 deletions NetworkModule/Enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@
#include "uipopt.h"
#include "timer.h"
#include "main.h"
#include "uart.h"

#if DEBUG_SUPPORT != 0
// Variables used to store debug information
extern uint8_t debug[NUM_DEBUG_BYTES];
#endif // DEBUG_SUPPORT != 0

extern uint8_t RXERIF_counter; // Counts RXERIF errors
extern uint8_t TXERIF_counter; // Counts TXERIF errors
extern uint32_t TRANSMIT_counter; // Counts any transmit


extern uint8_t RXERIF_counter; // Counts RXERIF errors
extern uint8_t TXERIF_counter; // Counts TXERIF errors
extern uint32_t TRANSMIT_counter; // Counts any transmit
extern uint8_t stored_config_settings; // Config settings stored in EEPROM
extern uint8_t OctetArray[11]; // Used in conversion of integer values to
// character values


// SPI Opcodes
Expand Down Expand Up @@ -613,11 +614,10 @@ void Enc28j60Init(void)
Enc28j60WritePhy(PHY_PHCON1, 0x0000);
}

#if DEBUG_SUPPORT == 2
// Read the ENC28J60 revision level and store in debug[22];
debug[22] |= (uint8_t)(Enc28j60ReadReg(BANK3_EREVID));
update_debug_storage1();
#endif // DEBUG_SUPPORT == 2
#if DEBUG_SUPPORT == 7 || DEBUG_SUPPORT == 15
// Read the ENC28J60 revision level and store for output to the UART
debug[22] = (uint8_t)((Enc28j60ReadReg(BANK3_EREVID)) & 0x07);
#endif // DEBUG_SUPPORT

// Enable Packet Reception
Enc28j60SetMaskReg(BANKX_ECON1, (1<<BANKX_ECON1_RXEN));
Expand Down
Loading

0 comments on commit b155a95

Please sign in to comment.