CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB Bootloader / comm advice for PIC18F2450/2455/2550

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
GregEigsti



Joined: 12 Jan 2008
Posts: 12

View user's profile Send private message

USB Bootloader / comm advice for PIC18F2450/2455/2550
PostPosted: Sat Jan 19, 2008 1:08 pm     Reply with quote

First off thanks all for the great content on this forum; reading through your posts has helped me tremendously!

I am currently prototyping with the PIC18F2450 but will be moving on to the 2455/2550 soon as I have a need for their included eeprom. I am using PCH v4.065 and a breadboard circuit of my own design. I have the CCS ex_usb_hid.c example working in this configuration and am now ready to tackle the use of a USB bootloader. In my bootloader research I have not seen CCS' ex_usb_bootloader.c example mentioned by name in this forum - and found that there are more USB bootloader choices than I thought would be available... I do have some requirements and will continue researching but wanted to see if the membership of this forum had any advice.

My requirements include:
- USB enabled bootloader (for both prototyping work as well as field upgradability of final device)
- Ability to interact with device via USB for either bootloading or comm (get/set eeprom values, download contents of external RAM, or no USB interaction for 'normal operating mode')
- Need source for PC/Mac side bootloader (c/c++) - will be integrated into custom PC/Mac software to work with the device over USB
- Would like ability to bootload without use of a 'programming switch'; e.g. first second of device startup would be the bootloader window. This is more of a desire to reduce the complexity of the device but is not a requirement.
- PIC side code compatible with PCH.
- Bootloader locked into the PIC so that field updates that go wrong won't remove the ability to try again (e.g. the bootloader cannot be overwritten, only the firmware). I think this is standard fare but want to be safe.

And my questions are:
- The CCS ex_usb_bootloader.c/.h comments say that it works with their SIOW.exe PC program. I am not licensed to use SIOW.exe (their download utility won't fetch it for me and I believe that it is part of their suites but not command line products). Does the CCS bootloader example work with other PC/Mac software, in particular any versions with source available?
- Any advice on the use of CCS' CDC stack (or not). I don't have much USB programming experience on the PC/Mac; save one project on the Mac where I found a HID device and then interacted in a very 'comm port' like fashion (tastes like serial over USB - or CDC). To keep my life simple I may opt for the CDC option as I have done a bunch of comm/RS232 programming; I also plan on implementing a HID device to alleviate the need for a USB driver on the PC/Mac.

I just discovered the forum's FAQ and will be looking through it for some answers ;)

Thanks!
Greg
GregEigsti



Joined: 12 Jan 2008
Posts: 12

View user's profile Send private message

Updates...
PostPosted: Sun Jan 20, 2008 2:39 am     Reply with quote

Banged my head against the wall most of the day but in the end, after understanding the CCS usb bootloader code took a look at one of my .hex files. It all fell into place ;) Looks like the PC/Mac side bootloader code should just send the .hex to the PIC bootloader code as text...

Have been playing with the CDC sample code and it is working fairly well, except that usb_cdc_getc() always returns 0 when in fetches a char out of the buffer. I am using a 2450 with 4mhz oscillator and a PC (XP) to connect via USB. I have tried hyperterminal and teraterm with their default settings and both are showing the same results. My 'device' shows no other instabilities (the USB HID demo worked great).

I'm going to try to see if there is another .inf file that will maybe work a little better???

The CDC code is a minimal version of ex_usb_serial2.c that printf(usb_cdc_putc,...) a string, flashes an LED, checks for input with usb_cdc_kbhit(). If usb_cdc_kbhit() returns TRUE the code does a printf(usb_cdc_putc, "RX: %d\r\n, usb_cdc_getc()); - this printf always sends "RX: 0" back to the terminal.

usb_cdc_kbhit() seems to work correctly...

I'm going to try moving the usb_cdc_getc() out of the printf, then try reinstalling usbser.sys with a different inf, then try another PIC (2455 or 2550)...

Thanks!
Greg
GregEigsti



Joined: 12 Jan 2008
Posts: 12

View user's profile Send private message

WAHOO!
PostPosted: Sun Jan 20, 2008 3:39 am     Reply with quote

Switched over to the PIC18F2550 and my CDC RX problem went away. So I got brave, while on a roll, and put the CDC USB bootloader onto the PIC and have used it successfully a couple of times to load some simple firmware onto the PIC (using teraterm)!

So tomorrow is the day to write my 'bootloader/uploader' for the PC and the Mac. Should be pretty simple - now if I can only find those Visual Studio disks ;) <soapbox> Folks who sell OSes should give away their dev tools. Xcode for the Mac is free but I'll have to scrounge to find a copy of VS for Windows </soapbox>

I need to look at writing/reading the eeprom but don't anticipate any problems there. Would also welcome any comments regarding external RAM; thinking SD/MMC via I2C at this point...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group