We are the (hardware) engineers behind the Photon; Ask us Anything!

Are you kin to Tesla ?

OTA Breakpoints, Step and Repeat. Debugging is hard, let's make it easier!

1 Like

I think one of my most unusual applications, was to try to check a cable(wire) to see where it was broken. It is pretty easy to check a cable, to see if the wires are shorted, or open. But to try to determine on 100 foot wire, about where it is open???

I always wanted to check out the BASIC Stamp, because I started programming on a Tandy Color Computer 3 from Radio Shack, in BASIC. I couldn't afford to have the 5-1/4" dual floppy disk drive ($299) and didn't even have the $30 tape recorder to save programs. I would type in hundreds of lines of code just to play a game on the TV, then my mom would have me shut it off and come to dinner and I'd loose everything. I did program a Turtle OS robot in 1995 though, as part of one of my high school electronics classes. I jumped straight into assembly language with Motorola and PIC microcontrollers soon after that.

The microcontroller on the Photon really puts these old MCU's to shame though. The amount of peripherals and horsepower and ease of programming for hardly any cost is incredible! To be a kid again with this technology would be amazing.

Do you like baggy pants?

1 Like

I love me some baggy pants, but fortunately I have never received any! Always lock your computer when you walk away from it :wink:


And that's about all I can say about that! Mohit or Will can elaborate if they have tales of baggy pants.

How accurate is the 120MHz system clock on Photon…in +/- ppm ?

Looking back. I first coded on a processor that I had to build (lots of soldering). The Mark-8 , http://en.wikipedia.org/wiki/Mark-8. No keyboard, no CRT.
It was a learning experience back in 1974 (top of the line then)…

Great question... part of this is dependent on the STM32F205 and also partly dependent on the crystal oscillator used inside the PØ module. There is no spec on this accuracy in the USI datasheet, but the STM32F205 datasheet has this to say with respect to Clocks and startup:

On reset the 16 MHz internal RC oscillator is selected as the default CPU clock. The
16 MHz internal RC oscillator is factory-trimmed to offer 1% accuracy. The application can then select as system clock either the RC oscillator or an external 4-26 MHz clock source. This clock is monitored for failure. If failure is detected, the system automatically switches back to the internal RC oscillator and a software interrupt is generated (if enabled). Similarly, full interrupt management of the PLL clock entry is available when necessary (for example if an indirectly used external oscillator fails).
The advanced clock controller clocks the core and all peripherals using a single crystal or oscillator. In particular, the ethernet and USB OTG FS peripherals can be clocked by the system clock.
Several prescalers and PLLs allow the configuration of the three AHB buses, the high- speed APB (APB2) and the low-speed APB (APB1) domains. The maximum frequency of the three AHB buses is 120 MHz and the maximum frequency the high-speed APB domains is 60 MHz. The maximum allowed frequency of the low-speed APB domain is 30 MHz.
The devices embed a dedicate PLL (PLLI2S) which allow to achieve audio class performance. In this case, the I2S master clock can generate all standard sampling frequencies from 8 kHz to 192 kHz.

I'll have to relay that question to our contacts at USI and see how accurate the crystal is on the PØ and P1 modules. When I get an answer I'll add that info to the datasheet(s).

Thanks for the question!

1 Like

Cool…will be useful to know. From the datasheet I think the base crystal is 26Mhz and they must be using some PLL FOO to get to 120MHz.

Final question before signing off & greetings from Dublin Ireland.

…Just to be sure the questions aren’t being answered by a Photon

…What is (three plus two divided by zero) plus ten ?

Thanks for the AMA :slight_smile:

1 Like

3 Likes

I still think the answer is 10, if you do this with pen and paper. Am I wrong?

Hey @Jack, I sent you a PM. Let’s let the Photon Engineers answer the questions since it’s their AMA! :smiley:

5 Likes
int num1 = 3;
int num2 = 2;
int num3 = 0;
int num4 = 10;
int num5 = 0;
    
void setup() {
    num5 = (num1 + num2 / num3) + num4;
    Serial.begin(9600);
}

void loop() {
    Serial.println(num5);
    delay(1000);
}

##output

13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13
13

EDIT: I was expecting a SOS and 5 blinks for Usage Fault: detects execution of undefined instructions, unaligned memory access for load/store multiple. When enabled, divide-by-zero and other unaligned memory accesses are also detected. But In the light of transparency I posted the result as-is... and I added a github issue to fix this :wink:

Other expected error codes can be found here: http://support.particle.io/hc/en-us/articles/204357864-Flashing-Red

2 Likes

I think the open source community is wise enough to know the difference!

That'd make an excellent topic for proto2prod. We'll soon publish a detailed post on proto2prod.com on it!

That's an awesome and complicated question. I'm not going to get too far into schedules, except to say that it usually takes Spark about 6 months to go from zero to shipped product, and we've got a pretty simple product as far as the hardware goes. Allow time for mistakes and for problems, because they happen. Build your schedule, then add 33%, and you'll probably still struggle to hit the timeline. Manufacturing is hard--no way around it!

As far as budgets go, you can estimate the COGS for your product the following way:

  • Cost of materials - Use Digikey or something similar to get a good gut check. This isn't too hard.
  • Cost of assembly - For a PCB, this scales with the number of placements. $0.01 - $0.02 per placement is probably typical for China, but ultimately it comes down to how fast they can process your board...you're paying for time on your CMs very expensive machinery.
  • Cost of testing and packaging - This is driven by the cost of labor and time of assembly. Time how long it takes you to do the packaging and testing for your product, then add about 30-40% for transition overheads and the costs of administrative oversight. Rates for assembly might be $6-$8 per hour in Guangdong, and $20-$30 per hour in the US, based on quotes we've received.
  • Profit margin - Your CM has to make money. Add 10-20% of the value of the BOM to pay your CM.

Then, add in the costs of salaries and development costs, fixed costs like tooling and NREs, and you've got a back-of-the-napkin estimate for a production budget for your product :slight_smile:

Hope that helps!

2 Likes

Sorry, I didn't understand the system.

2 Likes

A giant thank you to @BDub, @mohit, and @will for the wonderful AMA!! Closing the thread now. We’ll see you all next time!

bye!!!

1 Like