---
title: "PIC24/33 DHCP Can't get DHCP_ACK"
url: "https://maker.wiznet.io/forum/10867"
markdown_url: "https://maker.wiznet.io/forum/10867/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "nealmartini"
created: "2015-02-25T22:20:22+09:00"
last_activity: "2017-05-04T08:35:34+09:00"
language: "en"
views: 739
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# PIC24/33 DHCP Can't get DHCP_ACK

## Question

Asked by nealmartini on 2015-02-25 in Ethernet Chips.

I have a project that has been successfully working for several months using a static IP address. Over the last two weeks I have been trying to get connected using DHCP.

Using the code example for the STM32F on the WIZnet site I wrote C code for my dsPIC33 processor. Everything compiles without errors. When I run I can see I get to the DHCP_OFFER being correctly received with a valid router IP. But I can’t get to the DHCP_ACK. The code then times out after 10 secs.

Does anybody have DHCP successfully working on a PIC 16 bit processor?

Neal

## Replies

### Reply 1 by hjjeon0608, 2015-05-11

Hi,

Plz upload your packet capture file using like wireshark.

### Reply 2 by Coccoliso, 2015-05-11

I used PIC24 devices with Firewing Basic compiler converting the original source and runs both DHCP and DNS perfectly ([url][http://www.firewing.info/pmwiki.php?n=FirewingUser.W5500\[/url\]](http://www.firewing.info/pmwiki.php?n=FirewingUser.W5500%5B/url%5D)).
I’ll point out one thing that can happen as I wrote previously in this forum… [url][Problems while compiling dhcp.c file](https://forum.wiznet.io/t/problems-while-compiling-dhcp-c-file/1424/1)] 16/32 bit compiler optimize the structures and in some cases mixing different types sent frame does not respect the original fields position and adds some compensation bytes.
I solved it by sending the different fields of the structure individually however there are some directive in compiler to prevent this.

---

Source: https://maker.wiznet.io/forum/10867
