| Electronics > Projects, Designs, and Technical Stuff |
| DIY Modular Test Equipment Project |
| << < (4/29) > >> |
| JPortici:
Why use two pics and not directly a usb capable one? Keep posting. I think i am in a rather simillar situation (on the verge to design an electronic load because i'll soon need one.. and i have to keep my mind occupied these days) |
| void_error:
--- Quote from: JPortici on June 03, 2016, 04:47:32 pm ---Why use two pics and not directly a usb capable one? --- End quote --- Time and money. I did look into some 16-bit PICs with USB, they're only slightly more expensive. However, what I looked at didn't have as many peripherals and/or relocatable pins which would have made both firmware and PCB layout a bit more difficult. There's also the 18F series with USB, but they don't have a PPS module or as many peripherals (which work independently of the core by the way). Initially I wanted to use those, having previously used them. The USB capable micro I mentioned is an optional extra and can be left out. Another reason is the "smart" version of the DC Electronic Load which will use the same 16F18857 micro as the User Interface, also sharing some bits of code like the fan control and I2C code (not too much but it's less work so it takes less time). |
| JPortici:
Yes. Those pic24 are more like glorified pic18.. I never liked to use those. and the dspic with usb is much, much, much more expensive. I also gave another quick look at the catalog and usb pic16 are only up to 20 pins. Too small, i agree with you. A 28 pin smart pic16 with usb would have been the best. |
| void_error:
Ran into a small problem: The User Interface uses 3.3V logic while the Waveform Generator uses 5V. Logic level shifting is required. There's a level shifting circuit using a small N-channel MOSFET which is quite popular and it'll do the job for I2C although I think it adds a singificant amount of capacitive loading. I don't plan to go anywhere above the 400kHz I2C fast mode so I think signal integrity won't suffer too much but correct me if I'm wrong. SPI is going to run at the highest speed supported by the slowest device on the bus - the MCP3201 - which is 1.6MHz, so the simple circuit used for I2C won't do the job. The Waveform Generator already uses a level shifting buffer for the square wave / PWM output, a 74LVC1T45 so I could go that route. Since I have both SPI and I2C I'm using an I2C I/O expander for the SPI chip select on the Waveform Generator board so the SPI connector only has SCK, SDI and SDO. There's going to be a +5V rail available on the Aux Digital Supply, sharing the same connector that goes to the User Interface board so I could do the level shifting there. What's the best choice for level shifting on the SPI bus? I could post an unfinished schematic if it helps more. |
| hans:
--- Quote from: JPortici on June 03, 2016, 07:48:17 pm ---Yes. Those pic24 are more like glorified pic18.. I never liked to use those. and the dspic with usb is much, much, much more expensive. I also gave another quick look at the catalog and usb pic16 are only up to 20 pins. Too small, i agree with you. A 28 pin smart pic16 with usb would have been the best. --- End quote --- PIC18 and PIC16 architectures are very similar. And I don't mean that in a positive way. The architecture is clearly not optimized for todays complex programs written in C and accessing 4K of RAM (that PIC in particular has 64 banks!). It will probably run and do it's job, but given it's limits. PIC24 is completely different architecture. The instruction set is tailored to C which results in much faster code, it has a vectorized interrupts, proper software stack, etc. dsPIC shares the same PIC24 basic CPU core, but has DSP instructions you specifically have to use. They are nice for higher throughput systems, but not a necessity for general purpose stuff. Personally the only reason I would choose a PIC16 is if I can save 1-2 chips using an (unique) onboard peripherals (like the 24-bit measurement timer). However if that is not the case, I would always start searching at PIC24 or ARM. I can understand bringing out the USB UART chip for a different reason; so you can isolate the UART to PC (this is test equipment after all). This is possible with USB but likely more complex/more expensive. However for a 28-pin PIC24 my go-to chip is the PIC24FJ64GB002. Sure it has a few less I/O and PPS pins than the PIC16F18857, but if that's a problem I would opt for the PIC24FJ64GB004. |
| Navigation |
| Message Index |
| Next page |
| Previous page |