Autor Tema: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!  (Leído 6210 veces)

0 Usuarios y 2 Visitantes están viendo este tema.

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Transcribo la noticia completa !!
Fuente:
http://www.ccsinfo.com/newsdesk_info.php?newsPath=ALL&newsdesk_id=161

New TCP/IP in Project Wizard: A trick up your sleeve for your next Internet ready project!
Friday 08 November, 2013
CCS, Inc. Starting with the CCS C Compiler IDE 5.013, TCP/IP is new in the Project Wizard. Effortlessly connect an Ethernet or WiFi ready PIC® to a network. Just specify the interface (ENC28J60 Ethernet, MRF24WG0M 802.11G WiFi) and the SPI connections and the wizard will generate the hardware profile necessary for the TCP/IP stack. The wizard will work for Internet or external Ethernet devices.



Additional options are available in the tabs at the bottom of the setup page for IP and WiFi settings (if applicable) as well as setting up a project for E-mail, a Web Server, or a Telnet Server. These TCP/IP configuration settings are added automatically into the stack and the project. For Telnet servers, all that needs to be specified is the TCP Listen port and the stack is automatically configured for Telnet. In addition, when a TCP/IP project is created, all of the TCP/IP stack files are automatically copied into the project directory and the configuration files are tailored to this project.

Under the IP tab, using DHCP will automatically assign the device an IP address, otherwise the IP, Gateway, and Netmask addresses can be specified for a specific network.

When using WiFi, there are many options for connecting to a network, including SSID, network type (Infrastructure or AdHoc), region, and security mode. If the security mode is anything other than "Open", a passkey or pass phrase is required for connection and must be specified. Supported security modes are: Open, WEP-40, WEP-104, WPA with passkey or phrase, WPA2 with passkey or phrase, and WPA Auto with passkey or phrase. Additional hardware information must also be specified for the WiFi interface including the hibernate pin and external interrupt.



Getting a device set up to send E-mails has never been easier. Just fill in the required fields and all of the setup code is generated. The only thing left to do is to tell the stack to send the E-mail!



If you want to customize the E-mail body at runtime, such as sending a current ADC reading, it is as simple as a sprintf to the global body variable. The example below shows just how simple sending an email can be and one way to change the body at runtime.

while(TRUE) // in main()
{
StackTask();
StackApplications();


// User Code
if(BUTTON_PRESSED)
{
sprintf(SMTPClient.Body.szRAM,"ANALOG CHANNEL 0 = 0x%X", read_adc());
EmailNow();
}
}


To set up a simple web server, just specify the server port and the number of dynamic display fields and buttons to show on the page. The wizard generates a "pages" directory with the project including index.htm and index.xml files for the server. These can easily be customized or changed based on what you want the server to do, and helpful "TODOs" are added in the code where additional processing is needed.



The very minimum you have to do is handle the callback functions to the HTTP Stack. These are what make the changes on the web page and/or on the PIC. The below web page was created with two dynamic display fields (shown in the table) and three input buttons. The first dynamic field shows the current ADC reading on channel 0, and the second shows the current pressed/released state of a push button. The three input buttons are used to toggle LEDs on the board from within the page itself.



To accomplish this, the http_exec_cgi callback function is called with each key/value pair read in a GET/POST request before any web data is sent to the web browser, which in this case is set up to toggle LEDs. The http_format_char callback function is used to update the dynamic display fields (differentiated by "id") of the page itself, updating "str" with the new value of the element to be displayed. The wizard generates these functions, and all you have to do is fill in what you want each button to do and what each dynamic display element should contain.

unsigned int8 http_format_char(char* file, char id, char *str, unsigned int8 max_ret)
{
char new_str[25];
if(id == 0) //dynamic element 0
{
sprintf(new_str,"0x%X", read_adc());
strncpy(str, new_str, max_ret);
}
if(id == 1) //dynamic element 1
{
if(BUTTON_PRESSED)
new_str = "Pressed";
else
new_str = "Released";
strncpy(str, new_str, max_ret);
}
}

void http_exec_cgi(char* file, char *key, char *val)
{
if (stricmp(key, "button00")==0)
{
output_toggle(GREEN_LED);
}
if (stricmp(key, "button01")==0)
{
output_toggle(YELLOW_LED);
}
if (stricmp(key, "button02")==0)
{
output_toggle(RED_LED);
}
}


The wizard initially generates default index.htm and index.xml files for the page with initial values for the page title and heading, the left column of the table, and the button text. These can easily be changed by modifying the index.htm file, as was done on the example page. index.xml is used by the AJAX Javascript running on the webpage, which allows for the content on the page to refresh without having the user need to press the reload button on their browser.

CCS IDE Project Wizard includes USB as well as TCP/IP. The IDE requires a minimum operating system of Windows 95(or later) or Linux.
« Última modificación: 08 de Noviembre de 2013, 22:39:43 por MGLSOFT »
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado RALF2

  • Moderadores
  • PIC24H
  • *****
  • Mensajes: 2060
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #1 en: 08 de Noviembre de 2013, 22:36:02 »
Gracias por la informacion MGLSOFT  :-/ :mrgreen:

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Novedades de CCS: Ahora el Proyect Wizard incluye USB tambien!!!
« Respuesta #2 en: 08 de Noviembre de 2013, 22:38:29 »
La noticia completa:
Fuente:
http://www.ccsinfo.com/newsdesk_info.php?newsPath=ALL&newsdesk_id=162


Conjure up your USB PIC® project quickly with our new USB Project Wizard!
Friday 08 November, 2013
CCS, Inc. The recent release of CCS C Compiler IDE 5.013 introduces USB in the IDE Project Wizard! Easily configure the USB VID, PID, manufacturer string, description string or the bus power needed.

