Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - shuckc

1
Web platform / Re: Demo query
I have added a couple of notes to the Contiki page http://dangerousprototypes.com/docs/Con ... b_platform about the expected usual network setup:

Network notes: These examples assume the Web Platform is wired with CAT5 cable to your home Broadband/DSL Router's Ethernet port, and you are working from a computer either on the same wireless or wired network. Direct connection (laptop to Web Platform) will not work so easily as there is no device to give out DHCP addresses.
4
Web platform / Re: Webplatform Contiki 2.5 port
Do something like "rm *.hex && rm *.out"

The build system does not "re-make" if the existing output files are there.

I am quite a bit better at Makefiles since I modified the platform scripts for ds-pic. If there's something I can fix easily I will do so any push it to github. Good luck!
5
Web platform / Re: Webplatform Contiki 2.5 port
Getting Contiki to build in MPLAB is a significant challenge due to the project structure. Makefiles are the way to go.

I also use Windows 7 64-bit and my builds work as per the instructions, so that is not your problem. You do need Cygwin for the makefile to work.

If you paste here any build errors I am sure we can fix it.

Chris
6
Bus Blaster JTAG debugger / Re: BusBlaster w/ Altera Stratix v4?
Yeah, it does work :-)

Code: [Select]
jtag> cable jtagkey vid=0x0403 pid=0x6010 interface=1
Connected to libftdi driver.
jtag> detect
IR length: 8
Chain length: 1
Device Id: 00000110111000011100000010010011 (0x06E1C093)
  Manufacturer: Xilinx (0x093)
  Part(0):      xc2c32a-vq44 (0x6E1C)
  Stepping:    0
  Filename:    /usr/share/urjtag/xilinx/xc2c32a-vq44/xc2c32a-vq44
jtag> cable jtagkey vid=0x0403 pid=0x6010 interface=0
Connected to libftdi driver.
jtag> detect
IR length: 20
Chain length: 2
Device Id: 00000010000010100011000011011101 (0x020A30DD)
  Manufacturer: Altera (0x0DD)
  Unknown part! (0010000010100011) (/usr/share/urjtag/altera/PARTS)
Device Id: 00000010010000001001000011011101 (0x024090DD)
  Manufacturer: Altera (0x0DD)
  Unknown part! (0010010000001001) (/usr/share/urjtag/altera/PARTS)
jtag>

And with the BSDL files loaded:

Code: [Select]
jtag> bsdl path /home/cshucks/bsdl
jtag> cable jtagkey vid=0x0403 pid=0x6010 interface=0
Connected to libftdi driver.
jtag> detect
IR length: 20
Chain length: 2
Device Id: 00000010000010100011000011011101 (0x020A30DD)
  Filename:    /home/cshucks/bsdl/EPM1270M256.BSD
Device Id: 00000010010000001001000011011101 (0x024090DD)
  Filename:    /home/cshucks/bsdl/EP4SGX230HF35.bsd
7
Web platform / Re: Free-RTOS memory usage
Yeah - to make it clear I gave up with FreeRTOS (kernel-enforced time switching) and concentrated on Contiki support (co-operative scheduling). Contiki has a file-system interface, although I've not used it.
8
Web platform / Re: Webplatform Contiki 2.5 port
No idea, I don't know the PIC24 architecture well enough to comment. The PIC32 port took me about a week to get going, albeit the Ethernet driver was already running by others, so I only had to do the Contiki wrapper.
9
Web platform / Re: Getting started with microchips TCP IP stack
There's an SNMP implementation for Contiki here http://code.google.com/p/contiki-snmp/
Slides: http://cnds.eecs.jacobs-university.de/s ... i-snmp.pdf

I would start simple, get the A2D side working on the web platform board and output it to the serial port. As a minimum you will need a protective diode and a resister network to get the battery voltage down to the 3.3V A2D range. Some people also use a mosfet to disconect the load from the battery when not charging. When you have the data sampling OK, I would look at the ethernet side and broadcast the readings as a binary UDP broadcast, and try to pick those up over the network. You can knock up a python GUI for any PC using my example very easily. Only then would I go to the trouble of trying to integrate that 50lbs of gorrilla SNMP implementation, as that's probably an order of magnitude more difficult than the rest of it.

Contiki docs: http://dangerousprototypes.com/docs/Con ... b_platform

Chris
11
Web platform / Re: Webplatform Contiki 2.5 port
I put a comment at the very bottom of https://github.com/shuckc/contiki-mirro ... m/serial.c - in short, PIC30 C library defaults write() to UART1, so it's taken care of.

Code: [Select]
void dbg_setup_uart(void)
{    ...
//peripheral setup
    U1BRG = 85;              //86@80mhz, 85@79.xxx=115200
    U1MODE = 0;              //clear mode register
    U1MODEbits.BRGH = 1;    //use high percison baud generator
    U1STA = 0;              //clear status register
    U1MODEbits.UARTEN = 1;  //enable the UART RX
    IFS0bits.U1RXIF = 0;    //clear the receive flag
    U1STAbits.UTXEN = 1;    //enable UART TX
// with PIC30 compiler standard library the default printf() calls
/// write(), which is soft-linked to the library default write() function
// outputing to UART1
}
12
Web platform / Re: Webplatform Contiki 2.5 port
I'd really like to hook some buttons on the web page to the LED's to make the demo better, plus post sensor readings to Patchube or  something. I have a way to read/rewrite pages to the flash eeprom, it's basic (and small) one day I'll get that cleaned up and uploaded to Github. Then we might have a possible WP default firmware on our hands :-)

