Author Topic: Programing a C8051F380  (Read 17862 times)

0 Members and 1 Guest are viewing this topic.

Offline ZoszkoTopic starter

  • Contributor
  • Posts: 12
  • Country: hu
    • ZoszkoWorks
Programing a C8051F380
« on: January 17, 2015, 02:01:56 am »
 I have just recieved a board with a Silicon Labs C8051F380 on it. It has something like a JTAG interface. I have got some sample .hex files for it as well. My only problem is I have got no idea how to program this. Please give me an ideo what is the cheapest way to get started with this. (Building something is definitely an option.) I have found the "owSilProg: AVR-alternative to Silabs toolstick" but those drones does not seem to use the F38X series...

BTW this question was off-topic for the dear "StackExchange" users as "Questions seeking recommendations for specific products or places to purchase them are off-topic as they are rarely useful to others and quickly obsolete. Instead, describe your situation and the specific problem you're trying to solve."

I hope you can help me programimng my new board. I have got a bootloader.hex so as we manage to get that on this MCU i can use the onboard USB or standard serial cable to program it from the Silabs IDE.

Thank you for tanking Your time and reading this!
Z
« Last Edit: January 17, 2015, 02:51:27 am by Zoszko »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Programing a C8051F380
« Reply #1 on: January 17, 2015, 09:25:45 pm »
You don't program that, it is ancient.
But if you insist you can use this thing perhaps. http://nl.farnell.com/silicon-laboratories/debugadptr1-usb/adapter-usb-debug-for-c8051fxxx/dp/1186943

Then you can use Keil uVision or Tasking to get some C running in the thing.
 

Online wraper

  • Supporter
  • ****
  • Posts: 16862
  • Country: lv
Re: Programing a C8051F380
« Reply #2 on: January 17, 2015, 10:16:32 pm »
You don't program that, it is ancient.
But if you insist you can use this thing perhaps. http://nl.farnell.com/silicon-laboratories/debugadptr1-usb/adapter-usb-debug-for-c8051fxxx/dp/1186943

Then you can use Keil uVision or Tasking to get some C running in the thing.
It is not ancient and actually quiet powerful.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Programing a C8051F380
« Reply #3 on: January 18, 2015, 12:22:13 am »
it's not ancient. the silabs processors are really good ! they got one that can run off 0.9 volts !

you need to buy the silabs programming dongle. no way around it.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Programing a C8051F380
« Reply #4 on: January 18, 2015, 11:12:32 am »
I'm with FreeE ! The Silabs implementation of the 8051, with all it's analogue / digital on-board is awesome. I've made several DOZEN projects with
it so far, and intend to do many more. The F380 is in FACT a NEW USB version - https://www.silabs.com/products/mcu/usb/Pages/default.aspx
I've used other USB types before. DON'T buy the debugger as a stand-alone, a MUCH better value option is to buy one of the VERY cheap dev kits -
https://www.silabs.com/products/mcu/Pages/DevelopmentTools.aspx
https://www.silabs.com/products/mcu/Pages/mcu-development-kits.aspx
You not only get the USB / Jtag interface, but a fully working dev board, software and other goodies (depending on the kit), usually for the same
price as others sell just the dongle. You don't need to get the dev board for your specific MPU type either !!
I've bought over a dozen different types to date, so I do know about them.
A year or so ago, after many of us complained about Kiels high prices, they made their base dev software FREE, and you can do quite a lot with it.
Hello <tap> <tap> .. is this thing on?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #5 on: January 18, 2015, 11:39:13 am »
Or just go to ebay and you find those programmers less than $20.

Quote
it is ancient.

Anything but.

