Jump to content
43oh

chicken

Members
  • Content Count

    908
  • Joined

  • Last visited

  • Days Won

    85

Reputation Activity

  1. Like
    chicken got a reaction from bluehash in ? CodeForge == CodeRipoffRepo | CodeForge == TrojanRepo   
    Figured it out, the site uses a scheme well-tested by file-sharing websites to make users upload content. Users can access more content faster if they have enough points. To get points you either pay or upload content.

    Works great to amass a lot of content without paying/working for it, and you can blame the few bad apples among your users when the owners of content complain. Hard to complain though if your code has a liberal OS license, however there's also plenty of copyrighted code on that site.

  2. Like
    chicken got a reaction from RobG in ? CodeForge == CodeRipoffRepo | CodeForge == TrojanRepo   
    Figured it out, the site uses a scheme well-tested by file-sharing websites to make users upload content. Users can access more content faster if they have enough points. To get points you either pay or upload content.

    Works great to amass a lot of content without paying/working for it, and you can blame the few bad apples among your users when the owners of content complain. Hard to complain though if your code has a liberal OS license, however there's also plenty of copyrighted code on that site.

  3. Like
    chicken got a reaction from dubnet in ? CodeForge == CodeRipoffRepo | CodeForge == TrojanRepo   
    Figured it out, the site uses a scheme well-tested by file-sharing websites to make users upload content. Users can access more content faster if they have enough points. To get points you either pay or upload content.

    Works great to amass a lot of content without paying/working for it, and you can blame the few bad apples among your users when the owners of content complain. Hard to complain though if your code has a liberal OS license, however there's also plenty of copyrighted code on that site.

  4. Like
    chicken reacted to pine in To stop drolling in front of those Arduino Yun web pages...   
    Yes, I am glad to share. As far as I understand about the Arduino Yun:
    Is a marriage of the ATmega32u4 and a Atheros AR9331 400MHz processor with WiFi. It is all on a standard UNO form factor. The Atheros part runs a linux distribution called Linino Linino handles the USB host, SD card, ETH, and WiFi Linino communicates with the ATmega through an underlying serial bridge A customized library built in for program on the ATmega to communicate with Linino, so that Arduino hobbyist / developers alike can instantly enjoy the features available on the Atheros. In my setup it is impossible to make it as compact as the Yun, but all the key features like WiFi, physical ethernet, and USB port (with many supported devices like web cam from OpenWrt) are present.
     
    The line up - TP-Link WR703N, 4-port USB hub, SanDisk 16G flash drive, and mini USB converter for the F5529 LaunchPad.
     
    The wireless router in my setting is a TP-Link WR703N. It sports a similar processor in the Yun, but with a lot less memory. It is a popular router among OpenWrt enthusiasts. Installing it is very simple:
    Buy the router. Please note, do not get the WR-702N for this purpose. It looks exactly the same except missing the USB port. OpenWrt will not work in 702N. Check the version on the router. There are a few of them owing to year of manufacture. Most of the time the AA version will work. Just to be sure. Download the appropriate binary image from OpenWrt according to the router version, and also pick either JFFS2 or squashFS image. I picked JFFS2 as it looks like complete recovery (factory restore) is easier. Actually I did that twice already, one for 100% disk utilization and another for having enough test drive and reset for a fresh install. Plug in the router to PC with both usb (just for power) and wired network, set PC network interface to 192.168.1.x/24, and then open browser http://192.168.1.1  that will bring up the TP-Link router admin page, and then upload the OpenWrt firmware using the standard interface that come with the router for firmware upgrade. That's it, when the router auto reboot, the OpenWrt interface will be up in the browser. From there configure the wireless network etc. At this point, we can also access it through ssh to 192.168.1.1. But firstly we have to telnet to it (through wired interface 192.168.1.1 by default), set root password by passwd, logout, and then login using ssh. The internal flash is very small, so expanding with an external flash memory stick is highly recommended. There are several methods and I picked the extroot method which is quite nice. It transfer the whole internal flash content to the external stick, and from that point on the router boot from the memory stick, any changes will be on the stick. But if the stick is not present at boot time, the internal flash will take up although it is the snapshot image when the external flash is created.
     
    Now the fun part begin! Even though the flash storage on the router is very limited, but I believe there should be enough room for a quick test drive by installing the usb acm driver and screen. When it's done, program a LaunchPad with serial communication code, plug in the USB host port on the router, and voila.
     
    A simple test code in Energia used that will light up the green LED when H key is pressed and off when L key is pressed, and when the user button is clicked on the LP the console will show the ascii code. Although the code did not show any Internet related stuff, but suffice it to demo the communication capability between the LP and the router through serial.
    /* Test program for new F5529 LP with OpenWRT WR-703N Serial communication 115200, ttyACM1 On OpenWRT: screen /dev/ttyACM1 115200,parenb,-cstopb,cs8 */ /* DigitalReadSerial with on-board Pushbutton Reads a digital input on pin 5, prints the result to the serial monitor This example code is in the public domain. */ const int ledPin = GREEN_LED; // the pin that the Green LED that is attached to on Launchpad const int ledErrPin = RED_LED; // the pin that the Green LED that is attached to on Launchpad int incomingByte; // a variable to read incoming serial data into // digital pin 5 has a pushbutton attached to it. Give it a name: int pushButton = PUSH1; int clickCount = 0; long lastDebounceTime = 0; // the last time the output pin was toggled long debounceDelay = 100; // the debounce time; increase if the output flickers int lastButtonState = LOW; // the previous reading from the input pin int buttonState; // the current reading from the input pin // the setup routine runs once when you press reset: void setup() { // initialize serial communication at 115200 bits per second: Serial.begin(115200); // make the on-board pushbutton's pin an input pullup: pinMode(pushButton, INPUT_PULLUP); pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); pinMode(ledErrPin, OUTPUT); digitalWrite(ledErrPin, HIGH); } // the loop routine runs over and over again forever: void loop() { // read the input pin: int reading = digitalRead(pushButton); // print out the state of the button: // -- Debounce routine // If the switch changed, due to noise or pressing: if (reading != lastButtonState) { // reset the debouncing timer lastDebounceTime = millis(); } if ((millis() - lastDebounceTime) > debounceDelay) { // whatever the reading is at, it's been there for longer // than the debounce delay, so take it as the actual current state: buttonState = reading; // if button S1 P2.1 is clicked, send message to BT server if (buttonState == 0) { Serial.print("["); Serial.print(clickCount++); Serial.println("] On"); delay(100); } } if (Serial.available() > 0) { // read the oldest byte in the serial buffer: incomingByte = Serial.read(); if (incomingByte == 'H' || incomingByte == 'h') { // if it's a capital H (ASCII 72), turn on the LED: digitalWrite(ledPin, HIGH); Serial.print("[ACK] "); Serial.println(incomingByte); } else if (incomingByte == 'L' || incomingByte == 'l') { // if it's an L (ASCII 76) turn off the LED: digitalWrite(ledPin, LOW); Serial.print("[ACK] "); Serial.println(incomingByte); } // blink to acknowledge digitalWrite(ledErrPin, HIGH); delay(50); digitalWrite(ledErrPin, LOW); delay(50); digitalWrite(ledErrPin, HIGH); delay(50); digitalWrite(ledErrPin, LOW); delay(50); digitalWrite(ledErrPin, HIGH); delay(50); digitalWrite(ledErrPin, LOW); delay(50); digitalWrite(ledErrPin, HIGH); delay(50); digitalWrite(ledErrPin, LOW); delay(50); digitalWrite(ledErrPin, HIGH); } } After programming the LP with the above code in PC, plug the LP into the USB host of the 703N, The LP should be recognised under /dev/ttyAMC1 if kmod-usb-acm is installed in the 703N. Then run the following at the ssh shell:
    screen /dev/ttyACM1 115200,parenb,-cstopb,cs8 You can then press H or L to turn on or off the Green LED on the LP. On the other hand, click the LP user button and you can see the response from the ssh console. (To exit screen, press CTRL-A, and then CTRL-\, and then answer y)
     
    This setup show how simple it is to bring wireless capability to the LaunchPad. There are much better way to connect to the Internet like the TI CC wifi chips and related BPs. However TI eStore won't sell these to where I live. And there is also the fact that the Arduino team did not just wire the hardware together to make the Yun, they developed and provided a bridge library so that it is very easy to access the wireless capability without much work on the Lininio side. This setup with the TP-link router is quite a good alternative with the freedom and flexibility.
     

  5. Like
    chicken reacted to KwaiChang in [POTM] dAISy - A Simple AIS Receiver   
    I looked at your layout and it looks like your traces for the radio are not 50 ohms but ~65. How I did this is using AWR tx-line calculator(its free) , its really helpful when dealing with trace impedances.  When doing RF stuff you always need to be conscious of impedance.  Also using an SMA connector will help because it is designed for 50ohm impedance the pins you have right now are probably also messing with your signal because the impedance is probably greater than 50ohms. 
  6. Like
    chicken got a reaction from yyrkoon in [POTM] dAISy - A Simple AIS Receiver   
    Overview
    dAISy (do AIS yourself) is a very simple AIS receiver that I developed from scratch. It is built around the Silicon Labs EZRadioPRO Si4362 receiver, using a Texas Instruments MSP430G2553 MCU for processing and the MSP-EXP430G2 v1.5 LaunchPad as development platform.

    The complete project source code and schematics are available on GitHub: https://github.com/astuder/dAISy

    Update 5/18/2015: A finished, self-contained AIS receiver based on this project is now available for purchase in my web store.
     
    AIS, short for Automatic Identification System, is a standard for tracking ships. Ships advertise their position, course and other information with short transmissions on specific frequencies (161.975 MHz and 162.025 MHz). More on Wikipedia.
     
    An AIS receiver, like dAISy, receives and decodes AIS transmissions. It then re-packages the raw data into NMEA sentences (specifically formatted ASCII strings). Finally, using a serial connection, these strings are forwarded to more capable equipment for further processing.
     

     
    If you're the lucky owner of a tricked out boat, you could connect dAISy to your navigation computer. For land lobbers like me, a more common use case is to run naval mapping software that supports AIS data input on a PC. In the screenshot below I've connected dAISy to OpenCPN (link), an open source chart plotter and navigation software.
     

     
    On the top right you can see my setup war-driving at the Seattle waterfront as my lab is too far from the coast to receive anything. The LaunchPad sits on the dashboard with a white USB cable connecting to the notebook computer in the foreground.
     
    dAISy's data is fed into OpenCPN, bottom right shows a log of the serial data received. OpenCPN maintains a database of all the collected data (lower left) and visualizes nearby ships on a map (top center), including past and projected course. Hovering the mouse over a ship will display its name (text on yellow ground) and clicking it will reveal more detail (top left).
     
    Hardware
    I wanted to build my own, non-SDR, AIS receiver for a long time. There are a few projects floating around the internet (e.g. here) which refer back to an article by Peter Baston, published 2008 in Circuit Cellar magazine (copy available here gone.. google for Peter Baston Circuit Cellar to find other copies). Unfortunately, the CMX family of modem ICs by CMS Microcircuits (link) used in these projects are relatively expensive ($15+) and hard to find for hobbyists. In addition you'd need a radio to do tune into and down-convert from the ~162 MHz carrier frequency.
     
    So I was quite excited when earlier this year a parametric search on Mouser brought up a new IC  that covered the required range (162 MHz) and modulation (GMSK). And best of all, available in single quantities for $3.56 $2.27 $2.22! (link)
     
    The Silicon Labs EzRadioPRO Si4362 (link) is a single chip receiver that covers frequencies from 142 to 1050 MHz and supports various modulations, including GMSK. It comes in a tiny 20-pin QFN package and the only external parts required are a 30 MHz crystal, an antenna with a few capacitors and inductors for impedance matching, and finally some decoupling caps and pull-down resistors.
     
    Time to whip up a breakout board. I used the opportunity to give KiCad a try and quite like it.
     
    Here's the schematic:

     
    And the layout:

     
    I used OSHPark to make the PCBs. At a smidgen over one square inch it cost  $5.15 for 3 copies:

    http://oshpark.com/shared_projects/QUWi71r4
     
    Note that the layout still has three issues that I already fixed in the schematic:
    GPIO0 and GPIO1 were flipped SDO required a pull-down resistor as the radio leaves it floating when not actively sending, which confused the hell out of me while trying to figure out the communication protocol. Lastly, the holes for the headers turned out to be slightly too small to comfortably fit the cheap breakout headers I had at hand. Edit: Here's Rev B where I fixed these issues: http://oshpark.com/shared_projects/WI6u3Qmk
     
    Which brings us to the BOM:
    Silicon Labs Si4362 (U1) 30 MHz crystal (X1) Si4362 datasheet specifies <11 pF load capacitance, but a crystal specified for 12pF load capacitance seems to work fine too Antenna/LNA matching network, calculated based on SiLabs AN643 (link, approx. values, +/- 5% shouldn't matter too much): 75 ohm (dipole): 10 pF (CR1), 5 pF (CR2), 280 nH (LR1), 200 nH (LR2) 50 ohm: 12 pF (CR1), 6 pF (CR2), 240 nH (LR1), 160 nH (LR2) Decoupling caps: 100 pF, 100 nF, 1uF (C1, C2, C3) Pull-down resistors 100 k (R1, R2) First thing I noticed when I received the parts: The 20-pin QFN at 4x4 millimeters is tiny!

     
    I mounted it by first tinning the pads with a small quantity of solder. I then added flux and placed the chip on the pad. I then used a hot air station to carefully reflow the solder. Worked the first time around.

    After using jumper wires to figure out how to talk to the chip, I mounted the breakout board on a makeshift BoosterPack using perfboard, double-sided tape and wire (see picture at the top of the post).



    Here's how I ended up connecting the breakout board to the LaunchPad / MSP430G2553:
    SEL -> P1.4 (SPI chip select) SCLK -> P1.5 (SPI CLK) SDO -> P1.6 (SPI MISO) SDI -> P1.7 (SPI MOSI) GPIO0 -> P2.0 (I/O unused) GPIO1 -> P2.1 (I/O clear-to-send) GPIO2 -> P2.2 (I/O RX clock) GPIO3 -> P2.3 (I/O RX data) SDN -> P2.4 (shutdown / reset) IRQ -> P2.5 (I/O channel-clear) Software
    The software of dAISy consists of three major blocks:
    Radio configuration and control over SPI Packet handler, including a basic FIFO for received messages NMEA encoding and transmission to the PC over UART For UART (TX only) and SPI (TX/RX) I use the MSP430G2553's USCI A0 and B0 respectively. In both cases I don't use interrupts which simplifies things considerably.
     
    Upon reset the following steps happen:
    Initialize MSP430 peripherals Initialize packet handler, which will also reset FIFO Initialize and configure of radio, which will also setup SPI Start packet handler, which will also put the radio into receive mode And in the main loop:
    If debug messages are enabled, poll packet handler for status and errors and report them over UART Check FIFO for new packets If there is a new packet, invoke NMEA processing (which sends the message over serial to the PC) and remove packet from FIFO Below follows a more detailed discussion of the radio integration and the implementation of the packet handler.
     
    Radio
    The communication with the radio is vanilla SPI using 4 wires: MOSI (SDI), MISO (SDO), CLK (SCLK) and CS (SEL). I used the MSP430's USCI B0 to implement SPI and a separate pin to control CS.
     
    The only tricky thing to figure out was, that the Si4362 keeps the MISO line floating unless it actively transmits data. This is unfortunate as the master is supposed to poll for a specific response (FF) to detect when the radio is ready to receive more commands. This is easily fixed by adding a weak pull down resistor to SDO. I did this on the board, but it probably also works with using MSP430's internal pull-down.
     
    Additional lines I used to control the radio are:
    SDN to reset the radio CTS, which by default is mapped to the radio's GPIO1, indicating that the radio is ready for the next command While taking up an extra pin, CTS turned out to be much more convenient than the SPI response code to properly time communication flow with the radio. In dAISy, I wait for CTS to go high after each command to ensure the radio completed its task.
     
    The communication protocol is quite extensive but well documented:
    EZRadioPRO API Documentation describes the complete API and all registers AN633 Programming Guide for EZRadioPro Si4x6x Devices describes how to use the API in common scenarios Both are available on the Si4362 product page (link), under Documentation > Application Notes and are still updated quite frequently.
     
    The radio is set up by dumping a large configuration sequence into it. This includes configuration of radio frequency, modulation, GPIO pins and more. This information is stored in radio_config.h, which has to be generated with a tool called WDS (Wireless Development Suite). WDS is available in the Tools section on the Si4362 product site.
     

     
    Above are the settings I used for dAISy. WDS will use this information to configure various amplifiers, filters, clocks and decoding algorithms inside the chip. As Si4362 supports GMSK encoding only indirectly (see this thread), I'm certain there's more optimization potential by tweaking registers, but that's currently way beyond my knowledge of RF theory.
     
    While the Si4362 comes with its own packet handler, it unfortunately does not support NRZI encoding (Wikipedia). So I set up the radio to expose the 9600 baud clock and received data on separate pins and implemented my own packet handler.
     
    Packet Handler
    The packet handler (inspired by Peter Baston's implementation) is implemented as a state machine that is invoked on each rising edge of pin P2.2 which receives the data clock.
     

    There are 5 main states:
    Off, no processing of incoming data Reset, start from anew, either on start up or after successful/failed processing of a packet Wait for Sync, waiting for a training sequence to arrive (010101..) and start flag (01111110), implemented with its own state machine   Reset, start new preamble 0, last bit was a zero 1, last bit was a one flag, training sequence complete, now process start flag Prefetch, ingest the next 8 message bits to ease further processing Receive Packet, process bits until the end flag (01111110) is found or an error situation occurs Independent of state, the interrupt routine continually decodes NRZI into actual bit sequence.
     
    In the "Receive Packet" state there's continuous calculation of the packet CRC and some bit-de-stuffing. When the end flag is found and the CRC is correct, the received message is committed into the FIFO. If an error is encountered, the bytes already written to the FIFO are discarded. In both cases, the state machine starts anew by transitioning into RESET.
    This reads like a lot of code for an interrupt handler. However with the MCU running at 16MHz even the most complex state only uses a fraction (<10%) of the available time.
     
    Future Improvements
    Lastly a list of things I'd like to improve with the next version of dAISy.
     
    Software:
    Receiving on both AIS channels through channel-hopping done 1/5/2014 Tweak radio settings for better sensitivity and lower error rate LED(s) for indicating reception of valid/corrupt packets Hardware:
    Proper antenna connector Layout PCB as BoosterPack and/or USB dongle Receiving on both AIS channels at once with two radio ICs -- edit 12/25: replaced original post with high-level project description, more detailed documentation of implementation to come
    -- edit 12/28: added documentation for hardware (here and on Github), fixed some typos
    -- edit 12/31: added documentation for software and list of future improvements
    -- edit 01/05: implemented channel hopping (change to state machine)
    -- edit 01/15: changed state machine to reflect recent changes (see post further down for details), added link to shared project on OSHPark
    -- edit 01/25: major rework of sync detection state machine

  7. Like
    chicken reacted to yosh in PCB Give Away   
    @@reaper7 Good to hear :-)
     
    I use these boards for almost every project, e.g. some minutes ago I made a simple thermocouple board (see image). So in this case I used the MCU board with the OLED attached, a proto board for the MAX31855 IC and a protoboard for a LiPo Accu for regulated 3.3V output (which I made some weeks ago).
    So you could re-use the MCU board for many projects and only have to assemble the proto board for the special purpose.
     
    Attached you will find an image of the MCU board - it shows which components (resistor, caps, ...) I normally use. I can also send you the fritzing design files if you need them...

     
    Kind regards
    yosh
  8. Like
    chicken got a reaction from Adson in I think my interrupt isn't working; Code Help   
    Pin-Interrupts in Energia (and Arduino) are only for digital pins. RISING means the value of the pin changed from LOW to HIGH. You could use this to detect when a button is pressed.
  9. Like
    chicken got a reaction from energia in Odd results coming from a char* array   
    Do you try to get the integer values of these strings?
    "5","4","3","2","1"
     
    If so, the function you're looking for is atoi (ascii to integer).
    secLevel = atoi(myArray[2]);
     
    However, as long as we're talking about a single digit, you can also use
    secLevel = myarray[2][i][0]
    Note that [0] accesses the first character of the string stored at [2].
     
    Subtract 0x30 (or '0') if you want to have an integer from 0-9, but the switch statement can handle character too ('0' is a character, "0" is a string).
  10. Like
    chicken reacted to icserny in [Energia Library] Bosch BMP085 Template Library   
    Hi @@chicken
     
    Thank you very much for your BMP085 library. It works nicely also with the Software I2C Master Library for MSP430G2553 written by Rei Vilo. I tested with MSP430G2 Launchpad and a BMP180 breakout module (bought from Ebay). In the attached screenshot the final value of the pressure was corrected for altitude (that's why the dumped value of p and the pressure are different).
     
    Istvan Cserny
     

  11. Like
    chicken got a reaction from tripwire in What are you doing right now..?   
    Seems to sell like hotcakes, the UPS man just dropped a Baofeng UV-5R+ on my doorstep I hope to use it as a test signal  to fiddle with my AIS project. (Carrier signal only, I don't think it is able to transmit data)
     
    Besides that, I successfully put my $2.50 reflow oven into production. No more handsoldering of QFNs.

    Heat 0.25" aluminum slab to 160C (gently, it should be stable at 160C or only slowly increasing), add aluminum tray with PCB and temperature probe inside, cover with 2nd tray, wait till PCB reaches 160C plus another minute or so, turn up the stove to max, wait till PCB reaches 220C, take tray off the stove and let cool, season to taste.
     
  12. Like
    chicken got a reaction from Register in Problem with I2C RTC DS1307 Module   
    Taking a quick look at the code, you'll need to change at least the following:
     
    Remove this line, MSP430 can access data stored in ROM just fine without.

    5: #include <avr/pgmspace.h>  
    Related to this, remove PROGMEM directive here: (you might prefix the line with static)
     
    23: const uint8_t daysInMonth [] PROGMEM = { 31,28,31,30,31,30,31,31,30,31,30,31 }; and access to the array has to be rewritten, original:
     
    31: days += pgm_read_byte(daysInMonth + i - 1); .. 62: uint8_t daysPerMonth = pgm_read_byte(daysInMonth + m - 1); changed:
     
    31: days += daysInMonth[i - 1]; .. 62: uint8_t daysPerMonth = daysInMonth[m - 1];  
    And finally, replace this section with #include "Energia.h"
     
    13: #if (ARDUINO >= 100) 14:  #include <Arduino.h> // capital A so it is error prone on case-sensitive filesystems 15: #else 16:  #include <WProgram.h> 17: #endif
  13. Like
    chicken got a reaction from zeke in What are you doing right now..?   
    Seems to sell like hotcakes, the UPS man just dropped a Baofeng UV-5R+ on my doorstep I hope to use it as a test signal  to fiddle with my AIS project. (Carrier signal only, I don't think it is able to transmit data)
     
    Besides that, I successfully put my $2.50 reflow oven into production. No more handsoldering of QFNs.

    Heat 0.25" aluminum slab to 160C (gently, it should be stable at 160C or only slowly increasing), add aluminum tray with PCB and temperature probe inside, cover with 2nd tray, wait till PCB reaches 160C plus another minute or so, turn up the stove to max, wait till PCB reaches 220C, take tray off the stove and let cool, season to taste.
     
  14. Like
    chicken got a reaction from GeekDoc in What are you doing right now..?   
    Seems to sell like hotcakes, the UPS man just dropped a Baofeng UV-5R+ on my doorstep I hope to use it as a test signal  to fiddle with my AIS project. (Carrier signal only, I don't think it is able to transmit data)
     
    Besides that, I successfully put my $2.50 reflow oven into production. No more handsoldering of QFNs.

    Heat 0.25" aluminum slab to 160C (gently, it should be stable at 160C or only slowly increasing), add aluminum tray with PCB and temperature probe inside, cover with 2nd tray, wait till PCB reaches 160C plus another minute or so, turn up the stove to max, wait till PCB reaches 220C, take tray off the stove and let cool, season to taste.
     
  15. Like
    chicken got a reaction from bluehash in SHARP Memory Display Booster Pack   
    As suggested added board name, my name and revision information.
     
    Also moved EXTMOD jumper closer to EXTIN as the two are related, and some general untangling of wires.


  16. Like
    chicken got a reaction from PTB in What are you doing right now..?   
    Seems to sell like hotcakes, the UPS man just dropped a Baofeng UV-5R+ on my doorstep I hope to use it as a test signal  to fiddle with my AIS project. (Carrier signal only, I don't think it is able to transmit data)
     
    Besides that, I successfully put my $2.50 reflow oven into production. No more handsoldering of QFNs.

    Heat 0.25" aluminum slab to 160C (gently, it should be stable at 160C or only slowly increasing), add aluminum tray with PCB and temperature probe inside, cover with 2nd tray, wait till PCB reaches 160C plus another minute or so, turn up the stove to max, wait till PCB reaches 220C, take tray off the stove and let cool, season to taste.
     
  17. Like
    chicken reacted to uckalux in [POTM] dAISy - A Simple AIS Receiver   
    Hi
    Instead of siglal generator you can use ham VHF , on some VHF there is a power selector H, L, EL.
    Put power selector to EL it is 20mW if not put on low. Instead of antenna instal dummy load resistor; non inductive resistor (carbon) 50 ohm 2W.
    On hot part connect trimer 100k and 10k to gnd. Small signal you can take from connection between trimer and 10k.
    Signal you can adjust by trimer.
  18. Like
    chicken got a reaction from JonnyBoats in [POTM] dAISy - A Simple AIS Receiver   
    Overview
    dAISy (do AIS yourself) is a very simple AIS receiver that I developed from scratch. It is built around the Silicon Labs EZRadioPRO Si4362 receiver, using a Texas Instruments MSP430G2553 MCU for processing and the MSP-EXP430G2 v1.5 LaunchPad as development platform.

    The complete project source code and schematics are available on GitHub: https://github.com/astuder/dAISy

    Update 5/18/2015: A finished, self-contained AIS receiver based on this project is now available for purchase in my web store.
     
    AIS, short for Automatic Identification System, is a standard for tracking ships. Ships advertise their position, course and other information with short transmissions on specific frequencies (161.975 MHz and 162.025 MHz). More on Wikipedia.
     
    An AIS receiver, like dAISy, receives and decodes AIS transmissions. It then re-packages the raw data into NMEA sentences (specifically formatted ASCII strings). Finally, using a serial connection, these strings are forwarded to more capable equipment for further processing.
     

     
    If you're the lucky owner of a tricked out boat, you could connect dAISy to your navigation computer. For land lobbers like me, a more common use case is to run naval mapping software that supports AIS data input on a PC. In the screenshot below I've connected dAISy to OpenCPN (link), an open source chart plotter and navigation software.
     

     
    On the top right you can see my setup war-driving at the Seattle waterfront as my lab is too far from the coast to receive anything. The LaunchPad sits on the dashboard with a white USB cable connecting to the notebook computer in the foreground.
     
    dAISy's data is fed into OpenCPN, bottom right shows a log of the serial data received. OpenCPN maintains a database of all the collected data (lower left) and visualizes nearby ships on a map (top center), including past and projected course. Hovering the mouse over a ship will display its name (text on yellow ground) and clicking it will reveal more detail (top left).
     
    Hardware
    I wanted to build my own, non-SDR, AIS receiver for a long time. There are a few projects floating around the internet (e.g. here) which refer back to an article by Peter Baston, published 2008 in Circuit Cellar magazine (copy available here gone.. google for Peter Baston Circuit Cellar to find other copies). Unfortunately, the CMX family of modem ICs by CMS Microcircuits (link) used in these projects are relatively expensive ($15+) and hard to find for hobbyists. In addition you'd need a radio to do tune into and down-convert from the ~162 MHz carrier frequency.
     
    So I was quite excited when earlier this year a parametric search on Mouser brought up a new IC  that covered the required range (162 MHz) and modulation (GMSK). And best of all, available in single quantities for $3.56 $2.27 $2.22! (link)
     
    The Silicon Labs EzRadioPRO Si4362 (link) is a single chip receiver that covers frequencies from 142 to 1050 MHz and supports various modulations, including GMSK. It comes in a tiny 20-pin QFN package and the only external parts required are a 30 MHz crystal, an antenna with a few capacitors and inductors for impedance matching, and finally some decoupling caps and pull-down resistors.
     
    Time to whip up a breakout board. I used the opportunity to give KiCad a try and quite like it.
     
    Here's the schematic:

     
    And the layout:

     
    I used OSHPark to make the PCBs. At a smidgen over one square inch it cost  $5.15 for 3 copies:

    http://oshpark.com/shared_projects/QUWi71r4
     
    Note that the layout still has three issues that I already fixed in the schematic:
    GPIO0 and GPIO1 were flipped SDO required a pull-down resistor as the radio leaves it floating when not actively sending, which confused the hell out of me while trying to figure out the communication protocol. Lastly, the holes for the headers turned out to be slightly too small to comfortably fit the cheap breakout headers I had at hand. Edit: Here's Rev B where I fixed these issues: http://oshpark.com/shared_projects/WI6u3Qmk
     
    Which brings us to the BOM:
    Silicon Labs Si4362 (U1) 30 MHz crystal (X1) Si4362 datasheet specifies <11 pF load capacitance, but a crystal specified for 12pF load capacitance seems to work fine too Antenna/LNA matching network, calculated based on SiLabs AN643 (link, approx. values, +/- 5% shouldn't matter too much): 75 ohm (dipole): 10 pF (CR1), 5 pF (CR2), 280 nH (LR1), 200 nH (LR2) 50 ohm: 12 pF (CR1), 6 pF (CR2), 240 nH (LR1), 160 nH (LR2) Decoupling caps: 100 pF, 100 nF, 1uF (C1, C2, C3) Pull-down resistors 100 k (R1, R2) First thing I noticed when I received the parts: The 20-pin QFN at 4x4 millimeters is tiny!

     
    I mounted it by first tinning the pads with a small quantity of solder. I then added flux and placed the chip on the pad. I then used a hot air station to carefully reflow the solder. Worked the first time around.

    After using jumper wires to figure out how to talk to the chip, I mounted the breakout board on a makeshift BoosterPack using perfboard, double-sided tape and wire (see picture at the top of the post).



    Here's how I ended up connecting the breakout board to the LaunchPad / MSP430G2553:
    SEL -> P1.4 (SPI chip select) SCLK -> P1.5 (SPI CLK) SDO -> P1.6 (SPI MISO) SDI -> P1.7 (SPI MOSI) GPIO0 -> P2.0 (I/O unused) GPIO1 -> P2.1 (I/O clear-to-send) GPIO2 -> P2.2 (I/O RX clock) GPIO3 -> P2.3 (I/O RX data) SDN -> P2.4 (shutdown / reset) IRQ -> P2.5 (I/O channel-clear) Software
    The software of dAISy consists of three major blocks:
    Radio configuration and control over SPI Packet handler, including a basic FIFO for received messages NMEA encoding and transmission to the PC over UART For UART (TX only) and SPI (TX/RX) I use the MSP430G2553's USCI A0 and B0 respectively. In both cases I don't use interrupts which simplifies things considerably.
     
    Upon reset the following steps happen:
    Initialize MSP430 peripherals Initialize packet handler, which will also reset FIFO Initialize and configure of radio, which will also setup SPI Start packet handler, which will also put the radio into receive mode And in the main loop:
    If debug messages are enabled, poll packet handler for status and errors and report them over UART Check FIFO for new packets If there is a new packet, invoke NMEA processing (which sends the message over serial to the PC) and remove packet from FIFO Below follows a more detailed discussion of the radio integration and the implementation of the packet handler.
     
    Radio
    The communication with the radio is vanilla SPI using 4 wires: MOSI (SDI), MISO (SDO), CLK (SCLK) and CS (SEL). I used the MSP430's USCI B0 to implement SPI and a separate pin to control CS.
     
    The only tricky thing to figure out was, that the Si4362 keeps the MISO line floating unless it actively transmits data. This is unfortunate as the master is supposed to poll for a specific response (FF) to detect when the radio is ready to receive more commands. This is easily fixed by adding a weak pull down resistor to SDO. I did this on the board, but it probably also works with using MSP430's internal pull-down.
     
    Additional lines I used to control the radio are:
    SDN to reset the radio CTS, which by default is mapped to the radio's GPIO1, indicating that the radio is ready for the next command While taking up an extra pin, CTS turned out to be much more convenient than the SPI response code to properly time communication flow with the radio. In dAISy, I wait for CTS to go high after each command to ensure the radio completed its task.
     
    The communication protocol is quite extensive but well documented:
    EZRadioPRO API Documentation describes the complete API and all registers AN633 Programming Guide for EZRadioPro Si4x6x Devices describes how to use the API in common scenarios Both are available on the Si4362 product page (link), under Documentation > Application Notes and are still updated quite frequently.
     
    The radio is set up by dumping a large configuration sequence into it. This includes configuration of radio frequency, modulation, GPIO pins and more. This information is stored in radio_config.h, which has to be generated with a tool called WDS (Wireless Development Suite). WDS is available in the Tools section on the Si4362 product site.
     

     
    Above are the settings I used for dAISy. WDS will use this information to configure various amplifiers, filters, clocks and decoding algorithms inside the chip. As Si4362 supports GMSK encoding only indirectly (see this thread), I'm certain there's more optimization potential by tweaking registers, but that's currently way beyond my knowledge of RF theory.
     
    While the Si4362 comes with its own packet handler, it unfortunately does not support NRZI encoding (Wikipedia). So I set up the radio to expose the 9600 baud clock and received data on separate pins and implemented my own packet handler.
     
    Packet Handler
    The packet handler (inspired by Peter Baston's implementation) is implemented as a state machine that is invoked on each rising edge of pin P2.2 which receives the data clock.
     

    There are 5 main states:
    Off, no processing of incoming data Reset, start from anew, either on start up or after successful/failed processing of a packet Wait for Sync, waiting for a training sequence to arrive (010101..) and start flag (01111110), implemented with its own state machine   Reset, start new preamble 0, last bit was a zero 1, last bit was a one flag, training sequence complete, now process start flag Prefetch, ingest the next 8 message bits to ease further processing Receive Packet, process bits until the end flag (01111110) is found or an error situation occurs Independent of state, the interrupt routine continually decodes NRZI into actual bit sequence.
     
    In the "Receive Packet" state there's continuous calculation of the packet CRC and some bit-de-stuffing. When the end flag is found and the CRC is correct, the received message is committed into the FIFO. If an error is encountered, the bytes already written to the FIFO are discarded. In both cases, the state machine starts anew by transitioning into RESET.
    This reads like a lot of code for an interrupt handler. However with the MCU running at 16MHz even the most complex state only uses a fraction (<10%) of the available time.
     
    Future Improvements
    Lastly a list of things I'd like to improve with the next version of dAISy.
     
    Software:
    Receiving on both AIS channels through channel-hopping done 1/5/2014 Tweak radio settings for better sensitivity and lower error rate LED(s) for indicating reception of valid/corrupt packets Hardware:
    Proper antenna connector Layout PCB as BoosterPack and/or USB dongle Receiving on both AIS channels at once with two radio ICs -- edit 12/25: replaced original post with high-level project description, more detailed documentation of implementation to come
    -- edit 12/28: added documentation for hardware (here and on Github), fixed some typos
    -- edit 12/31: added documentation for software and list of future improvements
    -- edit 01/05: implemented channel hopping (change to state machine)
    -- edit 01/15: changed state machine to reflect recent changes (see post further down for details), added link to shared project on OSHPark
    -- edit 01/25: major rework of sync detection state machine

  19. Like
    chicken reacted to greeeg in SHARP Memory Display Breakout and Example   
    Hey, if you design a boosterpack could you please support the zebra strip version of the displays?
     
    I've bought the 96x96 and the 168x144 versions. Functionally the pin-out is identical to the FPC version, you just need another footprint.

  20. Like
    chicken got a reaction from RobG in SHARP Memory Display Breakout and Example   
    Always a sucker for displays of any form and shape I ordered one of the 1.35 inch SHARP LS013B4DN02 memory LCD when it made the rounds last year. At $20 apiece it's quite expensive for its size, but it's sooo pretty
     

     
    I finally finished up the code and published everything on Github.
    https://github.com/a...-memory-display
     
    According to the datasheet, this display runs on less than 15uW. I was not able to measure current with my lowly multimeter, so I'm pretty positive that the MSP430 plus display use way below 1mA.
     
    If the display looks familiar, that's because it was featured in the Wolverine teaser a few months back
    http://www.43oh.com/...cd-boosterpack/
     
    My code probably also works with the breakout board that fellow 43oh member reagle designed:
    http://forum.43oh.co...akout-for-sale/
     
    More information about the display at SHARP:
    http://www.sharpmemo...memory-lcd.html
     
    According to Mouser LS013B4DN02 is end-of-life. However LS013B4DN04 has very similar specs and should also work with this breakout and code. Both displays are in stock at Mouser:
    LS013B4DN02
    LS013B4DN04
     
    I have two extra PCBs including matching FPC connector (10pos .5mm) sitting in my drawer. PM me if anyone wants one, I'll give or trade them away as long as it's within the US.
     
    Regards
    Adrian
  21. Like
    chicken reacted to Fred in Online game based on MSP430 assembler: microcorruption   
    It sounds cool, but if I want to spend some time battling with buggy MSP430 code then I just write some. I appear to be quite good at that.
  22. Like
    chicken got a reaction from rado_1 in 2.2 inch LCD TFT ILI9341 Library?!   
    Which Arduino library are you using? Depending on it's implementation, adapting it might be not that hard.
  23. Like
    chicken got a reaction from rado_1 in 2.2 inch LCD TFT ILI9341 Library?!   
    On a first glance, few things you need to edit:
     
    Add #include <Energia.h> in TFTv2.h. Replacing Arduino/Seeduino entries or adding another #if clause.
     
    Unlike MSP430, AVRs need special commands to access read-only memory. In font.c:
    #include <avr/pgmspace.h> const unsigned char simpleFont[][8] PROGMEM= you can remove the include, and also the "PROGMEM" string in the declaration.
    In TVTv2.cpp line 338
    INT8U temp = pgm_read_byte(&simpleFont[ascii-0x20][i]); must be changed to
    INT8U temp = simpleFont[ascii-0x20][i]; In TFTv2.h, line 55ff there's a whole list of macros to directly access digital ports.
     
    #define TFT_CS_LOW {DDRD |= 0x20;PORTD &=~ 0x20;} #define TFT_CS_HIGH {DDRD |= 0x20;PORTD |= 0x20;} #define TFT_DC_LOW {DDRD |= 0x40;PORTD &=~ 0x40;} #define TFT_DC_HIGH {DDRD |= 0x40;PORTD |= 0x40;} #define TFT_BL_OFF {DDRD |= 0x80;PORTD &=~ 0x80;} #define TFT_BL_ON {DDRD |= 0x80;PORTD |= 0x80;} #define TFT_RST_OFF {DDRD |= 0x10;PORTD |= 0x10;} #define TFT_RST_ON {DDRD |= 0x10;PORTD &=~ 0x10;} You will have to add your own definitions of these that reflect the LaunchPad pins and ports.
  24. Like
    chicken got a reaction from rado_1 in 2.2 inch LCD TFT ILI9341 Library?!   
    At the very least you'll have to configure your pins as digital outputs with PinMode, e.g. inside of the begin method you added.
  25. Like
    chicken got a reaction from PTB in Stellaris Launchpad - Camera Flash Timer and Measurement Tool   
    Pretty sophisticated piece of equipment. I like the UI.
×
×
  • Create New...