Programing a C8051F380 - Page 1
Forum section: electronics / general

author: Zoszko
author_rank: Contributor
timestamp: January 17, 2015, 02:01:56 am
content: 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

author: Jeroen3
author_rank: Super Contributor
timestamp: January 17, 2015, 09:25:45 pm
content: 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/1186943Then you can use Keil uVision or Tasking to get some C running in the thing.

author: wraper
author_rank: Unknown
timestamp: January 17, 2015, 10:16:32 pm
content: Quote from: Jeroen3 on January 17, 2015, 09:25:45 pmIt is not ancient and actually quiet powerful.

author: free_electron
author_rank: Super Contributor
timestamp: January 18, 2015, 12:22:13 am
content: 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.

author: digsys
author_rank: Unknown
timestamp: January 18, 2015, 11:12:32 am
content: 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 withit 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.aspxI'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.aspxhttps://www.silabs.com/products/mcu/Pages/mcu-development-kits.aspxYou not only get the USB / Jtag interface, but a fully working dev board, software and other goodies (depending on the kit), usually for the sameprice 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.

author: dannyf
author_rank: Super Contributor
timestamp: January 18, 2015, 11:39:13 am
content: Or just go to ebay and you find those programmers less than $20.QuoteAnything but.I am a big fan of 350. Great chip.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 18, 2015, 02:19:00 pm
content: Quote from: digsys on January 18, 2015, 11:12:32 amThey 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.

author: wraper
author_rank: Unknown
timestamp: January 18, 2015, 02:41:01 pm
content: Quote from: Jeroen3 on January 18, 2015, 02:19:00 pmLOL what? It has USB and 500ksps 10 bit ADC. 48 MIPS

author: wraper
author_rank: Unknown
timestamp: January 18, 2015, 02:45:37 pm
content: about 8051 "legacy":Quote

author: dannyf
author_rank: Super Contributor
timestamp: January 18, 2015, 06:05:01 pm
content: QuoteThose silab stuff is anything but "traditional". Read a datasheet and you may be able to appreciate them.

author: Yansi
author_rank: Super Contributor
timestamp: January 18, 2015, 06:31:08 pm
content: 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.

author: digsys
author_rank: Unknown
timestamp: January 18, 2015, 10:09:04 pm
content: Quote from: Jeroen3That'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: Jeroen3Good luck with that.

author: amyk
author_rank: Super Contributor
timestamp: January 19, 2015, 01:54:37 am
content: http://www.silabs.com/Support%20Documents/TechnicalDocs/AN127.pdfhttp://www.silabs.com/Support%20Documents/TechnicalDocs/C2spec.pdfThe ISP protocol is not that much more complex than what you'd find on an AVR or PIC. They evenprovide sample code for using one of their own MCUs as a programmer.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 19, 2015, 07:18:31 am
content: 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.

author: JoeN
author_rank: Frequent Contributor
timestamp: January 19, 2015, 12:22:24 pm
content: Quote from: Jeroen3 on January 17, 2015, 09:25:45 pmThis 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.

author: digsys
author_rank: Unknown
timestamp: January 19, 2015, 01:01:46 pm
content: I don't normally continue with these type "debates", but you make some pretty ridiculous claims ...Quote from: Jeroen3I 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 tokeep 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'snot very professional. And YES, the free Keil compilers do have "bugs".Quote from: Jeroen3Nothing 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: Jeroen3What 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: Jeroen3A 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 dozenor 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 fewmore 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.

author: dannyf
author_rank: Super Contributor
timestamp: January 19, 2015, 01:06:41 pm
content: QuoteHow can they have corrupt CAN data when you didn't think they have CAN?

author: dannyf
author_rank: Super Contributor
timestamp: January 19, 2015, 01:20:44 pm
content: QuoteProgrammers are $20 or less on ebay.

author: amyk
author_rank: Super Contributor
timestamp: January 19, 2015, 03:19:44 pm
content: Quote from: Jeroen3 on January 19, 2015, 07:18:31 amYes, 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 19, 2015, 07:51:18 pm
content: This debate is endless. I give up.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.

author: dannyf
author_rank: Super Contributor
timestamp: January 19, 2015, 08:32:59 pm
content: QuoteSatirizing 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.

author: MarkL
author_rank: Unknown
timestamp: January 19, 2015, 08:53:51 pm
content: Quote from: amyk on January 19, 2015, 01:54:37 amIf 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.

author: westfw
author_rank: Super Contributor
timestamp: January 20, 2015, 12:55:28 am
content: QuoteOne 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...)

author: Bassman59
author_rank: Super Contributor
timestamp: January 20, 2015, 05:39:43 pm
content: Quote from: Jeroen3 on January 19, 2015, 07:18:31 amFunny, 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.

author: ebclr
author_rank: Super Contributor
timestamp: February 03, 2015, 03:48:18 am
content: This will solve your problem at very low costhttp://www.ebay.com/itm/New-C8051F-Emulator-USB-Downloader-Debugger-/261438602949?pt=LH_DefaultDomain_0&hash=item3cdef47ec5

author: jesuscf
author_rank: Frequent Contributor
timestamp: February 10, 2015, 03:49:15 am
content: Quote from: Bassman59 on January 20, 2015, 05:39:43 pmSome 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...

author: digsys
author_rank: Unknown
timestamp: February 10, 2015, 05:24:05 am
content: Quote from: jesuscfOn 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 anylong/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.

author: ebclr
author_rank: Super Contributor
timestamp: February 14, 2015, 08:35:11 pm
content: 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.

author: dannyf
author_rank: Super Contributor
timestamp: February 14, 2015, 09:04:42 pm
content: QuoteOne has to have absolutely no idea about those chips to call them "antique" or "obsolete".

author: jesuscf
author_rank: Frequent Contributor
timestamp: February 20, 2015, 05:41:49 pm
content: Quote from: digsys on February 10, 2015, 05:24:05 amC8051F38C 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.

author: mikerj
author_rank: Super Contributor
timestamp: February 20, 2015, 06:34:36 pm
content: Quote from: jesuscf on February 20, 2015, 05:41:49 pmYou 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.

author: Zoszko
author_rank: Contributor
timestamp: February 27, 2015, 07:32:38 pm
content: 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:Quote from: free_electron on January 18, 2015, 12:22:13 amIt'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