I am a big fan of 350. Great chip.
================================
https://dannyelectronics.wordpress.com/
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Programing a C8051F380
« Reply #6 on: January 18, 2015, 02:19:00 pm »
I'm with FreeE ! The Silabs implementation of the 8051, with all it's analogue / digital on-board is awesome.
They do have fancy analogs ones. This one doesn't, and it is based on 8051 which can be considered legacy. (1980's)
However, due to it running on an 8051 they do not have USB or CAN peripherals, but instead they have coprocessors with some interface registers. Which offloads a lot of the protocol handling.
(do not have an interrupt while writing to those register btw, it'll corrupt your data)

But I'm a young engineer, who learned only the recent stuff. Which makes the traditional stuff look like antiques. Sorry.
 

Online wraper

  • Supporter
  • ****
  • Posts: 16862
  • Country: lv
Re: Programing a C8051F380
« Reply #7 on: January 18, 2015, 02:41:01 pm »
I'm with FreeE ! The Silabs implementation of the 8051, with all it's analogue / digital on-board is awesome.
They do have fancy analogs ones. This one doesn't, and it is based on 8051 which can be considered legacy. (1980's)
However, due to it running on an 8051 they do not have USB or CAN peripherals, but instead they have coprocessors with some interface registers. Which offloads a lot of the protocol handling.
(do not have an interrupt while writing to those register btw, it'll corrupt your data)
LOL what? It has USB and 500ksps 10 bit ADC. 48 MIPS
 

Online wraper

  • Supporter
  • ****
  • Posts: 16862
  • Country: lv
Re: Programing a C8051F380
« Reply #8 on: January 18, 2015, 02:45:37 pm »
about 8051 "legacy":
Quote
The CIP-51 employs a pipelined architecture that greatly increases its instruction throughput over the standard 8051 architecture. In a standard 8051, all instructions except for MUL and DIV take 12 or 24 system clock cycles to execute with a maximum system clock of 12-to-24 MHz. By contrast, the CIP-51 core executes 70% of its instructions in one or two system clock cycles, with only four instructions taking more than four system clock cycles and has a maximum system clock of 100 MHz. The CIP-51 has a total of 109 instructions
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #9 on: January 18, 2015, 06:05:01 pm »
Quote
Which makes the traditional stuff look like antiques.

Those silab stuff is anything but "traditional". Read a datasheet and you may be able to appreciate them.
================================
https://dannyelectronics.wordpress.com/
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Programing a C8051F380
« Reply #10 on: January 18, 2015, 06:31:08 pm »
At least some level of knowledge of old computer and microcontroller systems is I think the essential of every EE.  8051 core may be "antique", but still used in very wide range of applications today with a lot of modifications and variants, like Atmel's single cycle or 6 cycle per instruction cores, or these relatively powerfull micros from Silabs or Cypress. The x51 core is very often used as a standard building block in many new designs, including some top-level stuff from companies like TI. Lastly I saw x51 core in their USB/UART bridges and so on. This core is easy to implement, and every good EE should know how to use it, regardless how antique it might look.
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Programing a C8051F380
« Reply #11 on: January 18, 2015, 10:09:04 pm »
Quote from: Jeroen3
However, due to it running on an 8051 they do not have USB or CAN peripherals, but instead they have coprocessors with some interface registers. Which offloads a lot of the protocol handling.  (do not have an interrupt while writing to those register btw, it'll corrupt your data)   
That's funny, I use both CAN and USB fine, and never had data corruption. Maybe one day when you grow a bit more hair, you'll learn how too :-)
Quote from: Jeroen3
But I'm a young engineer, who learned only the recent stuff. Which makes the traditional stuff look like antiques. Sorry. 
Good luck with that.
Hello <tap> <tap> .. is this thing on?
 
The following users thanked this post: TheNewLab

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8270
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Programing a C8051F380
« Reply #13 on: January 19, 2015, 07:18:31 am »
We've got one of their C8051F04's (with fancy adc) in a product where development stated >5 years ago.
While upgrading and fixing bugs nobody had looked at before it turns out most of these bugs are in the hardware. Randomly corrupting sfrpage registers, corrupt can data, missing adc cycles. And now when devices are becoming networked, the demand to upgrade existing stuff is really pushing the envelope on these "antique" cores.
Sorry for pushing it off-topic. But in my opinion there is better stuff around to get started with.
The curse of being ee is that there is always something better...

A little advice on using those silabs usb jtag devices. They do not like relays. If you have a (din-rail) relay near, it'll crash the debugger. It's an issue we're having since the beginning.
« Last Edit: January 19, 2015, 07:20:47 am by Jeroen3 »
 

Offline JoeN

  • Frequent Contributor
  • **
  • Posts: 991
  • Country: us
  • We Buy Trannies By The Truckload
Re: Programing a C8051F380
« Reply #14 on: January 19, 2015, 12:22:24 pm »
...
But if you insist you can use this thing perhaps. http://nl.farnell.com/silicon-laboratories/debugadptr1-usb/adapter-usb-debug-for-c8051fxxx/dp/1186943

Then you can use Keil uVision or Tasking to get some C running in the thing.

This is correct.  I got a few of these microcontrollers as samples and this programmer works well with Keil as a cheap solution.  Keil is limited to a few K but if you can get it up and working then you can start worrying about exceeding code size limits or not.
Have You Been Triggered Today?
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Programing a C8051F380
« Reply #15 on: January 19, 2015, 01:01:46 pm »
I don't normally continue with these type "debates", but you make some pretty ridiculous claims ...
Quote from: Jeroen3
.. one of their C8051F04's (with fancy adc) ... it turns out most of these bugs are in the hardware. Randomly corrupting sfrpage registers, corrupt can data, missing adc cycles.
I write my own kernels, and code exclusively in assembler. Then I run trace points on DSOs and monitor memory/IRQs/processing times.
To date, after 35+ yrs, I have rarely had any products exhibit the problems you have, including the Silabs range from their origins.
Maybe you (or your programmers) should learn to program better and not rely on free C-compilers. Heck, even expensive C-compilers aren't perfect.
And that goes for ANY MPUs free/otherwise C-compiler. YES, they have a LOT of internal hardware and a "smart" programmer would know how to
keep that in mind and work with it.
Bottom line - If user1 has NO issues and user2 does have issues, well .. work it out. Don't trash cores just because you can't get it to work, it's
not very professional. And YES, the free Keil compilers do have "bugs".

Quote from: Jeroen3
  ..... pushing the envelope on these "antique" cores. 
Nothing wrong with the cores. Learn assembler IF you want to PUSH the MPU. Same with ANY MPU. That's supposedly your job to figure out.

Quote from: Jeroen3
  ... there is always something better... 
What the HECK does "better" mean. You chose an MPU for a job. Should I use a P7 cause it's better?? That's just a plain dumb statement. Sorry.

Quote from: Jeroen3
  ... They do not like relays. If you have a (din-rail) relay near, it'll crash the debugger ....
A lot of dev systems don't like arcing relays, or bad earths or noise or .. or .. YES, I can get the debugger to crash, as I could with ANY of my dozen
or so $10K - $20K emulators / dev systems. YES, some were more robust, but I paid a shltload for them. On some projects where I do get a few
more crashes than I'd like, I put better filtering / grounding .. a bit of rewiring and all is acceptable again. Again, that's "our" job to figure out.

All yours.
Hello <tap> <tap> .. is this thing on?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #16 on: January 19, 2015, 01:06:41 pm »
Quote
corrupt can data

How can they have corrupt CAN data when you didn't think they have CAN?
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #17 on: January 19, 2015, 01:20:44 pm »
Quote
But if you insist you can use this thing perhaps. http://nl.farnell.com/silicon-laboratories/debugadptr1-usb/adapter-usb-debug-for-c8051fxxx/dp/1186943

Programmers are $20 or less on ebay.
================================
https://dannyelectronics.wordpress.com/
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8270
Re: Programing a C8051F380
« Reply #18 on: January 19, 2015, 03:19:44 pm »
it turns out most of these bugs are in the hardware. Randomly corrupting sfrpage registers, corrupt can data, missing adc cycles.
Yes, the bugs are in the hardware - the hardware around the MCU. If you don't have enough decoupling or your power supply is noisy, you'll get symptoms like that.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Programing a C8051F380
« Reply #19 on: January 19, 2015, 07:51:18 pm »
This debate is endless. I give up.   |O
I was wrong the first post, the chip isn't ancient. It is just legacy compatible.
Not a problem. Windows is too. The 8051 part just makes it look really old.

We've apparently used a bad version, a bad (expensive) compiler and a bad initial software architecture. (not my fault :))
Now I'm chasing bugs that happen due to hardware.

There are no power supply problems, the analogs in the product are flawless, and it passed rf and conducted emc tests. Impossible with bad power supply. The debugger is maybe improperly decoupled. It's annoying. Not more that that.
You don't need the debugger for compliance testing. Do you?

The debugger came with the dev board in the box. I'm not surprised if they still do.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #20 on: January 19, 2015, 08:32:59 pm »
Quote
I'm not surprised if they still do.

Satirizing your own mistakes doesn't make them any less mistaken. You were wrong because of your content being wrong, nothing else.

The right thing to do is to man up and learn from your mistakes so you don't make them next time.
================================
https://dannyelectronics.wordpress.com/
 

Offline MarkL

  • Supporter
  • ****
  • Posts: 2131
  • Country: us
Re: Programing a C8051F380
« Reply #21 on: January 19, 2015, 08:53:51 pm »
http://www.silabs.com/Support%20Documents/TechnicalDocs/AN127.pdf
http://www.silabs.com/Support%20Documents/TechnicalDocs/C2spec.pdf

The ISP protocol is not that much more complex than what you'd find on an AVR or PIC. They even provide sample code for using one of their own MCUs as a programmer.

If you have a beaglebone or other linux dev board laying around, there's also an experimental kernel driver that implements the C2 protocol (called "c2port").  It's a bit-bang implementation and is there to allow programming of co-resident SiLabs processors.

It works fine but you need to make a new kernel since it's not made by default.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Programing a C8051F380
« Reply #22 on: January 20, 2015, 12:55:28 am »
Quote
[don't] rely on free C-compilers.
One problem with these "legacy architectures" is that no matter how you speed them up or add memory, it's still not going to be "C friendly", which makes the compilers more complex, prone to errors, and/or expensive and special-cased.  (Although, Silicon Labs now gives away a free full version of Keil's compiler, which has a pretty good reputation...)
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programing a C8051F380
« Reply #23 on: January 20, 2015, 05:39:43 pm »
We've got one of their C8051F04's (with fancy adc) in a product where development stated >5 years ago.
While upgrading and fixing bugs nobody had looked at before it turns out most of these bugs are in the hardware. Randomly corrupting sfrpage registers, corrupt can data, missing adc cycles. And now when devices are becoming networked, the demand to upgrade existing stuff is really pushing the envelope on these "antique" cores.

Funny, we've been using various SiLabs 8051s for a dozen years, and we've never had any issues like you're allegedly seeing. And this is across the whole range of their parts, from the old F005 and F006 through the F120 (quite the workhorse for us) to the F580 and the newish F850s. They get a lot of use in housekeeping applications, so the ADC gets lots of use. They all work as advertised. What sort of debugging did you do? Sounds like you had power-supply issues.

We did note that if you overrange the ADC inputs on the F005, the chip dies.

 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 

Offline jesuscf

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: ca
Re: Programing a C8051F380
« Reply #25 on: February 10, 2015, 03:49:15 am »
We did note that if you overrange the ADC inputs on the F005, the chip dies.

Some ADCs from other micro-controller and ADC manufacturers (for example Atmel's AT89LP51RD2 & Microchip's MCP3008) have a voltage limiter built using two diodes and a series resistance connected to the analog inputs.  I have the impression that such protection circuit (or equivalent) may not be present in the Silabs' C8051F38x ICs.  I may be wrong though as the data sheet for the C8051F38x says the pins are 5V tolerant.  Perhaps it is time for some destructive tests...
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Programing a C8051F380
« Reply #26 on: February 10, 2015, 05:24:05 am »
Quote from: jesuscf
  ... Perhaps it is time for some destructive tests...   
On similar spec MPUs in that series, I can vouch that they don't like 12V ! I've had ~5.5V on ADC pins on many occasions, without any
long/short term effects. either with Internal or external VRef. It was always one of those "oops" design testing moments :-)
The pdf says Max 5.8V for that part.
Hello <tap> <tap> .. is this thing on?
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Programing a C8051F380 Not antique, In fact very modern and powerfull
« Reply #27 on: February 14, 2015, 08:35:11 pm »
For those ones, that don't know Silabs products, read the data sheet, and try to use before consider they antique or obsolete, In fact they are quite good, fast , flexible and cheap, and also extremely easy to use, with descent and cheap tools, and you can find anywhere debugger for this line ,for only USD 10 to flash and debug,  don't thing they are same as intel 8051 they aren't, they are old stuff made with new tech, have More mips that near all Pics and Atmels on same price level, with models with 24 bit ad converter on chip, also hardware multiply and division is a standard in all models, you can set any pin using the cross bar to do several functions, making the pcb work quite easy, very flexible power supply, and models with works for hours with a 1F capacitor as power supply, don't underestimate this best, They are the best options for small 8 bits systems . Try before criticize will worth the time.
 