My own use for the port is a 7-day multi-zone heating controller: DS18S20 temp probes, a relay, solenoid controllers (w/ SN754410). I was trying to put together another board for a LCD/joystick control but never got it finished.
13
Web platform / Re: Webplatform Contiki 2.5 port
The configuration bits aren't set properly when I build with the contiki "make" system for some reason I've never tracked down... so those hex files need some help if you flash them to a naked board.

To work around I set config bits explicitly with the Microchip pickit3 programmer, or else use the USB serial -programmer firmware  DP uses as that does not seem to overwrite working config bits with bad ones. anyway glad it works for you :-)
14
Web platform / Re: Add 4 serial RS-232 ports
Here's some example code (based on Ian's) used by the webplatform to assign UART0 to be 'wired' to a particular set of pins. In this case it's to pins RP14/RP15 which the PCB has routed to the FTDI chip for USB serial port debugging.

https://github.com/shuckc/contiki-mirro ... m/serial.c
Code: [Select]
void dbg_setup_uart(void)
{

//UART1 SETUP
//UART can be placed on any RPx pin
//configure for RP14/RP15 to use the FTDI usb->serial converter
//assign pin 14 to the UART1 RX input register
//RX PR14 (input)
RPINR18bits.U1RXR = 14;
//assign UART1 TX function to the pin 15 output register
//TX RP15 (output)
RPOR7bits.RP15R = 3; // U1TX_O

//peripheral setup
    U1BRG = 85;              //86@80mhz, 85@79.xxx=115200
    U1MODE = 0;              //clear mode register
    U1MODEbits.BRGH = 1;    //use high percison baud generator
    U1STA = 0;              //clear status register
    U1MODEbits.UARTEN = 1;  //enable the UART RX
    IFS0bits.U1RXIF = 0;    //clear the receive flag
    U1STAbits.UTXEN = 1;    //enable UART TX
 
}
I have another example I can dig out where I route UART1 to pins on the extension port "GPIO" header as an application serial port. You need to look up in the  DP schematic which pins from IO1 header you want, and the corresponding RPx number.
    http://dangerousprototypes.com/docs/Web ... I/O_Header

Code: [Select]
IO1 pinout
pin Lbl  PIC  PORT#  RP# Output Max input
1 IO1 35 A9 -   3.3v 5.5v
2 IO2 36 C3 19 3.3v 5.5v
3 IO3 37 C4 20 3.3v 5.5v
4 IO4 38 C5 21 3.3v 5.5v
5 IO5 42 B6 6   3.3v 5.5v
6 IO6 41 B5 5   3.3v 5.5v
7 IO7 44 B8 8   3.3v 5.5v
8 IO8 43 B7 7   3.3v 5.5v
9 GND -   - - GND -
10 3.3V - - - 3.3v -

You should be able to wire four devices to have there own 2 pins each (8 pins). eg. RP19,20 for device #1, RP 21,6 for device 2 etc. There's only 7 RP ports on Header IO1, so you'll need to steal another from somewhere else. My advice here is to re-purpose one of the lines going to the SPI EEprom chip since they are also taken to a pin header (I've done this to get I2C on this board). Your software needs to modify the values in registers RPINR18 and RPOR7 to select which module of the four you want to speak to each time.

Bear in mind the pins are only 3.3V outputs, that could be lower than TTL serial UART converters take on the input - check the datasheet as you might need a transister driver to pull it up. If your devices are full RS232 serial ports, they will be outputting/expecting -12V/8V or whatever it was that seemed a good idea in the 70's. Grab a few breadboard compatible MAX234's dual drivers from Maxim on eval, and recommend a resisters divider for the output 5V -> 3.3V shifter to avoid sinking too much through the input buffer protection diode and you should be set.

Chris
15
Web platform / Re: Add 4 serial RS-232 ports
Do all devices talk to you at the same time, do they round-robin? Do you initiate the comms or the other devices? I'm wondering if it's possible to use the one free hardware UART module and use the peripheral mapping feature to switch the UART between different pins in the GPIO header. Might be possible to use  interrupt on change to re-config the UART in time to get the second byte of each serial communication if that is enough. Obviously much easier if you are the initiator as you can rewire Rx before Tx.

If you need truly asynchronous reception on 6 lines, and can get away with RX-only with a low baud rate it should be possible to use interrupt on change features to bit-bash the RX ports on GPIO lines. Use a free running reference timer and sample-on change then some analysis to infer the bits sent. More tricky if they are all using there own oscillator sources due to drift (ie. might not be able to share a common timer unless you have a very quick timer to oversample).

Logging messages out to external flash and the web gui are more tricky :-)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01572450200session_write_close ( )...(null):0
20.01612581816ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01612582592Database_MySQL->query( ).../DatabaseHandler.php:119
40.05932721352Database_MySQL->error( ).../Db-mysql.class.php:273