The wizard allows the use of one of three communication protocols:
Communication Device Class, or CDC, creates a virtual COM port on a PC. On Windows PCs, this is the legacy COM ports (such as COM1) which can be opened with legacy terminal software. The CCS CDC library allows the use of printf(), putc() and getc() to communicate to the host PC using the virtual COM port.
Human Interface Devices, or HID, is a simple protocol for things like Mice and Keyboards. This wizard allows the user to create a HID project using a vendor specific HID descriptor report. CCS also provides a PC program written in VB.NET to communicate with the PIC in this manner. CCS also provides HID keyboard and HID mouse examples for the PIC.
Bulk transfers is a method of reading/writing directly to the buffer endpoint. Using this method does require drivers for your operating system, but since XP Microsoft has been shipping WinUSB which is compatible with this mode. CCS does provide a VB.NET demo application to show how to use this driver to communicate with the PIC.



CCS IDE Project Wizard includes USB as well as TCP/IP. The IDE requires a minimum operating system of Windows 95(or later) or Linux.
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.


Desconectado soymoe

  • PIC18
  • ****
  • Mensajes: 456
    • El blog de Moe
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #4 en: 09 de Noviembre de 2013, 04:16:25 »
Qué simple queda todo
Hay que bajar algun paquete o solo es en la version nueva?

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18286
    • MicroPIC
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #5 en: 09 de Noviembre de 2013, 04:30:01 »
El wizard siempre ha funcionado sin instalar nada adicional. En la noticia pone que esto ha aparecido en la versión 5.013

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #6 en: 09 de Noviembre de 2013, 08:10:05 »
El Wizard es una de las cosas que me ha servido mucho a mi...

Cuando implemento CAN en un PIC que antes no use, me ha sido muy util.

Ni hablar del Modbus...

Hice aplicaciones en ethernet y puedo asegurar que si anda, esto ayudara a mucha gente a hacer aplicaciones rapido!!

Ni hablar del USB !!
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado AAR

  • PIC10
  • *
  • Mensajes: 1
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #7 en: 01 de Diciembre de 2013, 20:13:12 »
Hola.  ¿Alguien ha probado el Wizad con el TCPIP? Yo lo he intentado con el PIC18F4685 y al compilar da error.

Desconectado MLO__

  • Colaborador
  • DsPIC33
  • *****
  • Mensajes: 4581
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #8 en: 11 de Enero de 2014, 17:28:16 »
 :shock:

sera que hay alguna diferencia con este modulo??



El papel lo aguanta todo

Desconectado gera

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 2188
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #9 en: 11 de Enero de 2014, 20:37:00 »
Excelente!! Siempre quise dejar CCS y migrar a los compiladores de Microchip... pero es tan fácil de usar! y te ahorras tanto tiempo! jaja
Saludos!

"conozco dos cosas infinitas: el universo y la estupidez humana. Y no estoy muy seguro del primero." A.Einstein

Desconectado ChóN

  • PIC10
  • *
  • Mensajes: 18
    • HB Ingenieria
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #10 en: 12 de Diciembre de 2014, 12:31:02 »
Hola a todos, refloto este post debido a que he intentado utilizar el wizard TCP/IP (ENC28J60) para un webserver en CCS v5.025 sin resultados satisfactorios.
Probé generar proyectos para 18F4550 y 18F25J50 (ambos 32K ROM) y al compilar tengo errores del tipo "Out of ROM", es decir, la rutina main mínima excede la página de memoria del micro, ¿Es un bug del compilador, del stack, o sencillamente requiere micros más grandes?¿Alguien pudo probarlo?
Por otra parte probé el wizard para un 18F67J90 (Ethernet incorporado) y compila sin problemas.

Saludos.-
- ChóN -

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #11 en: 12 de Diciembre de 2014, 13:39:57 »
Intentalo para un PIC18F4685 o mayor.
Si quieres compilar el stack completo en un micro chico seguramete pasara eso tambien co el de Microchip, que sugiere usar PIC24 o mayor aun todavia.
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado ChóN

  • PIC10
  • *
  • Mensajes: 18
    • HB Ingenieria
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #12 en: 12 de Diciembre de 2014, 15:11:04 »
Intentalo para un PIC18F4685 o mayor.
Si quieres compilar el stack completo en un micro chico seguramete pasara eso tambien co el de Microchip, que sugiere usar PIC24 o mayor aun todavia.

Gracias por la respuesta.
Lo que más me llama la atención del nuevo stack de CCS es la ENORME cantidad de archivos que genera y compila por lo tanto, la gran mayoría son para dar compatibilidad, ya que usa el stack de microchip tal cual, mezclando código de C18, XC8, etc.
Tengo la vieja versión 3 del stack CCS funcionando sin problemas en un 4550, pero intente probar esta nueva ya que agrega funcionalidades como por ejemplo, importar las páginas web (genera un archivo .bin) por FTP una vez programado el micro.


Saludos.-
- ChóN -

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Novedades de CCS: Ahora el Proyect Wizard incluye Internet y WEB Page !!!
« Respuesta #13 en: 12 de Diciembre de 2014, 15:31:28 »
A todos los stack, con trabajo y sacandole funcionalidades, vas a poder ir metiendolos en micros mas pequeños, (no mucho) pero vas a tener que trabajar para lograrlo.
El Stack antiguo tenia pocas funciones, incluso si hacias paginas, estas no eran muy bonitas, y solo te permitia eso.
Ahora es bien potente, y lleva los mismo recursos que el de Microchip, ya que no hay ningun invento...
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.


 

anything