The following users thanked this post: grantb5

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Programing a C8051F380
« Reply #28 on: February 14, 2015, 09:04:42 pm »
Quote
before consider they antique or obsolete

One has to have absolutely no idea about those chips to call them "antique" or "obsolete".
================================
https://dannyelectronics.wordpress.com/
 

Offline jesuscf

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: ca
Re: Programing a C8051F380
« Reply #29 on: February 20, 2015, 05:41:49 pm »
Quote from: jesuscf
  ... Perhaps it is time for some destructive tests...   
On similar spec MPUs in that series, I can vouch that they don't like 12V ! I've had ~5.5V on ADC pins on many occasions, without any
long/short term effects. either with Internal or external VRef. It was always one of those "oops" design testing moments :-)
The pdf says Max 5.8V for that part.

C8051F38C pin with 1k ohm in series.  Applied 60Hz AC, 10V peak, from function generator (50 ohm output impedance).  Nothing bad happened as far as I can see.  The ADC works normally and within specs.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Programing a C8051F380
« Reply #30 on: February 20, 2015, 06:34:36 pm »
Quote from: jesuscf
  ... Perhaps it is time for some destructive tests...   
On similar spec MPUs in that series, I can vouch that they don't like 12V ! I've had ~5.5V on ADC pins on many occasions, without any
long/short term effects. either with Internal or external VRef. It was always one of those "oops" design testing moments :-)
The pdf says Max 5.8V for that part.

C8051F38C pin with 1k ohm in series.  Applied 60Hz AC, 10V peak, from function generator (50 ohm output impedance).  Nothing bad happened as far as I can see.  The ADC works normally and within specs.

You weren't actually applying 12v to the ADC in that case, the internal protection diodes would clamp the input voltage one Vf above Vdd and your external resistor limited the maximum current.

Certainly not good design practice.  It's using the device outside it's specifications and what can appear to work correctly initially can show up some very odd behavior later.  On some PICs is you forward bias the protection diodes on one of the the analog inputs, that channel can appear to work correctly whilst causing other channels to read incorrectly.
 

Offline ZoszkoTopic starter

  • Contributor
  • Posts: 12
  • Country: hu
    • ZoszkoWorks
Re: Programing a C8051F380
« Reply #31 on: February 27, 2015, 07:32:38 pm »
WoW I am impressed, I have not recieved any notifications on this topic.  :-// But I am glad, I gave you something to talk about it.

As free_electron said:
you need to buy the silabs programming dongle. no way around it.

It's true, however buying the programmer did not solved it right away. I though my board is dead as the IDE said it cant identify the IC. I was trying everything except openin the bloody debug adapter. After 3 weeks I have ended up opening the little white box. Turns out they have f***** up the assembly (The 10pin connector was sitting on only one of the rows). QC pass sticker, srsly?

~Zoszko
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf